Re: \ef should probably append semicolons

From: David Fetter <david(at)fetter(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Joshua Tolley <eggyknap(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: \ef should probably append semicolons
Date: 2008-10-11 14:14:28
Message-ID: 20081011141428.GA10536@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 10, 2008 at 09:10:50PM -0400, Tom Lane wrote:
> "Joshua Tolley" <eggyknap(at)gmail(dot)com> writes:
> > The new \ef psql command creates nicely usable "CREATE OR REPLACE
> > FUNCTION ..." text based on the function I tell it to edit, but the
> > text it creates *doesn't* include a final semicolon, so when I exit my
> > editor-of-choice after messing with my function, it doesn't run the
> > code I've given it until I type one of my own. This is annoying.
>
> This is intentional.
>
> If the semicolon is there, the command will be squirted to the backend
> instantaneously upon your exiting the $EDITOR. The potential bad
> consequences of that seem to me to outweigh the annoyance factor of
> typing ; and return.

To mitigate this annoyance, we could have \ef prepend a
multi-line-style comment (proof against editor wrapping) that reads
something like:

/*
To make these changes take effect immediately, put a semicolon after
the $FUNCTION$ tag
*/

Speaking of the $FUNCTION$ tag, it appears to be being put in there
unconditionally, which will eventually break somebody's code. How
does pg_dump handle the dollar quoting situation, and could this
machinery be used here?

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2008-10-11 15:03:36 Re: The Axe list
Previous Message Magnus Hagander 2008-10-11 14:07:31 Re: The Axe list