Re: review: psql: edit function, show function commands patch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: review: psql: edit function, show function commands patch
Date
Msg-id 5284.1280674077@sss.pgh.pa.us
Whole thread Raw
In response to Re: review: psql: edit function, show function commands patch  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: review: psql: edit function, show function commands patch
List pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> so my plan

> a) fix problem with ambiguous $function* like you proposed
> b) fix problem with "first row excepting" - I can activate a detection
> only for plpgsql language - I can identify LANGUAGE before.

Ick.  We should absolutely NOT have a client-side special case for plpgsql.

Personally I'd be fine with dropping the special case from the plpgsql
parser --- I don't believe that that behavior was ever discussed, much
less documented, and I doubt that many people rely on it or even know
it exists.  The need to count lines manually in function definitions is
far less than it was back when that kluge was put in.

If anyone can make a convincing case that it's a good idea to ignore
leading newlines, we should reimplement the behavior in such a way that
it applies across the board to all PLs (ie, make CREATE FUNCTION strip
a leading newline before storing the text).  However, then you'd have
issues about whether or when to put back the newline, so I'm not really
in favor of that route.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: review: psql: edit function, show function commands patch
Next
From: Robert Haas
Date:
Subject: Re: review patch: Distinguish between unique indexes and unique constraints