pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Johnston <polobo@yahoo.com>
To: 'lmagnell' <lmagnell@egenera.com>
To: pgsql-sql@postgresql.org
Subject: Re: Insert strings that contain colons into a table
Date: Fri, 19 Oct 2012 16:34:19 -0400
Message-ID: <035601cdae39$1deef1a0$59ccd4e0$@yahoo.com> (raw)
In-Reply-To: <1350678292407-5729104.post@n5.nabble.com>
References: <1350678292407-5729104.post@n5.nabble.com>

> -----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.






view thread (3+ messages)  latest in thread

Message-ID: <035601cdae39$1deef1a0$59ccd4e0$@yahoo.com>
Permalink:  ../035601cdae39$1deef1a0$59ccd4e0$@yahoo.com/
Also on:    postgresql.org/message-id/035601cdae39$1deef1a0$59ccd4e0$@yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: polobo@yahoo.com, lmagnell@egenera.com
  Subject: Re: Insert strings that contain colons into a table
  In-Reply-To: <035601cdae39$1deef1a0$59ccd4e0$@yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox