pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedorder by in c (libpq)?
2+ messages / 2 participants
[nested] [flat]
* order by in c (libpq)?
@ 1999-06-15 02:56 Ken Plumbly <kvp@ocol.com>
1999-06-15 14:02 ` Re: [INTERFACES] order by in c (libpq)? Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Ken Plumbly @ 1999-06-15 02:56 UTC (permalink / raw)
To: pgsql-interfaces@hub.org
Hi All, I am writing an app in c, everything works fine except for the
order by in my query.
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.
The variable field does actually contain a valid field name, I have
checked
it.
Any ideas????
Ken
kvp@ocol.com
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [INTERFACES] order by in c (libpq)?
1999-06-15 02:56 order by in c (libpq)? Ken Plumbly <kvp@ocol.com>
@ 1999-06-15 14:02 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 1999-06-15 14:02 UTC (permalink / raw)
To: Ken Plumbly <kvp@ocol.com>; +Cc: pgsql-interfaces@hub.org
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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1999-06-15 14:02 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-06-15 02:56 order by in c (libpq)? Ken Plumbly <kvp@ocol.com>
1999-06-15 14:02 ` Tom Lane <tgl@sss.pgh.pa.us>
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