Re: insert and heritage...

From: stephane parenton <stephane(at)parenton(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: insert and heritage...
Date: 2003-08-17 12:51:34
Message-ID: 3F3F7A56.7060808@parenton.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hi Len,

Len Morgan a écrit:

>the next problem concerns the insert :
>
>INSERT INTO postetravail (administrable,adresseip,adressemac,etat,nom)
>VALUES ('false','192.168.0.2','FF:EE:DD:CC:BB:AB','1','big')\g
>ERROR: value too long for type character(1)
>
>Administrable is defined as char (i.e., length of one) and 'false' is 5
>characters. You probably want type Boolean instead of character.
>
>
Sure ;-)
i want boolean type, that's why the parent table "equipement" is
declared with :

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

from the dump file i've made, i have the result :

CREATE TABLE equipements (
id serial NOT NULL,
adressemac macaddr NOT NULL,
adresseip cidr,
etat character(1),
administrable boolean
);
CREATE TABLE postetravail (
nom character(1)
)
INHERITS (equipements);

COPY postetravail (id, adressemac, adresseip, etat, administrable, nom)
FROM stdin;

and there administrable is boolean, so why postetravail that inherits
from equipement should not be the same ? am i doing wrong with the
parameters order ?

Stephane

Responses

Browse pgsql-general by date

  From Date Subject
Next Message stephane parenton 2003-08-17 12:58:40 Re: insert and heritage... ooops... solved
Previous Message Ron Johnson 2003-08-17 12:37:48 Re: Database modelling question for version management