X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 1609DD1B169 for ; Wed, 19 May 2004 14:39:33 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 25719-06 for ; Wed, 19 May 2004 14:39:13 -0300 (ADT) Received: from p15124592.pureserver.info (p15124592.pureserver.info [217.160.181.164]) by svr1.postgresql.org (Postfix) with ESMTP id 7E5F5D1B182 for ; Wed, 19 May 2004 14:39:12 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by p15124592.pureserver.info (Postfix) with ESMTP id 2C9C817981 for ; Wed, 19 May 2004 19:39:12 +0200 (CEST) Received: from sarge (p508A8EF0.dip0.t-ipconnect.de [80.138.142.240]) by p15124592.pureserver.info (Postfix) with ESMTP id 6EE3D1796E for ; Wed, 19 May 2004 19:39:11 +0200 (CEST) Received: from mk-os.de (unknown [192.168.0.210]) by sarge (Postfix) with ESMTP id C18B23EC05 for ; Wed, 19 May 2004 19:39:10 +0200 (CEST) Message-ID: <40AB9C41.4050502@mk-os.de> Date: Wed, 19 May 2004 19:41:21 +0200 From: Martin Knipper User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.6) Gecko/20040113 X-Accept-Language: de-at, de, en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: Function valid only for one table References: <40AB7272.2090605@mk-os.de> <40AB8C4C.8080602@archonet.com> <40AB94CF.90802@mk-os.de> <18520.1084987999@sss.pgh.pa.us> In-Reply-To: <18520.1084987999@sss.pgh.pa.us> X-Enigmail-Version: 0.83.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS at MK-OS X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.2 tagged_above=0.0 required=5.0 tests=RCVD_IN_NJABL, RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200405/171 X-Sequence-Number: 17885 Hi Tom, Am 19.05.2004 19:33 schrieb Tom Lane: > Martin Knipper writes: > >>I thought about a mixture of object orientation and a normal table >>for a relational database. >>someFunction() is a method for the object/table someTable. > > Perhaps you could do what you want with functions accepting table > rowtypes. > > create function someFunction(someTable) returns ... > > select someFunction(t.*) from someTable t where ... > -- works > > select someFunction(t.*) from anotherTable t where ... > -- fails > > create function someFunction(anotherTable) returns ... > > select someFunction(t.*) from someTable t where ... > -- still works > > select someFunction(t.*) from anotherTable t where ... > -- now calls the second someFunction() > > As of existing releases this doesn't scale well to large tables, because > passing a whole table row to a function leaks memory intraquery. That > is fixed for 7.5 though. > Thanks for those examples. Can you tell me, if this is something that is defined in the SQL 92/99/03 Standards ? Greetings, Martin