Problem while inserting a varchar

From: Christian Stalp <christian(dot)stalp(at)gmx(dot)de>
To: pgsql-novice(at)postgresql(dot)org
Subject: Problem while inserting a varchar
Date: 2008-02-17 18:30:48
Message-ID: 47B87D58.3040701@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello togehter,
I have a problem while writing a string look like this: '0:40:f4:d3:0:0'
into a table.
My table has this structure:
CREATE TABLE RETRY(
rid bigserial primary key,
source_macaddress varchar (40),
destination_macaddress varchar (40),
accesspoint integer references ACCESSPOINT(aid),
retray_day date,
retry_time time
);

My insert string looks as follows: INSERT INTO RETRY VALUES (
'0:40:f4:d3:0:0','0:40:f4:d3:0:0',1, 2008-02-17,18:42:05 );

and the postgres-log tells me anything about a invalid input syntax for
the whole number »0:40:f4:d3:0:0«
The first value we have is a bigserial. I thought this is integer-number
which is automatically created by the database? Is that wrong? How can I
create a autogenerated id and how should format an input string that
adapts to that demand ? I think the real question should be "is
bigserial really auto-generated number?

Thank you

Gruss Christian

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Glaesemann 2008-02-17 19:22:09 Re: Problem while inserting a varchar
Previous Message Tom Lane 2008-02-17 02:15:28 Re: configuring psqlodbc-08.03.0100