From: | Bruce <okbishop(at)gmail(dot)com> |
---|---|
To: | pgsql-sql <pgsql-sql(at)postgresql(dot)org> |
Subject: | Fwd: Problem with strange chars in text filed. |
Date: | 2014-06-09 17:59:46 |
Message-ID: | CADzTWJ=qmh4XiLPCzfyozhUVJtgrBAZPc1h3Hf2aW-Z8qp+WsA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
That's probably it. Let me see if I can do the insert another way.
---------- Forwarded message ----------
From: Rob Sargent <robjsargent(at)gmail(dot)com>
Date: Mon, Jun 9, 2014 at 12:02 PM
Subject: Re: [SQL] Problem with strange chars in text filed.
To: Bruce <okbishop(at)gmail(dot)com>
Well {" is the array printing syntax for pg.
What language are you using? If it's python, it looks like you're making a
list/array with "[meme]"
Note. I top-posted here because this is off list. Best to stick with the
list so everyone is up-to-date, and there top-posting is frowned upon
(seriously so)
On 06/09/2014 10:57 AM, Bruce wrote:
That was in the example I had. Do you think it's what's causing the {" in
the table?
On Mon, Jun 9, 2014 at 11:07 AM, Rob Sargent <robjsargent(at)gmail(dot)com> wrote:
> On 06/09/2014 10:02 AM, Bruce wrote:
>
> I have a table:
> create table truck (name varchar(45),address varchar(150));
>
> doing an insert:
> for i in range (0,10):
> meme = fake.name()
> address = fake.address()
> print (meme,address)
> cur.execute("INSERT INTO TRUCK2 VALUES (%s, %s)", ([meme], [address]))
> conn.commit()
>
> Heres what the data looks like:
>
> xcv=# select * from truck2;
> name | address
> -----------------------+------------------------------------
> {"Hana Mosciski"} | {"9597 Rosalia Rue +
> | South Rossie, AS 22326"}
> {"Paisley Miller"} | {"588 Lorin Vista +
> | Merlinville, NY 79007"}
>
> Whats up with the {" on each line.
>
> Help
>
> What's up with the '[' deref. in the execute?
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Adrian Klaver | 2014-06-09 23:06:46 | Re: Problem with strange chars in text filed. |
Previous Message | Rob Sargent | 2014-06-09 16:07:35 | Re: Problem with strange chars in text filed. |