From: Josh Berkus <josh@agliodbs.com>
To: James Orr <james@lrgmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: Changing PL/pgSQL triggers
Date: Thu, 21 Jun 2001 12:31:44 -0700
Message-ID: <web-75462@davinci.ethosmedia.com> (raw)
In-Reply-To: <004d01c0fa77$f64f0580$1600000a@lrg.office>
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
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: josh@agliodbs.com, james@lrgmail.com
Subject: Re: Changing PL/pgSQL triggers
In-Reply-To: <web-75462@davinci.ethosmedia.com>
* 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