Re: Why I cannot call a function from within an SQL function?

Поиск
Список
Период
Сортировка
От Eus
Тема Re: Why I cannot call a function from within an SQL function?
Дата
Msg-id 653332.30087.qm@web37601.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на Re: Why I cannot call a function from within an SQL function?  (Marc Schablewski <ms@clickware.de>)
Список pgsql-general
Hi Ho!

--- On Fri, 2/20/09, Marc Schablewski <ms@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
mostconvenient to use dollar quoting (see Section 4.1.2.2) for the string constant. If you choose to use regular
single-quotedstring 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
computingdevices. 

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

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




В списке pgsql-general по дате отправления:

Предыдущее
От: Eus
Дата:
Сообщение: Re: Why I cannot call a function from within an SQL function?
Следующее
От: "Francisco Figueiredo Jr."
Дата:
Сообщение: Re: Question about functions that return a set of records