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

Quoting in stored procedures

From: pgsql-hackers(at)mail(dot)remote(dot)org
To: pgsql-hackers(at)postgresql(dot)org
Subject: Quoting in stored procedures
Date: 1999-08-28 21:27:46
Message-ID: 199908282127.RAA16020@hub.org (view raw or flat)
Thread:
Lists: pgsql-hackers
The syntax needed for defining functions is quite annoying because of the
needed quoting. Example:

CREATE FUNCTION bla (int4) RETURNS char AS '
        BEGIN
                RETURN ''Two quotes needed''
        END;
' LANGUAGE 'plpgsql';
        
How about allowing something like in shell here-documents:
        
CREATE FUNCTION bla (int4) RETURNS char LANGUAGE 'plpgsql' UNTIL '__EOF__';
        BEGIN
                RETURN 'Only one quote needed'
        END;
__EOF__

Or similar. The __EOF__ is of course totally arbitrary and every string can
be used, so this will work with any language used.

jochen

pgsql-hackers by date

Next:From: Michael RichardsDate: 1999-08-29 00:40:29
Subject: entries in pg_shadow
Previous:From: Jochen TopfDate: 1999-08-28 21:19:30
Subject: Quoting in stored procedures

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