ecpg man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]

ECPG(1)		  PostgreSQL Client Applications	  ECPG(1)

NAME
       ecpg - embedded SQL C preprocessor

SYNOPSIS
       ecpg [ option... ] file...

DESCRIPTION
       ecpg  is	 the embedded SQL preprocessor for C programs. It
       converts C programs with embedded SQL statements to normal
       C code by replacing the SQL invocations with special func-
       tion calls. The output files can then  be  processed  with
       any C compiler tool chain.

       ecpg  will  convert  each  input file given on the command
       line to the corresponding C output file. Input files  pre-
       ferrably have the extension .pgc, in which case the exten-
       sion will be replaced by .c to determine the  output  file
       name. If the extension of the input file is not .pgc, then
       the output file name is computed by appending  .c  to  the
       full file name.	The output file name can also be overrid-
       den using the -o option.

       This reference page does not  describe  the  embedded  SQL
       language.  See the PostgreSQL Programmer's Guide for that.

OPTIONS
       ecpg accepts the following command-line arguments:

       -c     Automatically generate C code from SQL  code.  Cur-
	      rently, this works for EXEC SQL TYPE.

       -D symbol
	      Define a C preprocessor symbol.

       -I directory
	      Specify  an  additional  include path, used to find
	      files included via EXEC SQL INCLUDE. Defaults are .
	      (current	directory), /usr/local/include, the Post-
	      greSQL include directory which is defined	 at  com-
	      pile  time (default: /usr/local/pgsql/include), and
	      /usr/include, in that order.

       -o filename
	      Specifies that ecpg should write all its output  to
	      the given filename.

       -t     Turn  on	autocommit of transactions. In this mode,
	      each query is automatically committed unless it  is
	      inside   an  explicit  transaction  block.  In  the
	      default mode, queries are committed only when  EXEC
	      SQL COMMIT is issued.

       -v     Print  additional information including the version
	      and the include path.

       ---help
	      Show a brief summary of  the  command  usage,  then
	      exit.

       --version
	      Output version information, then exit.

NOTES
       When compiling the preprocessed C code files, the compiler
       needs to be able to find the  ECPG  header  files  in  the
       PostgreSQL include directory. Therefore, one might have to
       use the	-I  option  when  invoking  the	 compiler  (e.g.,
       -I/usr/local/pgsql/include).

       Programs	 using C code with embedded SQL have to be linked
       against the libecpg library, for example using  the  flags
       -L/usr/local/pgsql/lib -lecpg.

       The value of either of these directories that is appropri-
       ate for the installation can be found  out  using  pg_con-
       fig(1).

EXAMPLES
       If you have an embedded SQL C source file named prog1.pgc,
       you can create an executable program using  the	following
       sequence of commands:

       ecpg prog1.pgc
       cc -I/usr/local/pgsql/include -c prog1.c
       cc -o prog1 prog1.o -L/usr/local/pgsql/lib -lecpg


SEE ALSO
       PostgreSQL Programmer's Guide for a more detailed descrip-
       tion of the embedded SQL interface

Application		    2002-11-22			  ECPG(1)
[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net