Re: New user questions - Mailing list psycopg

From Adrian Klaver
Subject Re: New user questions
Date
Msg-id 5ac3e912-13e7-ced4-9925-be649c240d1b@aklaver.com
Whole thread Raw
In response to Re: New user questions  (Adrian Klaver <adrian.klaver@aklaver.com>)
List psycopg
On 7/14/21 10:57 AM, Adrian Klaver wrote:
> On 7/14/21 10:35 AM, Rich Shepard wrote:

> This will not work, if for no other reason that 'companies as c on 
> c.org_nbr = p.org_nbr', etc are not identifiers and it is sql.Identifier.
> 
> Also it would be simpler for this case just to create a quoted 
> statement, something like:
> """SELECT
>     fld_1, fld_2, fld_3
> FROM
>     some_table AS st
> JOIN
>     another_table AS a
> ON
>      st.id = a.a_id
> WHERE
>      st.fld_1 = 'something'
> """

That should have been:

    st.fld_1 = %s


-- 
Adrian Klaver
adrian.klaver@aklaver.com



psycopg by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: New user questions
Next
From: David Raymond
Date:
Subject: RE: New user questions