Re: help with TCL function - Mailing list pgsql-general

From Rolf Jentsch
Subject Re: help with TCL function
Date
Msg-id 200309110933.42388.rje@epmail.ep.de
Whole thread Raw
In response to Re: help with TCL function  ("Jules Alberts" <jules.alberts@arbodienst-limburg.nl>)
List pgsql-general
Am Donnerstag, 11. September 2003 08:59 schrieben Sie:
> Op 11 Sep 2003 (0:45), schreef ljb <lbayuk@mindspring.com>:
...
> -- This is the function
>
> create or replace function tlow() returns trigger as '
>   set NEW($1) [string tolower $NEW($1)]
>   return [array get NEW]'
> language 'pltcl';
>
...

You could either test with info exists or catch the error
create or replace function tlow() returns trigger as '
  if [info exists NEW($1)] {
    set NEW($1) [string tolower $NEW($1)]
  }
  return [array get NEW]'
language 'pltcl';

create or replace function tlow() returns trigger as '
  catch {
    set NEW($1) [string tolower $NEW($1)]
  }
  return [array get NEW]'
language 'pltcl';

--
Rolf Jentsch
Produktentwicklung EDV-Anwendungen für Mitglieder
ElectronicPartner GmbH & Co. KG
Düsseldorf


pgsql-general by date:

Previous
From: Stéphane Cazeaux
Date:
Subject: Re: Question about conccurrency control and Insert
Next
From: "Marek Lewczuk"
Date:
Subject: MD5 function is not available ?