Thread: FW: inheritance of functions

FW: inheritance of functions

From
Andrzej Mazurkiewicz
Date:
Since I have not got any reply I try GENERAL list.
Regards,
Andrzej Mazurkiewicz

> -----Original Message-----
> From:    Andrzej Mazurkiewicz
> Sent:    22 paYdziernika 1999 11:27
> To:    'pgsql-sql@hub.org'
> Subject:    inheritance of functions
>
> In Postgres Users Guide, CREATE TABLE section, the following is stated:
>
>  Postgres automatically allows the created table to inherit functions on
> tables above it in the inheritance hierarchy.
>
>           Aside: Inheritance of functions is done according to the
> conventions of the Common Lisp Object System (CLOS).
>
> I have tried different constructs but I have not been able to create such
> a functions. Can anybody send me an example of a function that will be
> inherited by inherited table? I. e.
> create table A (
> .
> .
> );
>
> create function F ...
>
> create table B (
> ..
> ) inherits (A);
>
> Now I assume that I can somehow use function F on table B
>
> Thank you,
> Regards,
> Andrzej Mazurkiewicz

Re: [GENERAL] FW: inheritance of functions

From
"Aaron J. Seigo"
Date:
hi...

> >  Postgres automatically allows the created table to inherit functions on
> > tables above it in the inheritance hierarchy.
> > create table A (
> > .
> > .
> > );
> >
> > create function F ...
> >
> > create table B (
> > ..
> > ) inherits (A);
> >
> > Now I assume that I can somehow use function F on table B

you would be able to use function F on table B even if it didn't inherit A.

however, if you construct rules, triggers, etc... on table A, these should be
inherited by table B.

the manual is, as far as my experience has led me to believe, referring to
functions "bound" (for lack of a better word) to the parent table....

--
Aaron J. Seigo
Sys Admin