Skip site navigation (1) Skip section navigation (2)

Re: Function Inheritance?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mark Butler <butlerm(at)middle(dot)net>
Cc: pgsql-docs(at)postgresql(dot)org
Subject: Re: Function Inheritance?
Date: 2001-04-13 16:56:35
Message-ID: 4678.987180995@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-docs
Mark Butler <butlerm(at)middle(dot)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

In response to

Responses

pgsql-docs by date

Next:From: Mark ButlerDate: 2001-04-13 17:35:23
Subject: Re: Function Inheritance?
Previous:From: Tony GrantDate: 2001-04-13 14:19:15
Subject: Re: [GENERAL] Re: ongoing holy grail thread - VICTORY!!!

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group