[DOCS] role hierarchy
hi does postgresql support role hierarchy and how? does child inherit parent permissions?how? thanks in advance
Re: [DOCS] [GENERAL] Postgresql 8.3X supports Arrays of Composite Types?
On Mon, Apr 20, 2009 at 8:13 AM, Robson Fidalgo wrote: > Hi David, > > > > Thanks for your help, but I want a relational-object solution. The solution > presented by Tom Lane (Thanks Tom) runs very well and it is a > relational-object implementation (I suggest put a similar example in > postgresql 8.3X documentation). > > > > Cheers, > > Robson. > > On Sun, Apr 19, 2009 at 8:56 PM, David Fetter wrote: > >> On Sun, Apr 19, 2009 at 06:03:26PM -0300, Robson Fidalgo wrote: >> > Hello, >> > I am using postgresql 8.3X and I created a table (see example below) >> > that has an attribute that is an Array of a Composite Type (ROW). >> > However, I do not know how can I insert a record in this table. >> >> You want a normalized table anyhow. If you want something >> denormalized, use a view. >> >> > Example: >> > >> > CREATE table phone ( >> > cod varchar, >> > num varchar); >> > >> > CREATE TABLE person ( >> > name varchar, >> > telephone phone[]); >> >> This is better as: >> >> CREATE TABLE phone ( >>cod VARCHAR, >>num VARCHAR, >>PRIMARY KEY(cod, num) >> ); >> >> CREATE TABLE person ( >>name varchar, >>PRIMARY KEY(name) >> ) >> >> CREATE TABLE person_phone ( >>name VARCHAR NOT NULL REFERENCES person(name), >>cod VARCHAR, >>num VARCHAR, >>FOREIGN KEY(cod, num) REFERENCES phone(cod, num), >>PRIMARY KEY(name, cod, num) >> ); >> >> Cheers, >> David. >> -- >> David Fetter http://fetter.org/ >> Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter >> Skype: davidfetter XMPP: [email protected] >> >> Remember to vote! >> Consider donating to Postgres: http://www.postgresql.org/about/donate >> >> -- >> Sent via pgsql-docs mailing list ([email protected]) >> To make changes to your subscription: >> http://www.postgresql.org/mailpref/pgsql-docs >> > >
[DOCS] Does Postgresql 8.3X support Object/Class Methods and association between objects with REF?
Hello, I am study the relational-object paradigm with postgresql 8.3X and I know that it supports composite and/or array attributes. However, I didn't find documentation/examples about the usage of Object/Class Methods and association between objects with REF (like oracle does). Then, I'd like to know if theses concepts (Method and REF) are supported by postgresql 8.3X? I've searched the mailing lists and have found little about the OR features. There is some book or URL with a good material about postgres 8.3 OR features? Below follows an example (Son has a REF for his Father and a get_name method) in oracle. Then, how can I do a similar example in Postgresql 8.3X? (Just a code example help me! You don't need explain the example.) Thanks in advances, Robson. CREATE TYPE tp_father AS OBJECT ( name varchar2(60)); CREATE OR REPLACE TYPE BODY tp_father AS MEMBER FUNCTION get_name RETURN varchar2 IS BEGIN RETURN name; END; END; CREATE TYPE tp_son AS OBJECT ( name varchar2(60), father REF tp_father); CREATE TABLE father OF tp_father; CREATE TABLE son OF tp_son;
Re: [DOCS] [GENERAL] Postgresql 8.3X supports Arrays of Composite Types?
On Mon, Apr 20, 2009 at 08:13:15AM -0300, Robson Fidalgo wrote: > Hi David, > > Thanks for your help, but I want a relational-object solution. You can have one without denormalizing. Just use VIEWs and rewrite RULEs for INSERTs, UPDATEs and DELETEs on them. > The solution presented by Tom Lane (Thanks Tom) runs very well > and it is a relational-object implementation (I suggest put a > similar example in postgresql 8.3X documentation). The docs already contain an example: http://www.postgresql.org/docs/current/static/rules-update.html There are excellent reasons not to encourage people to do only half the job. One part, the smaller part, is presenting an interface which one part of your OO code can talk to. The other part, and the much larger one, is having a well-indexed, normalized data store underneath. Example: Under the store-the-compound system you're proposing, how do you find all the people who have a common prefix? Answer: Normalize. If you need that answer quickly, you're looking at down time and DDL changes. The questions you ask about the data are impossible to know in advance, so normalized data helps you deal with that. Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: [email protected] Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate -- Sent via pgsql-docs mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs
Re: [DOCS] role hierarchy
On Monday 20 April 2009 10:49:20 ali haghighat wrote: > does postgresql support role hierarchy and how? > does child inherit parent permissions?how? You can configure that in some detail. All of the options you describe are supported. Start by reading the docs: http://www.postgresql.org/docs/8.3/interactive/sql-grant.html -- Sent via pgsql-docs mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs
