From: Tom Lane <tgl@sss.pgh.pa.us>
To: bhv@quebecemail.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Unwanted nested dollar-quoted constants
Date: Sat, 27 Aug 2005 10:56:47 -0400
Message-ID: <1353.1125154607@sss.pgh.pa.us> (raw)
In-Reply-To: <20050820122715.D2B562D6@dm22.mta.everyone.net>
References: <20050820122715.D2B562D6@dm22.mta.everyone.net>
Bernard Henry Voynet <bhv@quebecemail.com> writes:
> All the text fields are specified using the dollar-quoted string constant form that.
This is your mistake to start with. You can not simply stick a couple
of dollar signs around a random string and expect to have a valid
literal, any more than you can stick a couple of quote marks around it
and expect to have a valid literal. Dollar-quoting is not a magic
bullet that will let you forget about escaping data.
I would recommend going back to regular quoted literals and making sure
you double any quotes or backslashes in the data. It's possible to
develop appropriate code for dollar-quoting random text, but it's a lot
harder than it is to escape the data in the old style.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, bhv@quebecemail.com
Subject: Re: Unwanted nested dollar-quoted constants
In-Reply-To: <1353.1125154607@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox