libpq or ecpg?

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: libpq or ecpg?
Date: 2002-02-18 16:33:44
Message-ID: Pine.LNX.4.44.0202180825240.21559-100000@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

After several years of dinking with postgres from the interactive
interface, I'm finally getting to writing my accounting system. The front
end will be gtk+ (with full key bindings for those of us who prefer to work
strictly from the keyboard) and the middleware will be C. I've read the 7.2
Programmers Manual and both books I have and cannot make a rational decision
on whether to use libpq or ecpg. So I'm asking for your thoughts.

From what I've read, both are solid pathways into the postgres backend.
libpq is the internal interface, well documented everywhere and appears rock
solid. ecpg has the major advantage of taking care of the typecasting
between numeric forms (int, float, numeric) and char. That is appealing as
it's one less detail to get wrong as I focus on writing the software.
Unfortunately, ecpg does not appear to be as thoroughly documented as is
libpq. For an apprentice postgres coder, that's a disadvantage.

I'd greatly appreciate reading suggestions and opinions from those more
experienced than I. Are there criteria that can be applied to select one
interface rather than the other? Are there some examples of ecpg in working
code that illustrate how to properly (and effectively) use it? I prefer to
not choose by flipping a coin. :-)

Many thanks,

Rich

Dr. Richard B. Shepard, President

Applied Ecosystem Services, Inc. (TM)
2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A.
+ 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | rshepard(at)appl-ecosys(dot)com
http://www.appl-ecosys.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Gould 2002-02-18 16:40:47 Logging user queries - Trigger for Select?
Previous Message Jean-Luc Lachance 2002-02-18 16:30:33 Re: calculating spherical distance in sql