Re: \ef should probably append semicolons

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

"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.

Now, if you want to fix psql so that even with a semicolon there it
will redisplay the command buffer and wait for a return, then I'd agree
that that's an improvement. I couldn't figure out how to get readline
to cooperate with that ... but I didn't spend a lot of time looking.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-10-11 01:26:31 Re: The Axe list
Previous Message Nikolas Everett 2008-10-11 00:41:07 Re: How is random_page_cost=4 ok?