Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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: dolq-plpgsql.patch
Description: text/plain (2.4 KB)

In response to

Responses

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group