Re: Can the string literal syntax for function definitions please be dropped ?

From: David W Noon <dwnoon(at)ntlworld(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Can the string literal syntax for function definitions please be dropped ?
Date: 2009-10-26 00:43:39
Message-ID: 20091026004339.687b567f@dwnoon.ntlworld.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)w(dot)noon(at)ntlworld(dot)com (David W Noon)
=======================================================================

In response to

Browse pgsql-general by date

  From Date Subject
Next Message ginanjar 2009-10-26 01:45:38 indexing
Previous Message Tom Lane 2009-10-26 00:17:22 Re: Can the string literal syntax for function definitions please be dropped ?