X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B1FCC53336 for ; Mon, 18 Apr 2005 22:20:30 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 68745-02 for ; Tue, 19 Apr 2005 01:20:24 +0000 (GMT) Received: from mx5.net.nih.gov (mailfwd.nih.gov [165.112.130.36]) by svr1.postgresql.org (Postfix) with ESMTP id 4AAFE5331B for ; Mon, 18 Apr 2005 22:20:21 -0300 (ADT) Received: from mx5.net.nih.gov (localhost [127.0.0.1]) by mx5.net.nih.gov (8.12.10/8.11.6) with ESMTP id j3J1KPas009425 for ; Mon, 18 Apr 2005 21:20:25 -0400 Received: from WATSON (vpn-165-112-10-42.net.nih.gov [165.112.10.42]) by mx5.net.nih.gov (8.12.10/8.11.6) with SMTP id j3J1KOKe009420; Mon, 18 Apr 2005 21:20:25 -0400 Message-ID: <00a201c5447d$f7f50d40$5179f345@WATSON> From: "Sean Davis" To: "A. Kulikov" Cc: References: <006101c54478$7b2fed70$5179f345@WATSON> Subject: Re: Function declaration Date: Mon, 18 Apr 2005 21:20:26 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.078 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/260 X-Sequence-Number: 21153 Alex, What happens if you declare your function as: function(text,text) or whatever your datatypes for each argument are supposed to be and then, within your function, test whether the arguments are NULL? I haven't tried it, so I can't say for sure, but it seems like you should be able to pass a SQL NULL as an argument. Sean ----- Original Message ----- From: "A. Kulikov" To: "Sean Davis" Sent: Monday, April 18, 2005 8:44 PM Subject: Re: [SQL] Function declaration Unfortunately that is not what I am looking for =( Although the task I have in mind can be accomplished using overloading. Is there no equivalent in plpgsql for function(foo,bar=null)... ?? regards, alex 2005/4/19, Sean Davis : > Alex, > > I think what you are looking for is called function overloading. See the > documenation here: > > http://www.postgresql.org/docs/8.0/interactive/xfunc-overload.html > > Sean > > ----- Original Message ----- > From: "A. Kulikov" > To: > Sent: Monday, April 18, 2005 8:28 PM > Subject: [SQL] Function declaration > > Is there a possiblity to declare functions with optional parameters > i.e. in case some parameters are not passed to the function, then some > kind of default value is assigned to the function? > > -- The mind is essential -- http://essentialmind.com/