470,647 Members | 1,268 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,647 developers. It's quick & easy.

insert and heritage...

hi everyone.... i'm having a slight problem understanding something....
I've bought a book about programming postgres, and there's a part
concerning heritage.... so as i need to implement something like this in
my work, i'm testing it.

I have a database called project (no matter the name)... It contains
several tables. One of them is called "equipements" and has 5 columns :

CREATE TABLE equipements (id serial, adresseMac macaddr NOT NULL UNIQUE,
adresseIp cidr, etat char, administrable bool,primary key(id));

so i entered a first value in this table with :
INSERT INTO equipements (administrable,adresseip,adressemac,etat) VALUES

so far so good.

now, i have another table called "postetravail" that inherits from
"equipements".... it was created like this :

CREATE TABLE postetravail (nom char) INHERITS (equipements);

i want this table to have quite the same columns as "equipments", but
all i need for this entity is a name. When i look every column with sun
one studio (for example), i see them right...

my first trouble comes from the state of "id", that is no more a primary
key in "postetravail" while it was in "equipements", and it's located
between "etat" and "nom"
now i have


while i was awaiting :

id (primary key)

the next problem concerns the insert :

INSERT INTO postetravail (administrable,adresseip,adressemac,etat,nom)
VALUES ('false','','FF:EE:DD:CC:BB:AB','1','bi g')\g
ERROR: value too long for type character(1)

What is the problem.... I have the values in the correct order (i
guess), and i keep having this error... i tried to add the id column in
the insert, but it did not solve the problem....

Does somebody have clues for these 2 problems ?
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 11 '05 #1
0 1140

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Howard Hinnant | last post: by
6 posts views Thread by Mark P | last post: by
16 posts views Thread by Philip Boonzaaier | last post: by
reply views Thread by stephane parenton | last post: by
2 posts views Thread by Geoffrey KRETZ | last post: by
3 posts views Thread by MP | last post: by
5 posts views Thread by Alexandre Badez | last post: by
reply views Thread by warner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.