On 18-Oct-98 Phil Romig wrote:
> I would appreciate some clarification regarding the C++ interface for
> postgres. I am using postgres-6.3.2. The database lives on a linux box
> but the applications I am working on need to run under several different
> flavors of Unix (HPUX, Solaris, Linux).
> The libpq++ source files all have Feb 13, 1997 listed in their header as
> their source control date. However the man page in the same directory
> is dated July 1995.
> If anyone could shed some light on any of the following I would be very
> a) The man page does not seem to match the code at all. Is there a
> newer man page (I noticed a request for documentation in the archives
> but did not find a response).
This is true of most PostgreSQL documentation, IMHO.
> b) Do I have the most up to date version of the pq++ library.
> c) The header file c.h for libpq (which are included by libpq++) is
> interacting with the version of the GNU standard stream library which I
> have (gnu 2.8.x and egcs 1.0.2). The problem seems to be the prototype
> for the function char* form(...). Both stream.h and c.h prototype a
> function of with the same name and arguments. Is this a known problem,
> and is there a fix? (it looks like it would be fairly simple for me to
> change libpg's form to some other name, but I'd rather use a standard
> fix if I can).
> d) I have never looked at ODBC (and am not 100% sure I know what it is).
> The applications I am working on are fairly straightforward. They
> currently use at flat table style database (gdbm). I am looking for the
> best interface to use to move these applications to postgres (where best
> is a function which maximizes reliability and minimizes my learning
> curve). The interface I use needs to be able to run on host different
> from the one running postgres.
Based solely on the opinion of others whose opinions have
proven worth listening to, I'd advise not to bother using ODBC unless
you're looking for PC compatibility. ODBC has a reputation for requiring
more CPU and memory than other competing technologies. I've found the
PostgreSQL TCP-based interface to be pretty handy, but I don't have
any MSDOS/Windows client, either. You only mentioned flavors of Unix
OS in your description of your project, so I wouldn't think you'd care
about Windows apps, either.
> In the combined wisdom of the group should I (1) forget libpq++ and
> simply use libpq (2) use libpg++ or (3) take the trouble to install and
> learn ODBC?
Have you looked at using embedded SQL for C? It's not a C++
interface, but it's sorta like standard embedded SQL, so it would
probably be easy to port to other databases. I recently ported some
Informix ESQL/C-based libraries of mine over to the PostgreSQL ESQL/C
without too much trouble. The major annoyances with the current version
, which is called "ecpg", and came with PostgreSQL 6.3.2, are:
* an almost total lack of usefuldocumentation. This can be
gotten around by using ESQL documentation for other products, like
* no macro statement (i.e., an "EXEC SQL DEFINE"). This has been
added in the new version, if I've read the newsgroup archives correctly.
ecpg is described somewhere on the www.postgresql.org site.
If you're looking for something more graphical, there's also a
Tcl/Tk library for PostgreSQL called "libpgtcl". There's a good example
of programming in this interface called "pgaccess". While Tcl/Tk is
interpreted, I've found it often performs as well as compiled Motif
applications in similar circumstances. I've run pgaccess on various
Unix systems (Sun, HP, Linux) to access databases on Linux and HP hosts.
Hooks have been provided in Tcl to allow the use of compiled libraries,
so if you already have C++ code that you want to use in your new
application, you might be able to graft them into it through this
Date: 20-Oct-98 Time: 13:05:56
Craig Orsinger (email: <orsingerc(at)epg(dot)lewis(dot)army(dot)mil>)
Bldg. 8B28 "Just another megalomaniac with ideas above his
6th & F Streets station. The Universe is full of them."
Ft. Lewis, WA 98433 - The Doctor
In response to
pgsql-interfaces by date
|Next:||From: Tom Lane||Date: 1998-10-20 21:16:07|
|Subject: Re: [INTERFACES] Connection via remote client |
|Previous:||From: David Hartwig||Date: 1998-10-20 15:38:27|
|Subject: Re: [INTERFACES] C++ Builder (Delphi), ODBC and large objects|