Fwd: Problem with strange chars in text filed. - Mailing list pgsql-sql

From Bruce
Subject Fwd: Problem with strange chars in text filed.
Date
Msg-id CADzTWJ=qmh4XiLPCzfyozhUVJtgrBAZPc1h3Hf2aW-Z8qp+WsA@mail.gmail.com
Whole thread Raw
In response to Problem with strange chars in text filed.  (Bruce <okbishop@gmail.com>)
List pgsql-sql
That's probably it.  Let me see if I can do the insert another way.



---------- Forwarded message ----------
From: Rob Sargent <robjsargent@gmail.com>
Date: Mon, Jun 9, 2014 at 12:02 PM
Subject: Re: [SQL] Problem with strange chars in text filed.
To: Bruce <okbishop@gmail.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@gmail.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?




pgsql-sql by date:

Previous
From: Rob Sargent
Date:
Subject: Re: Problem with strange chars in text filed.
Next
From: Adrian Klaver
Date:
Subject: Re: Problem with strange chars in text filed.