From a GUI tool, get the function
definition using pgAdmin III or Aginity Workbench for Pivotal
Greenplum, which are the two main GUI tools for working with
Greenplum.
From the command line, you can use psql, but as already said it
won't give the full CREATE FUNCTION statement:
\a
\o <function name>.sql
\df+ <schema name>.<function name>
\o
To get the full CREATE FUNCTION statement from the command line
you can use pg_dump and pg_restore:
- create a dump file containing all the objects of the schema
containing your function(s):
pg_dump -h <host name> -U <user name> -n <schema
name> -Fc -s <database name> > dump.dmp
- search the function definition including its argument list
within the dump file:
pg_restore -l dump.dmp | grep <function name>
- extract the function definition from the dump file:
pg_restore -P '<function name>(arguments list)' dump.dmp
> <function name>.sql
Regards,
Danilo
Da: Phil Hibbs (
sna...@gmail.com)
Inviato: Lunedì 1 Febbraio 2016 17:36
A: Greenplum Users (
gpdb-...@greenplum.org)
Oggetto: [gpdb-users] Alternative to pg_get_functioncode?