Re: how to edit a function from psql?

From: Russ Brown <pickscrape(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: how to edit a function from psql?
Date: 2004-11-05 10:22:43
Message-ID: 4b0dadc60411050222b73871d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

What would be really useful would be a command that would return the
actual SQL needed to create a function. At present the output from
\df+ needs to be pieced together to create a new CREATE OR REPLACE
string. A command that returnes that string for you would allow you to
copy and paste it in, do a minor edit and run the command very
quickly.

I've had to tweak functions quite a lot lately and having to construct
the command from the output from \df+ can be a bit of a pain.

In fact, it would be useful to have this for all entity types in the
system: tables, views and types etc. Perhaps a new symbol to follow
the \d command, such as * (just a random guess).

So:

\df* functionname

would output the CREATE OR REPLACE line for that funtion.

Thoughts?

On Thu, 4 Nov 2004 19:44:53 -0300, Alvaro Herrera
<alvherre(at)dcc(dot)uchile(dot)cl> wrote:
> On Thu, Nov 04, 2004 at 04:00:10PM -0600, Thomas F. O'Connell wrote:
>
> Thomas,
>
> > How do you get the results of \df+ into the buffer with \e? Just copy
> > and paste?
>
> Right. Single quotes tended to be an issue. Not so with 8.0. It's
> much better, of course, to have the original definition on a text file
> somewhere ...
>
> --
> Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
> Este mail se entrega garantizadamente 100% libre de sarcasmo.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

--

Russ

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gregory S. Williamson 2004-11-05 10:26:38 Re: Conactenating text with null values
Previous Message Joel 2004-11-05 10:20:57 Re: OS X Install