Re: Can the string literal syntax for function definitions please be dropped ? - Mailing list pgsql-general

From David W Noon
Subject Re: Can the string literal syntax for function definitions please be dropped ?
Date
Msg-id 20091026004339.687b567f@dwnoon.ntlworld.com
Whole thread Raw
In response to Re: Can the string literal syntax for function definitions please be dropped ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Sun, 25 Oct 2009 20:17:22 -0400, Tom Lane wrote about Re: [GENERAL]
Can the string literal syntax for function definitions please be
dropped ?:

[snip]
>         <routine body> ::=
>                <SQL routine body>
>              | <external body reference>
>
>         <SQL routine body> ::= <SQL procedure statement>
>
>and <SQL procedure statement> seems to allow one (count em, one) SQL
>DDL or DML statement.  So per spec, essentially every interesting case
>requires an <external body reference>.

This explains the evolution of DB2's support for user-defined
functions: initially they (UDFs) had to be written in some host language
(COBOL, PL/I, C, etc.), and linked in by external reference; later, a
single SQL statement(*) was permitted instead; finally, a compound SQL
statement was permitted, with BEGIN and END bracketing an arbitrary
collection of other SQL statements.

(*) Since all UDFs must return a value, the single statement was
almost invariably a RETURN with some query providing the value.
--
Regards,

Dave  [RLU #314465]
=======================================================================
david.w.noon@ntlworld.com (David W Noon)
=======================================================================

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Can the string literal syntax for function definitions please be dropped ?
Next
From: ginanjar
Date:
Subject: indexing