LOAD(l)                                                   LOAD(l)

NAME
       LOAD - Dynamically loads an object file

SYNOPSIS
       LOAD 'filename'

   INPUTS
       filename
              Object file for dynamic loading.

   OUTPUTS
       LOAD   Message returned on successful completion.

       ERROR: LOAD: could not open file 'filename'
              Message  returned  if  the  specified  file  is not
              found. The file must be  visible  to  the  Postgres
              backend, with the appropriate full path name speci-
              fied, to avoid this message.

DESCRIPTION
       Loads an object (or ".o") file into the  Postgres  backend
       address  space.  Once  a  file is loaded, all functions in
       that file can be accessed. This function is used  in  sup-
       port of user-defined types and functions.

       If  a  file  is  not  loaded  using LOAD, the file will be
       loaded automatically the first time the function is called
       by  Postgres.   LOAD  can also be used to reload an object
       file if it has been edited and  recompiled.  Only  objects
       created  from C language files are supported at this time.

   NOTES
       Functions in loaded object files should not call functions
       in other object files loaded through the LOAD command. For
       example, all functions in file A should call  each  other,
       functions  in  the standard or math libraries, or in Post-
       gres itself. They should not call functions defined  in  a
       different  loaded  file  B.   This  is  because  if  B  is
       reloaded, the Postgres loader is not able to relocate  the
       calls  from  the functions in A into the new address space
       of B.  If B is not reloaded, however, there will not be  a
       problem.

       Object files must be compiled to contain position indepen-
       dent code.  For  example,  on  DECstations  you  must  use
       /bin/cc  with  the -G 0 option when compiling object files
       to be loaded.

       Note that if you are porting Postgres to a  new  platform,
       LOAD will have to work in order to support ADTs.

USAGE
       Load the file /usr/postgres/demo/circle.o:

       LOAD '/usr/postgres/demo/circle.o'

COMPATIBILITY
   SQL92
       There is no LOAD in SQL92.

SQL - Language Statements 15 August 1999                        1