Re: create function with dollar quoted body

From: Jack Douglas <jack(at)douglastechnology(dot)co(dot)uk>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: create function with dollar quoted body
Date: 2012-03-10 19:13:18
Message-ID: 4F5BA7CE.7030907@douglastechnology.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thomas Kellerer 2012-03-10 21:09:57 Re: create function with dollar quoted body
Previous Message Florent Guillaume 2012-03-10 19:06:46 Re: create function with dollar quoted body