Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g09FbTB13197 for ; Wed, 9 Jan 2002 10:37:29 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g09FbIg07396; Wed, 9 Jan 2002 10:37:18 -0500 (EST) To: Torbj=?ISO-8859-1?B?9g==?=rn Andersson cc: pgsql-sql@postgresql.org, Tomas Eriksson , Martin Eriksson , Magnus Hultin , Archibald Zimonyi , skystone@bigfoot.com Subject: Re: Nested loops and $13 In-reply-to: References: Comments: In-reply-to Torbj=?ISO-8859-1?B?9g==?=rn Andersson message dated "Wed, 09 Jan 2002 15:19:55 +0100" Date: Wed, 09 Jan 2002 10:37:18 -0500 Message-ID: <7393.1010590638@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200201/63 X-Sequence-Number: 6154 Torbj=?ISO-8859-1?B?9g==?=rn Andersson writes: > safari=# SELECT func_air_fare_copy(31,76,'20021010','20011212',2,2); > ERROR: parser: parse error at or near "$13" > I only use 6 variables so $13 has me stumped, ideas anyone?? The $13 is probably being inserted by plpgsql into one of the queries that it feeds down to the main SQL parser, as a placeholder for one of your plpgsql variables. What this is telling you is that there's a syntax error in one of the SQL queries, but unfortunately it's not telling you much about exactly where. Easiest way to isolate the problem is to turn on query logging (set debug_print_query = true) before you run the function for the first time; then look in the postmaster log to see the passed-down queries. BTW, I believe that 7.2 will provide a line number in the plpgsql function in this sort of situation, which should help some. regards, tom lane