Hi,
I am writing a Java Swing application and want to add Embedded SQL to it. The application should interact with a PostgreSQL database running on my local machine. The compiler complains that it cannot find the org.postgresql package included in the code. I'm guessing the problem is that... (0 Replies)
Guys,
I guess, I posted something in the wrong forum. Here it is -
https://www.unix.com/shell-programming-scripting/67395-perl-postgrepsql-question.html
Can you please help me with this?
Regards,
garric (0 Replies)
Hi guys.
I was was designing a simple database in postgresql. I wrote a perl function in postgresql and execute it. suddenly i saw that it is running in an infinite loop. After i stopped executing of the query, i saw that CPU is in 90%+ load. I looked at process list and there it was. postgresql... (1 Reply)
I am first year year student .. and i need help
i tried to work with PostgreSQL but when i open the terminal, i face problem in how to reach to PostgreSQL . always i get message it says that " can not find server " .
so what shall i do please .....:( (9 Replies)
I am trying to run vacuumdb script. but it exits with an error:
"ld.so.1: vacuumdb:fatal libpq.so.5 open failed no such file or directory"
same error is with some other pstgre commands.
please, help.
thanks.
edit: it seems I need to set LD_LIBRARY_PATH properly. but how to add to it?... (0 Replies)
Hi all,
I want to install two postgreql 8.3.5 instances on same servers. already one instalce is running on default port and i need it to be installed on another port.. How ever i achived installing the second instance.. but the problem is if i create a new user using createuser in the newly... (3 Replies)
How to copy a file from directroy/ prior version to the directory/ new version automatically. (4 Replies)
Discussion started by: roy1912
4 Replies
LEARN ABOUT REDHAT
ecpg
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 function 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 preferrably have the extension
.pgc, in which case the extension 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 overridden 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. Currently, 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 PostgreSQL include directory which is defined at compile 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 direc-
tory. 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 appropriate for the installation can be found out using pg_config(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 description of the embedded SQL interface
Application 2002-11-22 ECPG(1)