pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jasen Betts <jasen@xnet.co.nz>
To: pgsql-sql@postgresql.org
Subject: Re: the use of $$string$$
Date: 8 Nov 2011 09:46:11 GMT
Message-ID: <j9atp3$7ro$3@reversiblemaps.ath.cx> (raw)
References: <201111040738.29303.johnf@jfcomputer.com>
	<201111040826.16177.johnf@jfcomputer.com>
	<4EB429AD.3030607@archonet.com>
	<201111041712.09607.johnf@jfcomputer.com>
	<4EB79A86.1090005@archonet.com>

On 2011-11-07, Richard Huxton <dev@archonet.com> wrote:
> On 05/11/11 00:12, John Fabiani wrote:

> OK, so it seems psycopg is quoting your strings for you (as you'd 
> expect). It's presumably turning your query into:
>      ... values (E'123', $$E'<long string>'$$)
> So - the $$ quoting is unnecessary here - just use the % placeholders.
>
> Incidentally, should it be %s for the numeric argument?

psycopg2 seems to only accept %s as a place-holder, it's not printf it
just looks a bit like it.

-- 
⚂⚃ 100% natural




view thread (11+ messages)

Message-ID: <j9atp3$7ro$3@reversiblemaps.ath.cx>
Permalink:  ../j9atp3$7ro$3@reversiblemaps.ath.cx/
Also on:    postgresql.org/message-id/j9atp3$7ro$3@reversiblemaps.ath.cx

 · 

reply

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: jasen@xnet.co.nz
  Subject: Re: the use of $$string$$
  In-Reply-To: <j9atp3$7ro$3@reversiblemaps.ath.cx>

* 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