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@appl-ecosys.com
http://www.appl-ecosys.com