Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-jdbc by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group