From: | Martin Knipper <knipper(at)mk-os(dot)de> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Function valid only for one table |
Date: | 2004-05-19 17:41:21 |
Message-ID: | 40AB9C41.4050502@mk-os.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Hi Tom,
Am 19.05.2004 19:33 schrieb Tom Lane:
> Martin Knipper <knipper(at)mk-os(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Jie Liang | 2004-05-19 17:41:57 | Re: rules |
Previous Message | Tom Lane | 2004-05-19 17:33:19 | Re: Function valid only for one table |