From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mark Butler <butlerm@middle.net>
Cc: pgsql-docs@postgresql.org
Subject: Re: Function Inheritance?
Date: Fri, 13 Apr 2001 12:56:35 -0400
Message-ID: <4678.987180995@sss.pgh.pa.us> (raw)
In-Reply-To: <3AD28152.5B88F069@middle.net>
References: <3AD28152.5B88F069@middle.net>
Mark Butler <butlerm@middle.net> writes:
> In http://www.postgresql.org/devel-corner/docs/postgres/sql-createtable.html
> "Postgres automatically allows the created table to inherit functions on
> tables above it in the inheritance hierarchy."
> "Postgres automatically allows the created table to inherit functions on
> tables above it in the inheritance hierarchy. Inheritance of functions is done
> according to the conventions of the Common Lisp Object System (CLOS)."
> Neither of these statements is true, right?
It still works.
regression=# create table foo (f1 int);
CREATE
regression=# create function getf1(foo) returns int as 'select $1.f1'
regression-# language 'sql';
CREATE
regression=# insert into foo values (42);
INSERT 149940 1
regression=# select getf1(foo) from foo;
getf1
-------
42
(1 row)
regression=# create table foot (g1 int) inherits (foo);
CREATE
regression=# insert into foot values (22,33);
INSERT 149954 1
regression=# select getf1(foot) from foot;
getf1
-------
22
(1 row)
We may have to break this at some point in pursuit of SQL-mandated
features, but it's not dead yet ...
regards, tom lane
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-docs@postgresql.org
Cc: tgl@sss.pgh.pa.us, butlerm@middle.net
Subject: Re: Function Inheritance?
In-Reply-To: <4678.987180995@sss.pgh.pa.us>
* 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