From james@lrgmail.com Thu Jun 21 17:26:16 2001 Received: from megamail.dsl.net (megamail.dsl.net [209.87.64.97]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5LHQGa79797 for ; Thu, 21 Jun 2001 13:26:16 -0400 (EDT) (envelope-from james@lrgmail.com) Received: from jameslt (64-51-205-180.client.dsl.net [64.51.205.180]) by megamail.dsl.net (8.9.3/8.9.3) with SMTP id NAA04395 for ; Thu, 21 Jun 2001 13:26:14 -0400 Message-ID: <004d01c0fa77$f64f0580$1600000a@lrg.office> From: "James Orr" To: Subject: Changing PL/pgSQL triggers Date: Thu, 21 Jun 2001 13:30:39 -0400 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_004A_01C0FA56.5C956540" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Archive-Number: 200106/334 X-Sequence-Number: 3621 This is a multi-part message in MIME format. ------=_NextPart_000_004A_01C0FA56.5C956540 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, What's the easiest way to modify or view a function written in PL/pgSQL? I= 've been using pg_dump to get the original function, then dropping and crea= ting the function and trigger after making a change. Is there an easier wa= y? -James ------=_NextPart_000_004A_01C0FA56.5C956540 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
What's the easiest way to modify or view a= function=20 written in PL/pgSQL?  I've been using pg_dump to get the original func= tion,=20 then dropping and creating the function and trigger after making a change.&= nbsp;=20 Is there an easier way?
 
-James
------=_NextPart_000_004A_01C0FA56.5C956540-- From rmello@cc.usu.edu Thu Jun 21 17:50:58 2001 Received: from fslc.ser.usu.edu (fslc.ser.usu.edu [129.123.28.122]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5LHowa91348 for ; Thu, 21 Jun 2001 13:50:58 -0400 (EDT) (envelope-from rmello@fslc.usu.edu) Received: (from rmello@localhost) by fslc.ser.usu.edu (8.12.0.Beta5/8.12.0.Beta5/Debian 8.12.0-1) id f5LHokga015544; Thu, 21 Jun 2001 11:50:46 -0600 Date: Thu, 21 Jun 2001 11:50:46 -0600 From: Roberto Mello To: James Orr Cc: pgsql-sql@postgresql.org Subject: Re: Changing PL/pgSQL triggers Message-ID: <20010621115046.A15530@cc.usu.edu> References: <004d01c0fa77$f64f0580$1600000a@lrg.office> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <004d01c0fa77$f64f0580$1600000a@lrg.office> User-Agent: Mutt/1.3.18i X-Archive-Number: 200106/336 X-Sequence-Number: 3623 On Thu, Jun 21, 2001 at 01:30:39PM -0400, James Orr wrote: > Hi, > > What's the easiest way to modify or view a function written in PL/pgSQL? I've been using pg_dump to get the original function, then dropping and creating the function and trigger after making a change. Is there an easier way? pgAcess should make it easier. It lets you look at the definition and lets you modify/drop/recreate it. If you're on windows, you might want to look a pgAdmin (available at greatbridge.org). -Roberto -- +----| http://fslc.usu.edu USU Free Software & GNU/Linux Club |------+ Roberto Mello - Computer Science, USU - http://www.brasileiro.net http://www.sdl.usu.edu - Space Dynamics Lab, Developer *> - | <- Tribble Archery From alavigne@zaq.com Fri Jun 22 12:38:23 2001 Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5MCcNa48825 for ; Fri, 22 Jun 2001 08:38:23 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5LIVba11399 for ; Thu, 21 Jun 2001 14:31:37 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f5LI9oU19766 for pgsql-sql@postgresql.org; Thu, 21 Jun 2001 14:09:50 -0400 (EDT) (envelope-from news) From: "Alain Lavigne" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Changing PL/pgSQL triggers Date: Thu, 21 Jun 2001 14:10:31 -0400 Organization: ZAQ.iTv Lines: 60 Message-ID: <9gtd9c$j9j$1@news.tht.net> References: <004d01c0fa77$f64f0580$1600000a@lrg.office> X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 To: pgsql-sql@postgresql.org X-Archive-Number: 200106/364 X-Sequence-Number: 3651 pgAdmin does not let you modify the pl/pgsql triggers. I use PowerDesigner 7.5 to manage Postgresql physical data models and I edit all pl/pgsql triggers and functions through that tool. It's not free but it's the only one I know that I can Design and Generate Databases ranging from DB2 and Oracle to Postgresql and MySQL. Other than that, a simple text editor would do for triggers. ""James Orr"" wrote in message news:004d01c0fa77$f64f0580$1600000a@lrg.office... > This is a multi-part message in MIME format. > > ------=_NextPart_000_004A_01C0FA56.5C956540 > Content-Type: text/plain; charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > Hi, > > What's the easiest way to modify or view a function written in PL/pgSQL? I= > 've been using pg_dump to get the original function, then dropping and crea= > ting the function and trigger after making a change. Is there an easier wa= > y? > > -James > > ------=_NextPart_000_004A_01C0FA56.5C956540 > Content-Type: text/html; charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > > > > > > > >
Hi,
>
 
>
What's the easiest way to modify or view a= > function=20 > written in PL/pgSQL?  I've been using pg_dump to get the original func= > tion,=20 > then dropping and creating the function and trigger after making a change.&= > nbsp;=20 > Is there an easier way?
>
 
>
-James
> > ------=_NextPart_000_004A_01C0FA56.5C956540-- > From josh@agliodbs.com Thu Jun 21 19:31:47 2001 Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5LJVla38266 for ; Thu, 21 Jun 2001 15:31:47 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.1) with HTTP id 75462; Thu, 21 Jun 2001 12:31:44 -0700 From: "Josh Berkus" Subject: Re: Changing PL/pgSQL triggers To: "James Orr" , X-Mailer: CommuniGate Pro Web Mailer v.3.4.1 Date: Thu, 21 Jun 2001 12:31:44 -0700 Message-ID: In-Reply-To: <004d01c0fa77$f64f0580$1600000a@lrg.office> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200106/342 X-Sequence-Number: 3629 James, > What's the easiest way to modify or view a function written in > PL/pgSQL? I've been using pg_dump to get the original function, then > dropping and creating the function and trigger after making a change. > Is there an easier way? Well, if you're on Win32 or on Linux, you can install PGAccess (link from postgresql.org). PGAccess has an OK function editor, although it doesn't support cut-and-paste on Xwindows and I've found a few bugs with large and complex functions. Me, I write lots and lots of PL/pgSQL functions. I've found the easiest way to be (I'm on SuSE 7.0/KDE2.1): 1. Create text file, and write and edit function in KEdit. 2. Save text file. 3. Load function using \i in PSQL. 4. Test function. FInd bug(s). 5. Re-edit function using Kedit. Add DROP FUNCTION command at beginning. 6. Re-load function using \i in PSQL. 7. Repeat from 4 until function is debugged. It sounds like a lot of steps, but really it goes quickly. Plus it allows you to save lots of intermediate versions of functions. -Josh ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco From kristoff.bonne@skypro.be Fri Jun 22 07:23:01 2001 Received: from frigg.belbone.net (Bilan-NAT.dna.belgacom.be [194.78.56.28]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5M7Mwa05476 for ; Fri, 22 Jun 2001 03:23:01 -0400 (EDT) (envelope-from kristoff.bonne@skypro.be) Received: from localhost (localhost.localdomain [127.0.0.1]) by frigg.belbone.net (Postfix) with ESMTP id 95C572C332 for ; Fri, 22 Jun 2001 09:22:44 +0200 (CEST) Date: Fri, 22 Jun 2001 09:22:44 +0200 (CEST) From: Kristoff Bonne X-Sender: To: Subject: Re: Changing PL/pgSQL triggers In-Reply-To: Message-ID: Organization: Belgacom Multimedia - Internet backbone MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200106/347 X-Sequence-Number: 3634 Greetings, On Thu, 21 Jun 2001, Josh Berkus wrote: >> What's the easiest way to modify or view a function written in >> PL/pgSQL? I've been using pg_dump to get the original function, then >> dropping and creating the function and trigger after making a change. >> Is there an easier way? > Well, if you're on Win32 or on Linux, you can install PGAccess (link > from postgresql.org). PGAccess has an OK function editor, although it > doesn't support cut-and-paste on Xwindows and I've found a few bugs with > large and complex functions. One if the 'features' missing in PGAccess (at least, on the version found in the 'ports-tree' of FreeBSD 4.1) is a simple 'save-without-quit' function. When you're editing a function; and you do save, the windows closes. So, you do some debugging, you find a bug; and you need to re-open the function. Usually (on my workstation), the windows pops up at the wrong place of the screen; and I usually need to do some 'resizing' to get the window in the shape I like. Cheerio! Kr. Bonne -- KB905-RIPE Belgacom IP networking (c=be,a=rtt,p=belgacomgroup,s=Bonne,g=Kristoff) Internet, IP and IP/VPN kristoff.bonne@skypro.be Faxbox : +32 2 2435122