Re: Insert strings that contain colons into a table - Mailing list pgsql-sql

From David Johnston
Subject Re: Insert strings that contain colons into a table
Date
Msg-id 035601cdae39$1deef1a0$59ccd4e0$@yahoo.com
Whole thread Raw
In response to Insert strings that contain colons into a table  (lmagnell <lmagnell@egenera.com>)
Responses Re: Insert strings that contain colons into a table
List pgsql-sql
> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-
> owner@postgresql.org] On Behalf Of lmagnell
> Sent: Friday, October 19, 2012 4:25 PM
> To: pgsql-sql@postgresql.org
> Subject: [SQL] Insert strings that contain colons into a table
> 
> How can I insert multiple strings into a table where the strings contain
colons.
> This case fails:
> 
>  INSERT INTO wwn (wwn_start,wwn_end) VALUES
> ('50:06:0B:00:00:C2:86:80','50:06:0B:00:00:C2:86:83');
> ERROR:  array value must start with "{" or dimension information at
character
> 71 LINE 1: ..._start,wwn_end) VALUES
('50:06:0B:00:00:C2:86:80','50:06:0B:...
> 
> But this case passes:
> 
> INSERT INTO wwn (wwn_start) VALUES ('50:06:0B:00:00:C2:86:80');
> 
> Thank you,
> Lance
> 

The "colon" has nothing to do with it.

It appears that "wwn_end" is defined as an array and not a simple text
value.

You need to provide the table definition for "wwn".

This is a section in the documentation regarding arrays but I am guessing
the use of an array in this situation is a mistake.

http://www.postgresql.org/docs/9.0/interactive/arrays.html

David J.





pgsql-sql by date:

Previous
From: lmagnell
Date:
Subject: Insert strings that contain colons into a table
Next
From: lmagnell
Date:
Subject: Re: Insert strings that contain colons into a table