Re: Changing PL/pgSQL triggers

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Changing PL/pgSQL triggers
Дата
Msg-id web-75462@davinci.ethosmedia.com
обсуждение исходный текст
Ответ на Changing PL/pgSQL triggers  ("James Orr" <james@lrgmail.com>)
Ответы Re: Changing PL/pgSQL triggers  (Kristoff Bonne <kristoff.bonne@skypro.be>)
Список 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
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Marc Sherman"
Дата:
Сообщение: RE: Select most recent record?
Следующее
От: Martín Marqués
Дата:
Сообщение: case, new column not found