Re: [INTERFACES] order by in c (libpq)?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ken Plumbly <kvp(at)ocol(dot)com>
Cc: pgsql-interfaces(at)hub(dot)org
Subject: Re: [INTERFACES] order by in c (libpq)?
Date: 1999-06-15 14:02:30
Message-ID: 22613.929455350@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Ken Plumbly <kvp(at)ocol(dot)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

Browse pgsql-interfaces by date

  From Date Subject
Next Message Peter Mount 1999-06-15 14:02:38 RE: [INTERFACES] still the driver and IE5 problem
Previous Message Georg Ritter 1999-06-15 13:32:29 still the driver and IE5 problem