Re: Insert strings that contain colons into a table

From: "David Johnston" <polobo(at)yahoo(dot)com>
To: "'lmagnell'" <lmagnell(at)egenera(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Insert strings that contain colons into a table
Date: 2012-10-19 20:34:19
Message-ID: 035601cdae39$1deef1a0$59ccd4e0$@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> -----Original Message-----
> From: pgsql-sql-owner(at)postgresql(dot)org [mailto:pgsql-sql-
> owner(at)postgresql(dot)org] On Behalf Of lmagnell
> Sent: Friday, October 19, 2012 4:25 PM
> To: pgsql-sql(at)postgresql(dot)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.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message lmagnell 2012-10-19 20:49:43 Re: Insert strings that contain colons into a table
Previous Message lmagnell 2012-10-19 20:24:52 Insert strings that contain colons into a table