Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1snfbV-005FbK-1u for pgsql-bugs@arkaria.postgresql.org; Mon, 09 Sep 2024 14:42:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1snfbU-00DHaT-NY for pgsql-bugs@arkaria.postgresql.org; Mon, 09 Sep 2024 14:42:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1snfbU-00DHaK-Fh for pgsql-bugs@lists.postgresql.org; Mon, 09 Sep 2024 14:42:56 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1snfbN-000JXz-V4 for pgsql-bugs@lists.postgresql.org; Mon, 09 Sep 2024 14:42:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 489EgkFs3145582; Mon, 9 Sep 2024 10:42:47 -0400 From: Tom Lane To: kristone@hotmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18606: syntax error at or near "ROWS" In-reply-to: <18606-7a775256cbcf4c1e@postgresql.org> References: <18606-7a775256cbcf4c1e@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 09 Sep 2024 07:40:41 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3145580.1725892966.1@sss.pgh.pa.us> Date: Mon, 09 Sep 2024 10:42:46 -0400 Message-ID: <3145581.1725892966@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form 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