pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
checking pgsql functions
3+ messages / 3 participants
[nested] [flat]

* checking pgsql functions
@ 2005-04-21 02:35 Enrico Weigelt <weigelt@metux.de>
  2005-04-21 03:25 ` Re: checking pgsql functions Tom Lane <tgl@sss.pgh.pa.us>
  2005-04-21 03:39 ` Re: checking pgsql functions Michael Fuhr <mike@fuhr.org>
  0 siblings, 2 replies; 3+ messages in thread

From: Enrico Weigelt @ 2005-04-21 02:35 UTC (permalink / raw)
  To: pgsql-sql


Hi folks,

Is it possible to check plpgsql functions before they're actually
into the database, as it's done w/ sql functions ?

Often I've got the problem that a function still contains some
syntax errors (well, nobody's perfect), but my application is 
quite critical (a single crashing trigger may cost a lot of money).
So I'd like to checkin only syntactically correct (also with 
correct references).

Is it possible somehow ?


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact@metux.de
  cellphone: +49 174 7066481
---------------------------------------------------------------------
 -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
---------------------------------------------------------------------



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: checking pgsql functions
  2005-04-21 02:35 checking pgsql functions Enrico Weigelt <weigelt@metux.de>
@ 2005-04-21 03:25 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2005-04-21 03:25 UTC (permalink / raw)
  To: weigelt@metux.de; +Cc: pgsql-sql

Enrico Weigelt <weigelt@metux.de> writes:
> Is it possible to check plpgsql functions before they're actually
> into the database, as it's done w/ sql functions ?

8.0 does a little bit of this, and 8.1 will do more...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: checking pgsql functions
  2005-04-21 02:35 checking pgsql functions Enrico Weigelt <weigelt@metux.de>
@ 2005-04-21 03:39 ` Michael Fuhr <mike@fuhr.org>
  1 sibling, 0 replies; 3+ messages in thread

From: Michael Fuhr @ 2005-04-21 03:39 UTC (permalink / raw)
  To: Enrico Weigelt <weigelt@metux.de>; +Cc: pgsql-sql

On Thu, Apr 21, 2005 at 04:35:37AM +0200, Enrico Weigelt wrote:
> 
> Is it possible to check plpgsql functions before they're actually
> into the database, as it's done w/ sql functions ?

What version of PostgreSQL are you using?  8.0 and later have a
validator function for PL/pgSQL, although its syntax checks are
minimal and errors can still get through.  I'm sure a patch that
improves it would be welcome :-)

> Often I've got the problem that a function still contains some
> syntax errors (well, nobody's perfect), but my application is 
> quite critical (a single crashing trigger may cost a lot of money).
> So I'd like to checkin only syntactically correct (also with 
> correct references).

Since the application is critical, hopefully you're running regression
tests in a non-production environment before modifying the production
system.  Is that not the case?  Regardless of how much syntax checking
the DBMS does, it would still be prudent to test as many code paths as
possible for semantic correctness.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-04-21 03:39 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-04-21 02:35 checking pgsql functions Enrico Weigelt <weigelt@metux.de>
2005-04-21 03:25 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-04-21 03:39 ` Michael Fuhr <mike@fuhr.org>

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