Skip site navigation (1) Skip section navigation (2)

Re: Problem while inserting a varchar

From: Christian Stalp <christian(dot)stalp(at)gmx(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Problem while inserting a varchar
Date: 2008-02-17 19:54:49
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Hello, thank you Tom Lane, thank you Michael Glaesemann,

Tom Lane wrote:
> 1. Explicitly say you want the default for the first column:
> INSERT INTO RETRY VALUES ( DEFAULT, '0:40:f4:d3:0:0', ... );
That seems to work. I allready omited rid, I think this was the problem.

Now I write (trough my program): INSERT INTO RETRY VALUES ( DEFAULT, 
'0:40:f4:d3:0:0','0:40:f4:d3:0:0',1, 2008-02-17,20:34:00 );

But now I get an syntax-error at character 87 »:«. I think that has 
nothing to do with my first problem.
The datatype here is time. Does the ":" has a special meaning here?
> 2. Use a column name list, and omit "rid" from it:
> INSERT INTO RETRY (source_macaddress, destination_macaddress, ...)
>   VALUES ( '0:40:f4:d3:0:0', ... );
> 3. Put the serial column last, so that you can just omit it without
> saying anything.  (This last is not strictly according to the letter of
> the SQL spec, I think, but PG allows it and so do some other databases.)
> BTW, why don't you use the "macaddr" data type for those MAC address
> columns?  Then you'd get some error checking ...
Really? I did not find anything in the documentation about it. That 
would be very appropriate.

Gruss Christian

In response to

pgsql-novice by date

Next:From: Brandon KaneDate: 2008-02-17 23:05:13
Subject: Query Planner Issue - View and regexp_replace?
Previous:From: Tom LaneDate: 2008-02-17 19:22:50
Subject: Re: Problem while inserting a varchar

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group