Where are PL/pgsql definitions kept?

Started by Jerry LeVanabout 22 years ago4 messagesgeneral
Jump to latest
#1Jerry LeVan
jerry.levan@eku.edu

Hi,
I just upgraded to 7.4.2 today...I have started looking at PL/PGsql
functions
and noticed that the pg_dumpall and pg_dump commands are able to
recover the
text for the function definitions.

I have examined ( I think ) every table in my catalog and have not been
able
to find the text definition of my PL/PGsql function.

Is it possible to recover the text of a function definition from within
postgresql?

Thanks,

Jerry

#2Richard Huxton
dev@archonet.com
In reply to: Jerry LeVan (#1)
Re: Where are PL/pgsql definitions kept?

On Friday 12 March 2004 20:12, Jerry LeVan wrote:

Is it possible to recover the text of a function definition from within
postgresql?

In psql: \df+ my_func_name

To see how that works, start psql with -E

--
Richard Huxton
Archonet Ltd

#3Jerry LeVan
jerry.levan@eku.edu
In reply to: Richard Huxton (#2)
Re: Where are PL/pgsql definitions kept?

Ahh, thank you, the definition is actually stored in pg_proc in the
prosrc column.

I have been examining the system tables using my home brewed BiggerSQL
Postgresql Database Browser ( http://homepage.mac.com/levanj/Cocoa ) a
MacOS X utility.

BiggerSQL displays tables in a table format, one row per record.

When I displayed the pg_proc table it *appeared* that that column
contained
an empty string. Evidently the stored string starts with a new line
character.

Using the "arrow" keys to advance into the field got me to the next
line in
the definition and I was able to then see the rest of the definition ;(.

Thank you :)

Jerry

On Mar 12, 2004, at 3:47 PM, Richard Huxton wrote:

Show quoted text

On Friday 12 March 2004 20:12, Jerry LeVan wrote:

Is it possible to recover the text of a function definition from
within
postgresql?

In psql: \df+ my_func_name

To see how that works, start psql with -E

--
Richard Huxton
Archonet Ltd

#4Richard Huxton
dev@archonet.com
In reply to: Jerry LeVan (#3)
Re: Where are PL/pgsql definitions kept?

On Friday 12 March 2004 21:12, Jerry LeVan wrote:

When I displayed the pg_proc table it *appeared* that that column
contained
an empty string. Evidently the stored string starts with a new line
character.

That's probably because you usually define your functions
CREATE FUNCTION foo ... AS '
blah

So the first character would be a newline.

--
Richard Huxton
Archonet Ltd