Servizi e prodotti Services Enterprise Solutions Training Documentation Area About Red Hat
  download storecart
red hat logo
redhat.comredhat network

Red Hat Documentation

Overview | HOWTOs | mini-HOWTOs | FAQs | Linux Man-Pages

Database-SQL-RDBMS HOW-TO document for Linux (PostgreSQL Object Relational Database System): "C", "C++", ESQL/C language Interfaces and Bitwise Operators for PostgreSQL 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:

  • The ESQL/C libraries of C functions provide access to the database server.
  • The ESQL/C header files provide definitions for the data structures, constants, and macros useful to the ESQL/C program.
  • The ESQL/C preprocessor, is a source-code preprocessor that converts a C file containing SQL statements into an executable file.
It is at
  • ESQL/C for PostgreSQL is already included in the distribution.
  • Main site ftp://ftp.lysator.liu.se/pub/linus
  • Email : linus@epact.se
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
  • ftp://ftp.overnet.com.ar/pub/utils/linux/bitpgsql.tgz
Makefile for Linux is included.
Next Previous Contents

 

 


 
© 2003 Red Hat, Inc. All rights reserved.
About Red Hat  :  Legal statement  :  Privacy statement  :  Y2K statement  :  Contact Red Hat