Hi Ho!

--- On Fri, 2/20/09, Marc Schablewski <m...@clickware.de> wrote:

> You are using old-style function declaration where the
> function body is
> given as a string enclosed in '. You have to escape all
> ' inside the
> body by doubling them.

Ah, yes, after re-reading the doc, I found:

--- 8< ---
The syntax of the CREATE FUNCTION command requires the function body to be 
written as a string constant. It is usually most convenient to use dollar 
quoting (see Section 4.1.2.2) for the string constant. If you choose to use 
regular single-quoted string constant syntax, you must double single quote 
marks (') and backslashes (\) (assuming escape string syntax) in the body of 
the function (see Section 4.1.2.1). 
--- 8< ---

I really missed it. Sorry for making noise.

> As an alternative, you can use $$ as
> the begin
> and end markers of your function body instead of the '
> then you don't
> need to escape.

Yes, this is much better.

Thank you very much for your explanation.

Best regards,
Eus (FSF member #4445)

In this digital era, where computing technology is pervasive, your freedom 
depends on the software controlling those computing devices.

Join free software movement today! It is free as in freedom, not as in free 
beer!

Join: http://www.fsf.org/jf?referrer=4445


      

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to