Search Postgresql Archives

Re: pl/pgSQL variable substitution

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeremy Palmer <JPalmer@xxxxxxxxxxxx> writes:
> When I have a query that uses DESC reserved word within the function the following variable substitution occurs:

> ERROR:  syntax error at or near "$1"
> LINE 1:  SELECT foo.bar, foo."desc"   FROM foo."desc" ORDER BY  foo."desc"   $1 
>                                                                              ^

The other two responses seem to have missed the point, which is that
plpgsql is substituting for something that couldn't possibly be a
variable name.  That is fixed as of 9.0.  I'm not sure whether it
solves your issue completely, though.  In general, using identifiers
that look like reserved words is painful --- and don't forget that
in plpgsql, you have *two* sets of reserved words to worry about,
the core SQL language's plus plpgsql's own.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux