472,975 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,975 software developers and data experts.

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 1195

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Howard Hinnant | last post by:
I recently asked for a survey of multimap insert with hint behavior, in support of a paper I'm writing concerning lwg issue 233. My sincere thanks to Beman Dawes, Raoul Gough, Russell Hind, Bronek...
by: Mark P | last post by:
Some time ago I posted here about inserting into a set with a hint: ...
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to...
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
by: stephane parenton | last post by:
Hi everyone, I'm trying to understand the heritage with postgres.... I have a table called iface with (Physik macaddr UNIQUE, logik cidr) and another table called komputer with (OS...
by: Chris Kratz | last post by:
Hello all, We have run into what appears to be a problem with rules and subselects in postgres 7.4.1. We have boiled it down to the following test case. If anyone has any thoughts as to why...
by: Geoffrey KRETZ | last post by:
Hello, I'm wondering if the following behaviour is the correct one for PostGreSQL (7.4 on UNIX). I've a table temp_tab with 5 fields (f1,f2,f3,...),and I'm a launching the following request :...
by: MP | last post by:
Hi Posted this several hours ago to another ng but it never showed up thought i'd try here. using vb6, ado, .mdb, jet4.0, no access given table tblJob with field JobNumber text(10) 'The...
by: Alexandre Badez | last post by:
Hye, I'm developing a little app, and I want to make multi heritage. My problem is that my both parent do have __slots__ define. So I've got something like: class foo(object): __slots__ = ...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.