pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedInsert strings that contain colons into a table
3+ messages / 2 participants
[nested] [flat]
* Insert strings that contain colons into a table
@ 2012-10-19 20:24 lmagnell <lmagnell@egenera.com>
0 siblings, 1 reply; 3+ messages in thread
From: lmagnell @ 2012-10-19 20:24 UTC (permalink / raw)
To: pgsql-sql
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
--
View this message in context: http://postgresql.1045698.n5.nabble.com/Insert-strings-that-contain-colons-into-a-table-tp5729104.ht...
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Insert strings that contain colons into a table
@ 2012-10-19 20:34 David Johnston <polobo@yahoo.com>
parent: lmagnell <lmagnell@egenera.com>
0 siblings, 1 reply; 3+ messages in thread
From: David Johnston @ 2012-10-19 20:34 UTC (permalink / raw)
To: 'lmagnell' <lmagnell@egenera.com>; 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.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Insert strings that contain colons into a table
@ 2012-10-19 20:49 lmagnell <lmagnell@egenera.com>
parent: David Johnston <polobo@yahoo.com>
0 siblings, 0 replies; 3+ messages in thread
From: lmagnell @ 2012-10-19 20:49 UTC (permalink / raw)
To: pgsql-sql
Thank you, that is the problem. That column should not have been created as an ARRAY type.
Lance
From: David Johnston [via PostgreSQL] [mailto:ml-node+s1045698n5729107h79@n5.nabble.com]
Sent: Friday, October 19, 2012 4:36 PM
To: Lance Magnell
Subject: Re: Insert strings that contain colons into a table
> -----Original Message-----
> From: [hidden email]</user/SendEmail.jtp?type=node&node=5729107&i=0> [mailto:pgsql-sql-
> [hidden email]</user/SendEmail.jtp?type=node&node=5729107&i=1>] On Behalf Of lmagnell
> Sent: Friday, October 19, 2012 4:25 PM
> To: [hidden email]</user/SendEmail.jtp?type=node&node=5729107&i=2>
> 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.
--
Sent via pgsql-sql mailing list ([hidden email]</user/SendEmail.jtp?type=node&node=5729107&i=3>)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
________________________________
If you reply to this email, your message will be added to the discussion below:
http://postgresql.1045698.n5.nabble.com/Insert-strings-that-contain-colons-into-a-table-tp5729104p57...
To unsubscribe from Insert strings that contain colons into a table, click here<http://postgresql.1045698.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=...;.
NAML<http://postgresql.1045698.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_h...;
--
View this message in context: http://postgresql.1045698.n5.nabble.com/Insert-strings-that-contain-colons-into-a-table-tp5729104p57...
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2012-10-19 20:49 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-10-19 20:24 Insert strings that contain colons into a table lmagnell <lmagnell@egenera.com>
2012-10-19 20:34 ` David Johnston <polobo@yahoo.com>
2012-10-19 20:49 ` lmagnell <lmagnell@egenera.com>
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