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 8503.1281794944@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>)
List pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> attached updated \sf implementation. It is little bit simplyfied with
> support a pager and output forwarding. Formating was updated per Tom's
> request.

Applied with corrections --- mostly, fixing it to not trash the query
buffer, which would certainly not be expected behavior for such a
command.

Also, as previously mentioned, I took out the line number argument,
which seemed to me to have little if any use-case while substantially
complicating the code.  (It's not so much that it cost a lot in the
patch as submitted, it's that it *would* cost a lot if you were
honoring it in the pager calculation...)

One other thing: I took a look at the pg_get_functiondef() code and
realized that in fact it does NOT guarantee that the function body
will start with "AS $function...".  In languages with a nonnull
probin field, that's not what the line will look like.  I think though
that looking for just "AS " at the start of the line is sufficient
for our purposes here.  I will go change the \ef and \sf code for
that.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Recognize functional dependency on primary keys.
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #5608: array_agg() consumes too much memory