Re: VARCHAR versus TEXT when using psychopg2, sqlalchemy and redshift - Mailing list psycopg

From Christopher Brooks
Subject Re: VARCHAR versus TEXT when using psychopg2, sqlalchemy and redshift
Date
Msg-id CAJQ6OJOjfq=MjMhOxkTqjTKxQ5cL_NRQ8Pu9RdoD7a_QYw5C8w@mail.gmail.com
Whole thread Raw
In response to Re: VARCHAR versus TEXT when using psychopg2, sqlalchemy and redshift  (Christophe Pettus <xof@thebuild.com>)
Responses Re: VARCHAR versus TEXT when using psychopg2, sqlalchemy and redshift
List psycopg
Yes, this is what I was aiming to do.  Maybe I've got the sql alchemy syntax wrong?  I though insert().values took in iterables for row by row inserts...

Chris

On Sun, Aug 30, 2015 at 3:01 PM, Christophe Pettus <xof@thebuild.com> wrote:

On Aug 30, 2015, at 11:59 AM, Christopher Brooks <brooksch@umich.edu> wrote:
>  [SQL: 'INSERT INTO qualtrics_dim (k, v) VALUES (%(k)s, %(v)s)'] [parameters: {'v': ['aa', 'bb'], 'k': ['a', 'b']}]

The values you've written there are two arrays of TEXT values, but the columns aren't declared as TEXT or VARCHAR arrays, but as single VARCHAR values.  Are you trying to insert two rows of the form 'aa', 'a' and 'bb', 'b'?

--
-- Christophe Pettus
   xof@thebuild.com




--
Christopher Brooks, PhD
Research Fellow


Mail:School of Information
University of Michigan
4322 North Quad
105 S. State St.
Ann Arbor, MI 48109-1285

psycopg by date:

Previous
From: Christophe Pettus
Date:
Subject: Re: VARCHAR versus TEXT when using psychopg2, sqlalchemy and redshift
Next
From: Adrian Klaver
Date:
Subject: Re: VARCHAR versus TEXT when using psychopg2, sqlalchemy and redshift