From: stuart <sgall@iprimus.com.au>
To: PG-SQL <pgsql-sql@postgresql.org>
Subject: Fw: Viewing a function
Date: Tue, 29 Aug 2000 20:20:56 +1000
Message-ID: <005001c011a2$f6e5bfc0$1400a8c0@sgall> (raw)
-----Original Message-----
From: Stuart Foster <stuartafoster@home.com>
To: PG-SQL <pgsql-sql@postgresql.org>
Date: Wednesday, 30 August 2000 2:25
Subject: [SQL] Viewing a function
Helllo Stuart,
Good question.
I have been fiddly with a function editor using zeos controls and I have
lots of little problems, so that I have given up for a while.
I successfully parsed function information. (The following is from memory
and I dont have postgres with me right now).
The body of the function is in pg_lang.prosrc (I think) or something like
that
(I found out most stuff by looking in the c code for psql. I work in
delphi)
You can work out param numbers from another field and work out the field
types
(I confess Icheated here. You can get field type out of system tables but I
never actually worked out how).
I could reconstruct a nice looking create function string using data in the
data base.
When I tried it execute things from windows things went wrong but it work in
psql.
I ended up just using it as a utility to create separated create function
files wich I then loaded server side.
Anyway... then problems.
I dont think I ever had a successful update from client side.
Once I committed a change I often could not successfully drop and create a
function and vacuum would fail.
To recover I had to drop all functions and re-create them.
Using PERFORM seemed to cause particular problems. (Think that anything
that is called by perform must be compiled in before anything that calls it.
Order of creation seems to important. A full dump and create would fix
these sort of problems)
The cr/lf thing also gave problems although I wrote what I thought was a
client side fix for this.
You can have my source in Delphi (such as it is) if you are interested.
I think there must be flags or dependencies with function managemnt which I
dont understand.
PS I have not had success editing function in pgaccess either (similar
problems)
A simple way to view functions is pg_dump -c -s database to just dump schema
and drop statements. Cut and paste function definitions.
The difficulty of function editing has retarded my putting tasks server-side
which belong there.
>How can a view a function after it's created ?
>I've created a SQL function that I need to review and possibly change. What
>is the best way to go about this.
>
>
>TIA
>
Another stuart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: sgall@iprimus.com.au
Subject: Re: Fw: Viewing a function
In-Reply-To: <005001c011a2$f6e5bfc0$1400a8c0@sgall>
References: <005001c011a2$f6e5bfc0$1400a8c0@sgall>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox