Re: [PATCH] "\ef <function>" in psql

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Abhijit Menon-Sen <ams(at)oryx(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, gavin(at)alcove(dot)com(dot)au
Subject: Re: [PATCH] "\ef <function>" in psql
Date: 2008-09-07 00:19:38
Message-ID: 200809070019.m870Jct20500@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera wrote:
> Abhijit Menon-Sen wrote:
> > At 2008-09-06 14:58:25 -0400, tgl(at)sss(dot)pgh(dot)pa(dot)us wrote:
>
> > > What about the general issue that neither \e nor \ef leave you with a
> > > presentation of what's in the query buffer?
> >
> > I don't know how that can be fixed; but I agree with Brendan that it's
> > behaviour that people are used to, and that it can be left alone for
> > now.
>
> As far as it works to not execute the query when the user exits without
> saving the buffer, it should be OK.

Well, it works like \e now, which is good. The only complexity is that
\e works differently depending on whether you use ';' or \g, meaning:

SELECT 1;
\e

will execute the buffer on exit (saved or not), while

SELECT 1
\g
\e

will not execute the buffer on editor exit. Our current \ef code does
not add a trailing semicolon to the CREATE FUNCTION buffer contents so
it works like the second case, which is probably the best we are going
to do.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-09-07 00:55:48 Re: Review Report: propose to include 3 new functions into intarray and intagg
Previous Message Tom Lane 2008-09-06 23:59:55 Re: [PATCH] allow has_table_privilege(..., 'usage') on sequences