pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
inheritance question
6+ messages / 5 participants
[nested] [flat]

* inheritance question
@ 2004-07-13 11:32  evgeny tsurkin <tsurkin@idefix.jct.ac.il>
  0 siblings, 2 replies; 6+ messages in thread

From: evgeny tsurkin @ 2004-07-13 11:32 UTC (permalink / raw)
  To: pgsql-admin

Hi All!
That probably was already asked thousand times
but i did not find an exact answer:
I want to have two tables the second one will have 
all the columns from the first + some extra .The data
should be complittly separate .I was trying to use 
inheritance and setted the  SQL_INHERITANCE = false 
to separate the data ,but when trying to add a column
to the father i have got an error:
ERROR:  Attribute must be added to child tables too
what can i do ?
Thanks
Evgeny.




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: inheritance question
@ 2004-07-17 04:38  mike g <mike@thegodshalls.com>
  parent: evgeny tsurkin <tsurkin@idefix.jct.ac.il>
  1 sibling, 1 reply; 6+ messages in thread

From: mike g @ 2004-07-17 04:38 UTC (permalink / raw)
  To: evgeny tsurkin <tsurkin@idefix.jct.ac.il>; +Cc: pgsql-admin

According to your posting below the second table will have all the
columns of the first table plus extra columns.  If that is true then why
are you trying to add a column to your first table and not your second
table as well?

On Tue, 2004-07-13 at 06:32, evgeny tsurkin wrote:
> Hi All!
> That probably was already asked thousand times
> but i did not find an exact answer:
> I want to have two tables the second one will have 
> all the columns from the first + some extra .The data
> should be complittly separate .I was trying to use 
> inheritance and setted the  SQL_INHERITANCE = false 
> to separate the data ,but when trying to add a column
> to the father i have got an error:
> ERROR:  Attribute must be added to child tables too
> what can i do ?
> Thanks
> Evgeny.
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: inheritance question
@ 2004-07-18 08:46  evgeny tsurkin <tsurkin@p-roman.jct.ac.il>
  parent: mike g <mike@thegodshalls.com>
  0 siblings, 0 replies; 6+ messages in thread

From: evgeny tsurkin @ 2004-07-18 08:46 UTC (permalink / raw)
  To: mike g <mike@thegodshalls.com>; +Cc: pgsql-admin

I am but that is what actually want : to be able to add a column
to the first table and have the second to be added a coulumns
automatically.The target is realy simple :
i want to simplify management of the schema and thus be able to 
manage only parantes - children should be managed aoutomagically
But the data is NOT the same!
Isn't it the inheretence is all about - to inherit?
On Fri, 16 Jul 2004, mike g wrote:

> According to your posting below the second table will have all the
> columns of the first table plus extra columns.  If that is true then why
> are you trying to add a column to your first table and not your second
> table as well?
> 
> On Tue, 2004-07-13 at 06:32, evgeny tsurkin wrote:
> > Hi All!
> > That probably was already asked thousand times
> > but i did not find an exact answer:
> > I want to have two tables the second one will have 
> > all the columns from the first + some extra .The data
> > should be complittly separate .I was trying to use 
> > inheritance and setted the  SQL_INHERITANCE = false 
> > to separate the data ,but when trying to add a column
> > to the father i have got an error:
> > ERROR:  Attribute must be added to child tables too
> > what can i do ?
> > Thanks
> > Evgeny.
> > 
> > 
> > ---------------------------(end of broadcast)---------------------------
> > TIP 4: Don't 'kill -9' the postmaster
> 

-- 
-------------------------------------------
Evgeny.



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: inheritance question
@ 2004-07-19 04:56  Stephan Szabo <sszabo@megazone.bigpanda.com>
  parent: evgeny tsurkin <tsurkin@idefix.jct.ac.il>
  1 sibling, 1 reply; 6+ messages in thread

From: Stephan Szabo @ 2004-07-19 04:56 UTC (permalink / raw)
  To: evgeny tsurkin <tsurkin@idefix.jct.ac.il>; +Cc: pgsql-admin

On Tue, 13 Jul 2004, evgeny tsurkin wrote:

> Hi All!
> That probably was already asked thousand times
> but i did not find an exact answer:
> I want to have two tables the second one will have
> all the columns from the first + some extra .The data
> should be complittly separate .I was trying to use
> inheritance and setted the  SQL_INHERITANCE = false
> to separate the data ,but when trying to add a column
> to the father i have got an error:
> ERROR:  Attribute must be added to child tables too
> what can i do ?

Either don't use SQL_INHERITANCE=false, or specify that you want
to act upon the entire tree using the older syntax which I think
would look like ALTER TABLE first* add column ...
(note the *)





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: inheritance question
@ 2004-07-19 15:01  Tsirkin Evgeny <tsurkin@mail.jct.ac.il>
  parent: Stephan Szabo <sszabo@megazone.bigpanda.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Tsirkin Evgeny @ 2004-07-19 15:01 UTC (permalink / raw)
  To: Stephan Szabo <sszabo@megazone.bigpanda.com>; +Cc: pgsql-admin

But this way i will touch both the schema AND data
And what i want is to change the schema ONLY.
Thanks

On Sun, 18 Jul 2004, Stephan Szabo wrote:

> On Tue, 13 Jul 2004, evgeny tsurkin wrote:
> 
> > Hi All!
> > That probably was already asked thousand times
> > but i did not find an exact answer:
> > I want to have two tables the second one will have
> > all the columns from the first + some extra .The data
> > should be complittly separate .I was trying to use
> > inheritance and setted the  SQL_INHERITANCE = false
> > to separate the data ,but when trying to add a column
> > to the father i have got an error:
> > ERROR:  Attribute must be added to child tables too
> > what can i do ?
> 
> Either don't use SQL_INHERITANCE=false, or specify that you want
> to act upon the entire tree using the older syntax which I think
> would look like ALTER TABLE first* add column ...
> (note the *)
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
> 

-- 
-------------------------------------------
Evgeny.



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: inheritance question
@ 2004-07-19 16:16  Stephan Szabo <sszabo@megazone.bigpanda.com>
  parent: Tsirkin Evgeny <tsurkin@mail.jct.ac.il>
  0 siblings, 0 replies; 6+ messages in thread

From: Stephan Szabo @ 2004-07-19 16:16 UTC (permalink / raw)
  To: Tsirkin Evgeny <tsurkin@mail.jct.ac.il>; +Cc: pgsql-admin

On Mon, 19 Jul 2004, Tsirkin Evgeny wrote:

> But this way i will touch both the schema AND data
> And what i want is to change the schema ONLY.

The use the ALTER TABLE table* ADD COLUMN syntax to alter
the schema for table and its descendants.

In general, SQL_INHERITANCE=false is primarily there for
applications that were written for older versions of PostgreSQL.
You probably should be using queries that use the ONLY keyword
rather than relying on the guc variable.

> On Sun, 18 Jul 2004, Stephan Szabo wrote:
>
> > On Tue, 13 Jul 2004, evgeny tsurkin wrote:
> >
> > > Hi All!
> > > That probably was already asked thousand times
> > > but i did not find an exact answer:
> > > I want to have two tables the second one will have
> > > all the columns from the first + some extra .The data
> > > should be complittly separate .I was trying to use
> > > inheritance and setted the  SQL_INHERITANCE = false
> > > to separate the data ,but when trying to add a column
> > > to the father i have got an error:
> > > ERROR:  Attribute must be added to child tables too
> > > what can i do ?
> >
> > Either don't use SQL_INHERITANCE=false, or specify that you want
> > to act upon the entire tree using the older syntax which I think
> > would look like ALTER TABLE first* add column ...
> > (note the *)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2004-07-19 16:16 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-07-13 11:32 inheritance question evgeny tsurkin <tsurkin@idefix.jct.ac.il>
2004-07-17 04:38 ` mike g <mike@thegodshalls.com>
2004-07-18 08:46   ` evgeny tsurkin <tsurkin@p-roman.jct.ac.il>
2004-07-19 04:56 ` Stephan Szabo <sszabo@megazone.bigpanda.com>
2004-07-19 15:01   ` Tsirkin Evgeny <tsurkin@mail.jct.ac.il>
2004-07-19 16:16     ` Stephan Szabo <sszabo@megazone.bigpanda.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox