Re: [HACKERS] Quoting in stored procedures - Mailing list pgsql-hackers

From pgsql-hackers@mail.remote.org
Subject Re: [HACKERS] Quoting in stored procedures
Date
Msg-id 19990830225430.A10255@remote.org
Whole thread Raw
List pgsql-hackers
> and why not something like:
>
> CREATE FUNCTION first_word ( :x CHAR VARYING(1000) )
>    RETURNS CHAR VARYING(40)
>    LANGUAGE SQL
>    RETURN TRIM (SUBSTRING ((:X || ' ') FROM 1 FOR POSITION (' ' IN (:X || '')
> )));
>
> as described in SQL/PSM (SQL Persistent Stored Modules) (see "A Guide To The
> SQL Standard" apendix E)
> instead of re-invent the wheel. ;)

Because the SQL parser has to parse the stored procedure to find the end. In
postgres you can have embedded tcl and any arbitrary language, so it is quite
difficult to handle that properly.

jochen


pgsql-hackers by date:

Previous
From: "Hub.Org News Admin"
Date:
Subject: ...
Next
From: "Oliver Elphick"
Date:
Subject: Implications of multi-byte support in a distribution