Skip site navigation (1) Skip section navigation (2)

Re: review: psql: edit function, show function commands patch

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Jan Urbański <wulczer(at)wulczer(dot)org>, Postgres - Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: review: psql: edit function, show function commands patch
Date: 2010-08-01 02:10:38
Message-ID: AANLkTim24yx_ss1zBM7z3s2Z_WwNg458+LORNHLnihPx@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Sun, Jul 25, 2010 at 11:42 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>> I'm setting this as ready for committer.
>
> Thank you very much

I took a look at this tonight and am a bit mystified by the following bit:

+                       /*
+                        * PL doesn't calculate first row of function's body
+                        * when first row is empty. So checks first row, and
+                        * correct lineno when it is necessary.
+                        */

Is that true of any PL, or just some particular PL?  Is the behavior
described here a bug that we should fix, or is it, for some reason,
considered correct?  Is it documented in our documentation?

The implementation of first_row_is_empty() looks pretty kludgey, too.
It seems to me that it will fail completely if the text of the
function definition happens to contain $function$.

CREATE OR REPLACE FUNCTION boom() RETURNS text LANGUAGE plpgsql AS $$
BEGIN SELECT '$function$'; END $$;

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-08-01 02:31:47
Subject: Re: rbtree code breaks GIN's adherence to maintenance_work_mem
Previous:From: Robert HaasDate: 2010-08-01 01:48:05
Subject: Re: ANALYZE versus expression indexes with nondefault opckeytype

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group