pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedChanging PL/pgSQL triggers
5+ messages / 5 participants
[nested] [flat]
* Changing PL/pgSQL triggers
@ 2001-06-21 17:30 James Orr <james@lrgmail.com>
0 siblings, 3 replies; 5+ messages in thread
From: James Orr @ 2001-06-21 17:30 UTC (permalink / raw)
To: pgsql-sql
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?
-James
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Changing PL/pgSQL triggers
@ 2001-06-21 17:50 Roberto Mello <rmello@cc.usu.edu>
parent: James Orr <james@lrgmail.com>
2 siblings, 0 replies; 5+ messages in thread
From: Roberto Mello @ 2001-06-21 17:50 UTC (permalink / raw)
To: James Orr <james@lrgmail.com>; +Cc: pgsql-sql
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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Changing PL/pgSQL triggers
@ 2001-06-21 18:10 Alain Lavigne <alavigne@zaq.com>
parent: James Orr <james@lrgmail.com>
2 siblings, 0 replies; 5+ messages in thread
From: Alain Lavigne @ 2001-06-21 18:10 UTC (permalink / raw)
To: pgsql-sql
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"" <james@lrgmail.com> 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
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=3DContent-Type content=3D"text/html;
charset=3Diso-8859-1">
> <META content=3D"MSHTML 5.50.4616.200" name=3DGENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY bgColor=3D#ffffff>
> <DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
> <DIV><FONT face=3DArial size=3D2>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?</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
> <DIV><FONT face=3DArial size=3D2>-James</FONT></DIV></BODY></HTML>
>
> ------=_NextPart_000_004A_01C0FA56.5C956540--
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Changing PL/pgSQL triggers
@ 2001-06-21 19:31 Josh Berkus <josh@agliodbs.com>
parent: James Orr <james@lrgmail.com>
2 siblings, 1 reply; 5+ messages in thread
From: Josh Berkus @ 2001-06-21 19:31 UTC (permalink / raw)
To: James Orr <james@lrgmail.com>; pgsql-sql
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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Changing PL/pgSQL triggers
@ 2001-06-22 07:22 Kristoff Bonne <kristoff.bonne@skypro.be>
parent: Josh Berkus <josh@agliodbs.com>
0 siblings, 0 replies; 5+ messages in thread
From: Kristoff Bonne @ 2001-06-22 07:22 UTC (permalink / raw)
To: pgsql-sql
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
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2001-06-22 07:22 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-06-21 17:30 Changing PL/pgSQL triggers James Orr <james@lrgmail.com>
2001-06-21 17:50 ` Roberto Mello <rmello@cc.usu.edu>
2001-06-21 18:10 ` Alain Lavigne <alavigne@zaq.com>
2001-06-21 19:31 ` Josh Berkus <josh@agliodbs.com>
2001-06-22 07:22 ` Kristoff Bonne <kristoff.bonne@skypro.be>
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