pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ryan Williams <shrewsbury@louisiana.com>
To: PG-SQL <pgsql-sql@postgresql.org>
Subject: Re: Viewing a function
Date: Wed, 30 Aug 2000 10:46:22 -0700
Message-ID: <00e501c012aa$377c09b0$c330cc40@crusher> (raw)
References: <005001c011a2$f6e5bfc0$1400a8c0@sgall>

Try "SELECT prosrc FROM pg_proc WHERE proname = 'funcname'", where funcname
is the name of the function you want to see.

----- Original Message -----
From: "stuart" <sgall@iprimus.com.au>
To: "PG-SQL" <pgsql-sql@postgresql.org>
Sent: Tuesday, August 29, 2000 3:20 AM
Subject: Fw: [SQL] Viewing a function


>
> -----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
>




view thread (3+ messages)

Message-ID: <00e501c012aa$377c09b0$c330cc40@crusher>
Permalink:  ../00e501c012aa$377c09b0$c330cc40@crusher/
Also on:    postgresql.org/message-id/00e501c012aa$377c09b0$c330cc40@crusher

 · 

reply

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: shrewsbury@louisiana.com
  Subject: Re: Viewing a function
  In-Reply-To: <00e501c012aa$377c09b0$c330cc40@crusher>
  References: <005001c011a2$f6e5bfc0$1400a8c0@sgall> <00e501c012aa$377c09b0$c330cc40@crusher>

* 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