Received: from la03.lahost.net ([216.77.80.5]) by hub.org (8.10.1/8.10.1) with ESMTP id e7UFlmC90409 for ; Wed, 30 Aug 2000 11:47:48 -0400 (EDT) Received: from crusher (64-204-48-195.client.dsl.net [64.204.48.195]) by la03.lahost.net (Rockliffe SMTPRA 4.2.4) with ESMTP id for ; Wed, 30 Aug 2000 10:46:02 -0500 Message-ID: <00e501c012aa$377c09b0$c330cc40@crusher> From: "Ryan Williams" To: "PG-SQL" References: <005001c011a2$f6e5bfc0$1400a8c0@sgall> Subject: Re: Viewing a function Date: Wed, 30 Aug 2000 10:46:22 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200008/340 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" To: "PG-SQL" Sent: Tuesday, August 29, 2000 3:20 AM Subject: Fw: [SQL] Viewing a function > > -----Original Message----- > From: Stuart Foster > To: PG-SQL > 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 >