Re: BUG #18606: syntax error at or near "ROWS"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: kristone(at)hotmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18606: syntax error at or near "ROWS"
Date: 2024-09-09 14:42:46
Message-ID: 3145581.1725892966@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> This error occurs only with some statements when using binding parameters
> through ODBC

> This statement is an example of when the error occurs

> ```SELECT "Id","Begin","End","Logfile" FROM "ServerSession" ORDER BY "Begin"
> ASC OFFSET ? ROWS FETCH FIRST ? ROW ONLY```

Hmm, what that should look like when it gets to the server,
I imagine, is

SELECT "Id","Begin","End","Logfile" FROM "ServerSession" ORDER BY "Begin"
ASC OFFSET $1 ROWS FETCH FIRST $2 ROW ONLY;

which works just fine for me. I'd suggest peeking into the postmaster
log to see what ODBC is actually sending in the problem cases. I'm
guessing that pgsql_odbc is doing something bizarre, in which case
you'd be best advised to report this on the pgsql-odbc mailing list.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2024-09-09 15:16:33 BUG #18607: UNION ALL discards all foreign key relations + indexes
Previous Message Thomas Munro 2024-09-09 08:57:56 Re: BUG #18146: Rows reappearing in Tables after Auto-Vacuum Failure in PostgreSQL on Windows