X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id E36C547E766 for ; Sat, 1 Mar 2003 21:03:56 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 22079-02 for ; Sat, 1 Mar 2003 21:03:54 -0500 (EST) Received: from zzz.zzz (unknown [212.57.173.125]) by postgresql.org (Postfix) with ESMTP id F274C476022 for ; Sat, 1 Mar 2003 19:46:41 -0500 (EST) Date: Sun, 2 Mar 2003 05:40:33 +0500 From: Denis Zaitsev To: Tom Lane Cc: pgsql-sql@postgresql.org Subject: Re: Are scalar type's in/out functions implicitly STRICT? Message-ID: <20030302054033.A30850@natasha.zzz.zzz> References: <20030228054544.A4208@natasha.zzz.zzz> <1341.1046400277@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1341.1046400277@sss.pgh.pa.us>; from tgl@sss.pgh.pa.us on Thu, Feb 27, 2003 at 09:44:37PM -0500 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200303/20 X-Sequence-Number: 12060 On Thu, Feb 27, 2003 at 09:44:37PM -0500, Tom Lane wrote: > Denis Zaitsev writes: > > So, I create some new scalar type and I don't declare its in/out > > functions as STRICT. But PostgreSQL copes with them such as they > > would be STRICT - they never get the NULL value. > > This is likely true in many places --- for example, COPY has a shortcut > because it wants to substitute \N for nulls. It would not be a bright > idea to assume that it's true in every place and forevermore. In > general, if you have a C function and don't want to be bothered with > explicit PG_ISNULL testing, you'd better mark it STRICT. > Ok, thanks.