Next Previous Contents

25. "C", "C++", ESQL/C language Interfaces and Bitwise Operators for PostgreSQL

25.1 "C" interface

It is included in distribution and is called 'libpq'. Similar to Oracle OCI, Sybase DB-lib, Informix CLI libraries.

25.2 "C++" interface

It is included in distribution and is called 'libpq++'. See the section - Testing C and C++ PostgreSQL interface

25.3 ESQL/C

ESQL/C 'Embedded C Pre-compiler' for PostgreSQL ESQL/C is like Oracle Pro*C, Informix ESQL/C. The PostgreSQL ESQL/C is an SQL application-programming interface (API) enables the C programmer to create custom applications with database-management capabilities. The PostgreSQL ESQL/C allows you to use a third-generation language with which you are familiar and still take advantage of the Structured Query Language (SQL).

ESQL/C consists of the following pieces of software:

It is at See the section - Testing Embedded SQL/C interface to PostgreSQL

To use Vim color editor to edit 'ecpg' files (*.pgc), you must do the following:-


bash$ su - postgres
bash$ mkdir $HOME/vim
And create a file '$HOME/vim/myfilestypes.vim' which has these lines

    " myfiletypefile
        au! BufRead,BufNewFile *.pgc    set filetype=esqlc

You should have $HOME/.gvimrc file. If not create one, refer to Vim howto doc at http://metalab.unc.edu/LDP/HOWTO/Vim-HOWTO.html Put the following line in $HOME/.gvimrc file
let myfiletypefile = "~/vim/myfiletypes.vim"

Now, if you edit with
bash$ gvim sample.pgc

you will get the color syntax highlighted.

25.4 BitWise Operators for PostgreSQL

Bitwise operators was written by Nicolas Moldavsky

"C" functions that implement bitwise operators (AND, OR, XOR, bit complement) on pgsql. Get them by anonymous FTP from Makefile for Linux is included.
Next Previous Contents