Re: Nested loops and $13 - Mailing list pgsql-sql

From Tom Lane
Subject Re: Nested loops and $13
Date
Msg-id 7393.1010590638@sss.pgh.pa.us
Whole thread Raw
In response to Nested loops and $13  (Torbjörn Andersson <tobbe@embryo.se>)
Responses Re: Nested loops and $13  (Torbjörn Andersson <tobbe@embryo.se>)
List pgsql-sql
Torbjörn Andersson <tobbe@embryo.se> 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


pgsql-sql by date:

Previous
From: Torbjörn Andersson
Date:
Subject: Nested loops and $13
Next
From: "postgresql"
Date:
Subject: problem with date and to_char