Re: [PATCH] "\ef " in psql - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [PATCH] "\ef " in psql
Date
Msg-id 200809070019.m870Jct20500@momjian.us
Whole thread Raw
In response to Re: [PATCH] "\ef " in psql  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera wrote:
> Abhijit Menon-Sen wrote:
> > At 2008-09-06 14:58:25 -0400, tgl@sss.pgh.pa.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@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] allow has_table_privilege(..., 'usage') on sequences
Next
From: Tom Lane
Date:
Subject: Re: Review Report: propose to include 3 new functions into intarray and intagg