From: | lmagnell <lmagnell(at)egenera(dot)com> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Insert strings that contain colons into a table |
Date: | 2012-10-19 20:49:43 |
Message-ID: | 59840952ADE62A4D8003F316611CE8592D889321@MBX243.domain.local |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)n5(dot)nabble(dot)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-tp5729104p5729107.html
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=5729104&code=bG1hZ25lbGxAZWdlbmVyYS5jb218NTcyOTEwNHw0Nzg3OTcyMTg=>.
NAML<http://postgresql.1045698.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
--
View this message in context: http://postgresql.1045698.n5.nabble.com/Insert-strings-that-contain-colons-into-a-table-tp5729104p5729110.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
From | Date | Subject | |
---|---|---|---|
Next Message | Brice André | 2012-10-21 19:18:14 | Partition database between users and implement disk quotas |
Previous Message | David Johnston | 2012-10-19 20:34:19 | Re: Insert strings that contain colons into a table |