dollar quoting for plpgsql

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: dollar quoting for plpgsql
Date: 2004-02-25 16:37:59
Message-ID: 403CCF67.5080107@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:

>
>
>I think plpgsql's lexer also needs to be taught about dollar-quoting.
>
>
>
>

The attached patch appears to do the trick:

floobl=# create or replace function testme() returns text language
plpgsql as $$
floobl$# begin return $foo$a'\b$bar$foo$; end;
floobl$# $$;
CREATE FUNCTION
floobl=# select testme();
testme
----------
a'\b$bar
(1 row)

floobl=#

cheers

andrew

Attachment Content-Type Size
dolq-plpgsql.patch text/plain 2.4 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-02-25 18:11:57 Re: dollar quoting for plpgsql
Previous Message L J Bayuk 2004-02-25 00:43:15 1-line fix to port/thread.c for compiling libpq with Borland C