Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wu26t-0005K6-Di for pgsql-sql@arkaria.postgresql.org; Mon, 09 Jun 2014 16:07:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wu26s-0004oK-SP for pgsql-sql@arkaria.postgresql.org; Mon, 09 Jun 2014 16:07:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Wu26r-0004lq-3k for pgsql-sql@postgresql.org; Mon, 09 Jun 2014 16:07:45 +0000 Received: from mail-ig0-x231.google.com ([2607:f8b0:4001:c05::231]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Wu26m-0004JB-ST for pgsql-sql@postgresql.org; Mon, 09 Jun 2014 16:07:43 +0000 Received: by mail-ig0-f177.google.com with SMTP id l13so4016293iga.4 for ; Mon, 09 Jun 2014 09:07:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=Dc01kW2SCH0sajtFVONu0zYdeNZp+aKM2jnmNYFWx9Q=; b=CsBB7iYklhfrFkmPenVALaJ5+k0/E6pOWtW10yxmNdHHKN7Fior0rf6upv68cTeaYN SfquPwOlVlP1KnRo/t+7tZoTJf0w8vYuqsngvoASFWWIwviC8LtoZ5UmEhTMph/1HivG hnz3socj+erlTilG09d9EJv5MqB6W5Ay+IpMXST+/sXfbIKt27z0rJkVaOGS8riwbOw5 /V8PntOna80sPghSGGhdc0KtH930j3O3TcXfDxys8IXuU7FaEiqvF1t9zciieBHzHnIF qeGXJEtsqeOC8+kxfnGN5izHTTnMBEI80piRY3faZV1r8rsG9L4A8LeSHRAy+InqW+2p fu7Q== X-Received: by 10.50.253.163 with SMTP id ab3mr38724856igd.35.1402330058338; Mon, 09 Jun 2014 09:07:38 -0700 (PDT) Received: from stability.med.utah.edu (stability.med.utah.edu. [155.100.158.97]) by mx.google.com with ESMTPSA id vl10sm16149566igb.16.2014.06.09.09.07.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Jun 2014 09:07:37 -0700 (PDT) Message-ID: <5395DBC7.9050506@gmail.com> Date: Mon, 09 Jun 2014 10:07:35 -0600 From: Rob Sargent User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: Problem with strange chars in text filed. References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------040903030508090100050502" X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org This is a multi-part message in MIME format. --------------040903030508090100050502 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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? --------------040903030508090100050502 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
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?

--------------040903030508090100050502--