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