Thread: ECPG usage

ECPG usage

From
"Jasbinder Bali"
Date:
Hi
Can anyone help me with the usage of ECPG??
Like how to go about it, what all header files to include in my C file
and other things that i need to give due considerations before using ECPG

~Jas

Re: ECPG usage

From
Richard Broersma Jr
Date:
> Hi
> Can anyone help me with the usage of ECPG??
> Like how to go about it, what all header files to include in my C file
> and other things that i need to give due considerations before using ECPG

Sorry, I don't really know.  I've never used it. But I can try to take a guess from 2 minutes I
scanned over the PostgreSQL manual.

It seems that you would write your script using only normal C and ecpg syntax.  (I am not sure
this is correct).

Such a file can not be compiled directly.  It has to be feed to a preprocessor first:

ecpg prog1.pgc

which generates -> prog1.c
The newly created C file is what is actually processed by the C processor.  The syntax conforms to
that from libpq.

cc -c prog1.c


So, maybe "long story short" if you want to code exclusively in C and do not want to worry about
preprocessing then you should take a look at the following:
http://www.postgresql.org/docs/8.1/interactive/libpq.html

If anyone would like to correct any of my assumptions, please feel free. :-)

Regards,

Richard Broersma Jr.

Re: ECPG usage

From
Reid Thompson
Date:
Jasbinder Bali wrote:
> Hi
> Can anyone help me with the usage of ECPG??
> Like how to go about it, what all header files to include in my C file
> and other things that i need to give due considerations before using ECPG
>
> ~Jas
see  <headOfPgSourceTree>/src/interfaces/ecpg  ( test has several examples )