Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g1IIbRE79589 for ; Mon, 18 Feb 2002 13:37:27 -0500 (EST) (envelope-from sszabo@megazone23.bigpanda.com) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 052B7D5E5; Mon, 18 Feb 2002 10:37:22 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id EECC05BF9; Mon, 18 Feb 2002 10:37:22 -0800 (PST) Date: Mon, 18 Feb 2002 10:37:22 -0800 (PST) From: Stephan Szabo To: Marco Tulio Cc: Subject: Re: User Defined Function In-Reply-To: Message-ID: <20020218103304.D75404-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by postgresql.org id g1IIhfU81991 X-Archive-Number: 200202/221 X-Sequence-Number: 3377 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.