Received: from sss.pgh.pa.us ([216.151.103.158]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3DGul874180 for ; Fri, 13 Apr 2001 12:56:48 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f3DGuZR04681; Fri, 13 Apr 2001 12:56:36 -0400 (EDT) To: Mark Butler cc: pgsql-docs@postgresql.org Subject: Re: Function Inheritance? In-reply-to: <3AD28152.5B88F069@middle.net> References: <3AD28152.5B88F069@middle.net> Comments: In-reply-to Mark Butler message dated "Mon, 09 Apr 2001 21:43:14 -0600" Date: Fri, 13 Apr 2001 12:56:35 -0400 Message-ID: <4678.987180995@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200104/47 X-Sequence-Number: 619 Mark Butler 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