From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ken Plumbly <kvp@ocol.com>
Cc: pgsql-interfaces@hub.org
Subject: Re: [INTERFACES] order by in c (libpq)?
Date: Tue, 15 Jun 1999 10:02:30 -0400
Message-ID: <22613.929455350@sss.pgh.pa.us> (raw)
In-Reply-To: <3765C0C7.C401342E@ocol.com>
Ken Plumbly <kvp@ocol.com> writes:
> I am sending the query thusly:
> sprintf(querystr, "select * from %s order by %s", table, field);
> However the query always comeback in the order in which the data was
> originally entered into the data base.
That is odd, and fairly hard to credit. One thing I'd wonder about
right away is if you are actually sending the query you think you are.
You might try turning on debug tracing in the backend (make the
connection with PGOPTIONS = "-d 1" or "-d 2" or so) and checking the
postmaster log to see what query the backend reports receiving.
If you can duplicate the failure-to-order when issuing the query
manually in psql, then you've got a backend bug that ought to be
reported as such. But first I'd suspect some silly little typo
in your app code, like sending the wrong query string or inspecting
the wrong PGresult...
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, kvp@ocol.com, pgsql-interfaces@hub.org
Subject: Re: [INTERFACES] order by in c (libpq)?
In-Reply-To: <22613.929455350@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