X-Original-To: pgsql-sql@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 13DFA9261ED for ; Sun, 1 Jun 2003 14:46:34 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 71040-08 for ; Sun, 1 Jun 2003 14:46:23 -0400 (EDT) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by developer.postgresql.org (Postfix) with ESMTP id 4358F9261DA for ; Sun, 1 Jun 2003 14:46:23 -0400 (EDT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3084506; Sun, 01 Jun 2003 11:46:26 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Avi Schwartz , Tom Lane Subject: Re: generic return for functions Date: Sun, 1 Jun 2003 11:45:38 -0700 User-Agent: KMail/1.4.3 Cc: Rod Taylor , Bruce Momjian , pgsql-sql@postgresql.org References: <54D7C9C2-944C-11D7-ACB0-000393AE5044@CFFtechnologies.com> In-Reply-To: <54D7C9C2-944C-11D7-ACB0-000393AE5044@CFFtechnologies.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200306011145.38977.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new X-Archive-Number: 200306/10 X-Sequence-Number: 13768 Avi, > I understand why it will not be implemented with overloaded functions. > Is there a possibility to allow this only for functions that are not > overloaded? Unfortunately, no. There's simply no way for the database to tell the difference between a function call relying on defaults, and one with the wrong parameters. SQL Server's approach with defaults works *because* SQL Server does not support overloaded procedures. > The SQL function solution is really not going to help in > my case since the function builds a select statement dynamically based > on which parameters have a non-null value. The number of parameters is > something like 12 or 13 and the control on which parameters are set is > determined by a complex combination of program logic and user > selections. What I did to solve this problem was to force all > variables to be initialized to null and then set the non-null ones > before the call to the function. This sounds like a good solution to me. BTW, named parameters for PostgreSQL Functions are on the to-do list, but I don't think anyone is currently working on them. > very large tables (some of our tables are > 5M rows) :-) . What makes > it more impressive is the fact that SS runs on a 4 CPU machine with 2 > GB of memory while PostgreSQL on a single CPU machine with 384M memory > running SuSE 8.2. In the near future I will be moving the PostgreSQL > database to a similar configuration as SS. It will be interested to > compare them then. That's a very nice testimonial! Thanks. BTW, you will probably wish to join the PGSQL-Performance mailing list to make sure that you can tune your PostgreSQL database properly. -- Josh Berkus Aglio Database Solutions San Francisco