1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-19 17:02:53 +03:00

Implement a psql command "\ef" to edit the definition of a function.

In support of that, create a backend function pg_get_functiondef().
The psql command is functional but maybe a bit rough around the edges...

Abhijit Menon-Sen
This commit is contained in:
Tom Lane
2008-09-06 00:01:25 +00:00
parent 2cdcf459ba
commit 2c863ca818
7 changed files with 407 additions and 59 deletions

View File

@@ -1,5 +1,5 @@
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.209 2008/07/03 03:37:16 tgl Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.210 2008/09/06 00:01:21 tgl Exp $
PostgreSQL documentation
-->
@@ -1195,6 +1195,29 @@ testdb=&gt;
</varlistentry>
<varlistentry>
<term><literal>\ef <replaceable class="parameter">function_description</replaceable> </literal></term>
<listitem>
<para>
This command fetches and edits the definition of the named function,
in the form of a <command>CREATE OR REPLACE FUNCTION</> command.
Editing is done in the same way as for <literal>\e</>.
After the editor exits, the updated command waits in the query buffer;
type semicolon or <literal>\g</> to send it, or <literal>\r</>
to cancel.
</para>
<para>
The target function can be specified by name alone, or by name
and arguments, for example <literal>foo(integer, text)</>.
The argument types must be given if there is more
than one function of the same name.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>\echo <replaceable class="parameter">text</replaceable> [ ... ]</literal></term>
<listitem>