X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 1C497D1B561 for ; Thu, 25 Sep 2003 05:50:15 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 64651-05 for ; Thu, 25 Sep 2003 02:50:05 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 4017ED1B544 for ; Thu, 25 Sep 2003 02:50:04 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h8P5o2iP002177; Thu, 25 Sep 2003 01:50:02 -0400 (EDT) To: Josh Berkus Cc: "George A.J" , pgsql-sql@postgresql.org Subject: Re: Case Insensitive comparison In-reply-to: <200309242145.21087.josh@agliodbs.com> References: <20030925033550.35699.qmail@web14915.mail.yahoo.com> <200309242145.21087.josh@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Wed, 24 Sep 2003 21:45:21 -0700" Date: Thu, 25 Sep 2003 01:50:02 -0400 Message-ID: <2176.1064469002@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/296 X-Sequence-Number: 15274 Josh Berkus writes: >> How can i create a function that accept and return any type. the type "any" >> is not allowing as parameter or return type. Is it possible? i want to >> create a function similar to NULLIF(). > You can't, nor will you be able to -- in te future, some 7.4 functions will be > able to *accept* any type, but they will still return a specific type. Au contraire. The 7.4 polymorphic-function features may well solve jinujose's problem, if he can indeed write a type-independent function body. For example create function nullif(anyelement, anyelement) returns anyelement as 'select case when $1 = $2 then null else $1 end' language sql; I'm not sure we're all the way there yet, cf http://archives.postgresql.org/pgsql-general/2003-09/msg00500.php regards, tom lane