[SQL] inheritance

2010-03-17 Thread Zdravko Balorda
Hi, I am new to postgress inheritance. Once a parent row is inserted can I later reconnect child rows so that thay get adopted by parent row? Regards, Zdravko. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpre

Re: [SQL] inheritance

2007-03-08 Thread Shane Ambler
Richard Broersma Jr wrote: Maybe then you'll add a table basket that has a foreign key to the fruit table... ;-) From the inheritance link: ... A serious limitation of the inheritance feature is that indexes (including unique constraints) and foreign key constraints only apply to single

Re: [SQL] inheritance

2007-03-08 Thread Richard Broersma Jr
> > it's my understanding that inheritance has become much stronger in 8.2, > although it still only inherits parts of the table. True. But from what I understand, the only new feature that was added to table-inheritance was the ability to ALTER a table so that it inherits another table. Befor

Re: [SQL] inheritance

2007-03-08 Thread chester c young
--- Richard Broersma Jr <[EMAIL PROTECTED]> wrote: > > > > Maybe then you'll add a table basket that has a foreign key to the > fruit > > table... ;-) > > From the inheritance link: > ... > A serious limitation of the inheritance feature is that ... it's my understanding that inheritance h

Re: [SQL] inheritance

2007-03-08 Thread Richard Broersma Jr
> > Maybe then you'll add a table basket that has a foreign key to the fruit > table... ;-) >From the inheritance link: ... A serious limitation of the inheritance feature is that indexes (including unique constraints) and foreign key constraints only apply to single tables, not to their in

Re: [SQL] inheritance

2007-03-08 Thread Shane Ambler
chester c young wrote: --- Greg Toombs <[EMAIL PROTECTED]> wrote: I'm trying to figure out how to nicely implement a C++ class-likesystem > > with PostgreSQL. Consider the following: Tables Fruit, Apple, Orange you can do this traditionally or through pg inheritance, although I do not think

Re: [SQL] inheritance

2007-03-08 Thread chester c young
> --- Greg Toombs <[EMAIL PROTECTED]> wrote: > > > I'm trying to figure out how to nicely implement a C++ class-likesystem > > with PostgreSQL. Consider the following: > > Tables Fruit, Apple, Orange you can do this traditionally or through pg inheritance, although I do not think inheritance is w

Re: [SQL] Inheritance (general hints wanted)

2005-09-20 Thread Achilleus Mantzios
Judging from the replies i got, it seems that inheritance is even less used than i initially thought. I think that the OO term is a little too much advertised in pgsql advocacy various acts, than actually engineered. However, OO in pgsql besides being a traditionally cool acronym, it also *could

Re: [SQL] Inheritance (general hints wanted)

2005-09-20 Thread Achilleus Mantzios
O Achilleus Mantzios έγραψε στις Sep 20, 2005 : > > Hi, > > I think i have reached a point in my PgSQL years > that i am seriously thinking of using inheritance. > > The situation is simple: An new entity (tanker vessels crew) > is about to be modeled, and i suspect > there will be a future nee

Re: [SQL] Inheritance (general hints wanted)

2005-09-20 Thread thomas.silvi
Hi, I am not an expert but in object conception, a design pattern exists for the case you describe. I don't remember which one. The idea is to add an attribute that references the job of the employee. The inheritance is not on the side of the employee but on the side of the job. So if

[SQL] Inheritance (general hints wanted)

2005-09-20 Thread Achilleus Mantzios
Hi, I think i have reached a point in my PgSQL years that i am seriously thinking of using inheritance. The situation is simple: An new entity (tanker vessels crew) is about to be modeled, and i suspect there will be a future need to include the rest of 'workers' besides 'sailors', IOW i suspect

[SQL] Inheritance, plpgsql inserting, and revisions

2004-06-16 Thread Phil Endecott
Dear Postgresql Experts, A few days ago I posted a message asking about INSERTing a row based on a RECORD variable in a plpgsql function. I haven't had any replies - maybe it got lost in the weekend's spam - so I thought I'd post again giving some more background to what I'm trying to do. 1.

Re: [SQL] Inheritance or no inheritance, there is a question

2003-08-20 Thread David Fetter
Josh Berkus <[EMAIL PROTECTED]> wrote: > Vernon, > >> What is the best solution for this DB scheme problem? > > Have you considered not using inheritance? As a relational-SQL geek myself, > I'm not keen on inheritance -- I feel it mucks up the relational model. Not > everyone agrees with me,

Re: [SQL] Inheritance or no inheritance, there is a question

2003-08-19 Thread Josh Berkus
Vernon, > Thanks for your suggestion. I haven't thought this structure, to compose a > table with another one. That probably is the best solution I can have. With > this approach, I need to have two tables for B. As a result, all queries, > insertion, update, deletion, of B need to operate on thes

Re: [SQL] Inheritance or no inheritance, there is a question

2003-08-18 Thread Josh Berkus
Vernon, > What is the best solution for this DB scheme problem? Have you considered not using inheritance? As a relational-SQL geek myself, I'm not keen on inheritance -- I feel it mucks up the relational model. Not everyone agrees with me, of course. Personally, I'd suggest the following s

[SQL] Inheritance or no inheritance, there is a question

2003-08-18 Thread Vernon Smith
I am working on an application system refinement. There is a user profile table in the current system. After the refinement, there are new separated roles, A and B, of the users. The role A only has a few valid fields of the original profile table while the role B still has the whole profile t

[SQL] Inheritance and standards

2003-06-27 Thread Markus Bertheau
Hi, in how far are the Table Inheritance features of PostgreSQL SQL92 or SQL99? What other databases support table inheritance? Do they use the same syntax? Thanks -- Markus Bertheau Cenes Data GmbH ---(end of broadcast)--- TIP 2: you can get o

[SQL] Inheritance and Referencial Integrity

2003-05-28 Thread Stuart
I'm using 7.3.2 which extends the inheritance of some checks and triggers to inherited tables, but still falls short of foreign key referencees looking into child tables. Are there plans to address these defficencies and when might we see this take place. Thanks Stuart

[SQL] Inheritance in SQL99 ?

2002-11-26 Thread Albrecht Berger
Hello, is the inheritance of tables specified in the SQL99 standard, or is this a postgresql "add-on" ? Does anybody know when the primary key bug, which is documented in the docs, of this feature will be fixed ? Thx berger ---(end of broadcast)-

Re: [SQL] inheritance problems

2002-06-14 Thread Stephan Szabo
On Fri, 14 Jun 2002, Matt wrote: > I have a parent with two columns, the primary key; several children > inherit these columns. > > I can see all the childrens primary keys in the parent. however I can't > reference data in the parent table that was entered into a child. I get > a referential int

[SQL] Inheritance is completely broken [was: Re: Creating foreign key constraint to child table?]

2001-08-05 Thread Allan Engelhardt
Dimitri pointed out (the post does not seem to have appered yet) that you can also do: test=# create table foo(id integer primary key); NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'foo_pkey' for table 'foo' CREATE test=# create table bar () inherits (foo);

[SQL] Inheritance: Performance & Indexes

2001-06-18 Thread Itai Zukerman
Just curious: create table a (x int4 primary key); create table a1 () inherits (a); [...] delete from a where x = 1000; I take it that this is equivalent to: delete from only a where x = 1000; delete from only a1 where x = 1000; In particular, for performance reasons I should try

[SQL] Inheritance - Multiple membership

2001-06-12 Thread Jimmie Fulton
This question was asked in 1998 on this list by someone else, but did not appear to be answered... Say I have a tbl_person. tbl_teacher and tbl_student both inherit from tbl_person and each have their own extended attributes. Is it possible for a person in tbl_person to be both a teacher at the

Re: [SQL] Inheritance Semantics

2001-04-09 Thread Bruce Momjian
> Could someone (Chris Mead?) post an update on the status of fixing > PostgreSQL's inheritance semantics in the following ways: > > Has a decision been made to implementing true inheritance via INHERITS or an > alternative keyword? > > By true inheritance, I mean first and foremost that any que

[SQL] Inheritance Semantics

2001-04-09 Thread Mark Butler
Could someone (Chris Mead?) post an update on the status of fixing PostgreSQL's inheritance semantics in the following ways: Has a decision been made to implementing true inheritance via INHERITS or an alternative keyword? By true inheritance, I mean first and foremost that any query on a super-

[SQL] inheritance and primary key

2000-06-14 Thread Bernie Huang
Hi, Is primary key similar to 'not null columns with indices'? The reason I am asking because I found that when you inherit table B from table A, the primary key in A won't be inherited to B, but only the columns. I was wondering how do you inherit a primary key or, even, a foreign key? If it'

[SQL] Inheritance heirarchy

2000-05-31 Thread Jon Parise
I'm not entirely sure what the correct term for this would be, but I'll just call it an inhertiance heirarchy for lack of a more correct name. Anyway, I'd like some pointers on modeling a heirarchical structure where a given "parent" row can have multiple "children" rows, and each "child" has eit

Re: [SQL] Inheritance

2000-05-30 Thread Peter Eisentraut
On 30 May 2000, Christophe Labouisse wrote: > I have a table (A) with a few "sibbling" tables (B and C for You probably mean "child" tables. > instance). When I make the following query : select id from A* where > [condition] pgsql returns ids taken from A, B or C (which is what I > want). Is t

[SQL] Inheritance

2000-05-30 Thread Christophe Labouisse
I have a table (A) with a few "sibbling" tables (B and C for instance). When I make the following query : select id from A* where [condition] pgsql returns ids taken from A, B or C (which is what I want). Is there a way to know to what table the id actually belong ? -- Le cinéma en Lumière : ht