Discussion:
inheritance question
(too old to reply)
evgeny tsurkin
2004-07-18 08:46:08 UTC
Permalink
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?
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?
Hi All!
That probably was already asked thousand times
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
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.

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
Stephan Szabo
2004-07-19 04:56:33 UTC
Permalink
Hi All!
That probably was already asked thousand times
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
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
Tsirkin Evgeny
2004-07-19 15:01:14 UTC
Permalink
But this way i will touch both the schema AND data
And what i want is to change the schema ONLY.
Thanks
Post by Stephan Szabo
Hi All!
That probably was already asked thousand times
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
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.

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ***@postgresql.org so that your
message can get through to the mailing list cleanly
Stephan Szabo
2004-07-19 16:16:42 UTC
Permalink
Post by Tsirkin Evgeny
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.
Post by Tsirkin Evgeny
Post by Stephan Szabo
Hi All!
That probably was already asked thousand times
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
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 6: Have you searched our list archives?

http://archives.postgresql.org

Loading...