pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #18606: syntax error at or near "ROWS"
2+ messages / 2 participants
[nested] [flat]

* BUG #18606: syntax error at or near "ROWS"
@ 2024-09-09 07:40  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2024-09-09 07:40 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: kristone@hotmail.com

The following bug has been logged on the website:

Bug reference:      18606
Logged by:          Kristian Ivarsson
Email address:      kristone@hotmail.com
PostgreSQL version: 16.4
Operating system:   Microsoft Windows 10 Enterprise Version 10.0.19044
Description:        

Using installed version16.4 (even though SQL_DBMS_NAME says version 16.0.4)
with driver PSQLODBC35W.DLL version 13.02.0000)

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```

but some more complex SQL statements (with ```OFFSET ? ROWS FETCH FIRST ?
ROW ONLY```) works just fine

Having fixed values (e.g. ```OFFSET 100 ROWS FETCH FIRST 10 ROW ONLY```)
works just fine

I still haven't figured out the pattern what the differences really are that
make some statements to work and some not to work (I haved dugged into the
open source code at all (yet))

/ Kristian



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #18606: syntax error at or near "ROWS"
@ 2024-09-09 14:42  Tom Lane <tgl@sss.pgh.pa.us>
  parent: PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2024-09-09 14:42 UTC (permalink / raw)
  To: kristone@hotmail.com; +Cc: pgsql-bugs@lists.postgresql.org

PG Bug reporting form <noreply@postgresql.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





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-09-09 14:42 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-09-09 07:40 BUG #18606: syntax error at or near "ROWS" PG Bug reporting form <noreply@postgresql.org>
2024-09-09 14:42 ` 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