Re: Unable to prepare a statement when the object names contain more than one $ symbol

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Altaf Malik" <mmalik_altaf(at)yahoo(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Kris Jurka" <books(at)ejurka(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>, <mpaesold(at)gmx(dot)at>
Subject: Re: Unable to prepare a statement when the object names contain more than one $ symbol
Date: 2007-07-10 11:32:20
Message-ID: 87ejjgze7v.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

"Altaf Malik" <mmalik_altaf(at)yahoo(dot)com> writes:

> I think $$ should start a quote instead of $x$. Or $ character have special
> meaning but if there is one dollar does not happen anything wrong. Are $$ and
> $x$ equal? If yes, what happens with the character(s) between the two dollar
> signs?

$anything$ starts a quote and ends with $anything$ as in:

postgres=# select $foo$bar$foo$;
?column?
----------
bar
(1 row)

However the $ must start a new token:

postgres=# select foo$foo$bar$foo$;
ERROR: column "foo$foo$bar$foo$" does not exist
LINE 1: select foo$foo$bar$foo$;

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Michael Paesold 2007-07-10 12:47:09 Re: Unable to prepare a statement when the object names contain more than one $ symbol
Previous Message Altaf Malik 2007-07-10 10:08:10 Re: Unable to prepare a statement when the object names contain more than one $ symbol