Extending postgres objects with attributes - Mailing list pgsql-general

From Davor J.
Subject Extending postgres objects with attributes
Date
Msg-id i0q37h$1vpp$1@news.hub.org
Whole thread Raw
Responses Re: Extending postgres objects with attributes
List pgsql-general
Several times I wanted to "extend" some of the postgres objects, like roles
or functions. For example, sometimes you want to add extra attributes to
roles, which are application dependent. Or sometimes you want to store
functions and reference them in your custom tables, without losing
referential integrity.

Now, postgres doesn't allow it's objects (from system tables) be referred to
in your custom tables, thereby making the process of extension difficult.
(cf. http://archives.postgresql.org/pgsql-general/2004-12/msg00840.php) So I
wanted to ask here how people solve/implement such "extension" requirements?

Regards,
Davor

PS using inheritance in this scenario is problematic. U can for example do
this: CREATE TABLE tbl_privileges ( priv_execute integer ) INHERITS
(pg_authid); but the system internally will probably always use FROM ONLY
pg_authid, so it will not see the users from tbl_priviledges. IN other
words, those user will not be "real roles". Note also the fact that in this
way, pg_authid could seem to have it's UNIQUE constraint on rolname
invalidated (besides the other INHERITANCE caveats...) And finally, I wonder
if inheriting a system table is even safe...



pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: How to know if an INSERT is done inside a function?
Next
From: Andre Lopes
Date:
Subject: Open Source Forum Software using PostgreSQL?