X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id D0AECCBA2D; Sun, 13 Jul 2003 15:20:47 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 23719-05; Sun, 13 Jul 2003 15:21:09 +0000 (GMT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 6E925CB901; Sun, 13 Jul 2003 12:20:45 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h6DFL6Q3022173; Sun, 13 Jul 2003 11:21:06 -0400 (EDT) To: "Mendola Gaetano" Cc: pgsql-bugs@postgresql.org, pgsql-admin@postgresql.org Subject: Re: Function immutable is not during a reindex ? In-reply-to: <002f01c34937$ff7c48f0$10d4a8c0@mm.eutelsat.org> References: <002201c348ea$ab5f4300$10d4a8c0@mm.eutelsat.org> <19654.1058062747@sss.pgh.pa.us> <002f01c34937$ff7c48f0$10d4a8c0@mm.eutelsat.org> Comments: In-reply-to "Mendola Gaetano" message dated "Sun, 13 Jul 2003 14:12:15 +0200" Date: Sun, 13 Jul 2003 11:21:06 -0400 Message-ID: <22172.1058109666@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/125 X-Sequence-Number: 9465 "Mendola Gaetano" writes: > On: Sunday, July 13, 2003 4:19 AM "Tom Lane" wrote: >> So? Sounds to me like it's working as intended. > Well the documentation says: > IMMUTABLE [...] If this option is given, > any call of the function with all-constant > arguments can be immediately replaced > with the function value. Note it says "can be", not "always will be". IMMUTABLE is a promise you make to the system about the function's behavior ... not vice versa. > Used as default value: > # alter table t_a alter b set default test(3); > NOTICE: test called > ALTER TABLE > #\d t_a > Table "public.t_a" > Column | Type | Modifiers > --------+---------+----------- > a | integer | > b | integer | default 4 This is a bug, or at least a bad idea in hindsight, and 7.4 doesn't do it anymore. regards, tom lane