pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jack Douglas <jack@douglastechnology.co.uk>
To: pgsql-jdbc@postgresql.org
Subject: Re: create function with dollar quoted body
Date: Sat, 10 Mar 2012 19:13:18 +0000
Message-ID: <4F5BA7CE.7030907@douglastechnology.co.uk> (raw)
In-Reply-To: <CAF-4BpOSv85A+JF+AvzgT88gEe=_jd3tUezoyJbWvbJ2RpNjFQ@mail.gmail.com>
References: <4F5A62BB.9000206@douglastechnology.co.uk>
	<CAF-4BpOSv85A+JF+AvzgT88gEe=_jd3tUezoyJbWvbJ2RpNjFQ@mail.gmail.com>

Hi
> Please give a code example reproducing the problem you see.
This works fine:

create or replace function f() returns text language plpgsql as 'begin
return ''A''; end;';

But this fails with "unterminated dollar-quoted string":

create or replace function f() returns text language plpgsql as $$begin
return 'A'; end;$$;

It is not a general problem with dollar-quoting because this works:

create or replace function f() returns text language plpgsql as 'begin
return $$A$$; end;';

Thanks
Jack



view thread (5+ messages)  latest in thread

Message-ID: <4F5BA7CE.7030907@douglastechnology.co.uk>
Permalink:  ../4F5BA7CE.7030907@douglastechnology.co.uk/
Also on:    postgresql.org/message-id/4F5BA7CE.7030907@douglastechnology.co.uk

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: jack@douglastechnology.co.uk
  Subject: Re: create function with dollar quoted body
  In-Reply-To: <4F5BA7CE.7030907@douglastechnology.co.uk>
  References: <4F5A62BB.9000206@douglastechnology.co.uk> <CAF-4BpOSv85A+JF+AvzgT88gEe=_jd3tUezoyJbWvbJ2RpNjFQ@mail.gmail.com> <4F5BA7CE.7030907@douglastechnology.co.uk>

* 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