pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martin Knipper <knipper@mk-os.de>
To: pgsql-sql@postgresql.org
Subject: Re: Function valid only for one table
Date: Wed, 19 May 2004 19:41:21 +0200
Message-ID: <40AB9C41.4050502@mk-os.de> (raw)
In-Reply-To: <18520.1084987999@sss.pgh.pa.us>
References: <40AB7272.2090605@mk-os.de>
	<40AB8C4C.8080602@archonet.com>
	<40AB94CF.90802@mk-os.de>
	<18520.1084987999@sss.pgh.pa.us>

Hi Tom,

Am 19.05.2004 19:33 schrieb Tom Lane:
> Martin Knipper <knipper@mk-os.de> 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




view thread (5+ messages)

Message-ID: <40AB9C41.4050502@mk-os.de>
Permalink:  ../40AB9C41.4050502@mk-os.de/
Also on:    postgresql.org/message-id/40AB9C41.4050502@mk-os.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: knipper@mk-os.de
  Subject: Re: Function valid only for one table
  In-Reply-To: <40AB9C41.4050502@mk-os.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox