From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Marco Tulio <anjo.doce.marilia@bol.com.br>
Cc: pgsql-admin@postgresql.org
Subject: Re: User Defined Function
Date: Mon, 18 Feb 2002 10:37:22 -0800 (PST)
Message-ID: <20020218103304.D75404-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <GRQM0U$IW1tcLYMlwF8Eo9QP931EumNrVfQmkkVcYtV4v3vFBtxC@bol.com.br>
On Mon, 18 Feb 2002, Marco Tulio wrote:
> Hi,
>
> If I create a user defined function, and use it in a
> CHECK statment when I create a table, its works fine.
>
> But if I need recreate this function, the table can´t
> anymore accept data, because can´t locate the function.
>
> I can´t recreate the table, or I´ll lost data. (ok, I
> can make a dump, and recreate , but...) ...
Unfortunately under 7.1, you'd probably be best off doing
it that way (you could probably mess around with pg_relcheck
and pg_class to remove/change the constraint but that's
iffy). Under 7.2 you'd be able to either use
create or replace function or alter table drop/add constraint
to maintain it.
> I have another way to use my fuctions to validate datas ?
You could also use a before trigger which would then require
dropping the trigger function and trigger as well, but a check
constraint seems more reasonable.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: sszabo@megazone23.bigpanda.com, anjo.doce.marilia@bol.com.br
Subject: Re: User Defined Function
In-Reply-To: <20020218103304.D75404-100000@megazone23.bigpanda.com>
References: <GRQM0U$IW1tcLYMlwF8Eo9QP931EumNrVfQmkkVcYtV4v3vFBtxC@bol.com.br> <20020218103304.D75404-100000@megazone23.bigpanda.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