From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andreas Pflug <pgadmin@pse-consulting.de>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: PostgreSQL Development <pgsql-hackers@postgresql.org>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: [HACKERS] PQfnumber and quoted identifiers
Date: Sun, 05 Oct 2003 14:02:18 -0400
Message-ID: <6598.1065376938@sss.pgh.pa.us> (raw)
In-Reply-To: <3F80583E.3030606@pse-consulting.de>
References: <Pine.LNX.4.44.0310051632370.2745-100000@peter.localdomain>
<3F803498.8080400@pse-consulting.de>
<1258.1065373207@sss.pgh.pa.us>
<3F80583E.3030606@pse-consulting.de>
Andreas Pflug <pgadmin@pse-consulting.de> writes:
> If you change it, please give me a chance to code it version-aware so
> quoting/non-quoting can be performed dependent on libpq in use.
If you want a run-time test, the most reliable way would be to directly
test what PQfnumber does --- for instance, make a query known to
contain the column name "foo", and see what PQfnumber(res, "\"foo\"")
returns. I'm not sure there is any other solution, since we can't
retroactively install a version identifier in old libpq releases.
For a compile-time test, you could perhaps look to see if
PG_DIAG_SQLSTATE or one of the other new macros in postgres_ext.h
is defined. Not sure you really want a compile-time test though;
it'd break very easily if you get linked against some other version
of the library.
As for the more general question of whether to offer libpq version
identification going forward, I have no strong opinion on whether
it's really useful or not. If it's wanted, I'm tempted to suggest
that PQparameterStatus() could be extended to recognize "libpq_version"
paralleling "server_version". Not sure about a clean way to expose
the version at compile time.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: tgl@sss.pgh.pa.us, pgadmin@pse-consulting.de, peter_e@gmx.net, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] PQfnumber and quoted identifiers
In-Reply-To: <6598.1065376938@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox