Re: New user questions - Mailing list psycopg

From Rich Shepard
Subject Re: New user questions
Date
Msg-id alpine.LNX.2.20.2107141408210.28523@salmo.appl-ecosys.com
Whole thread Raw
In response to Re: New user questions  (Adrian Klaver <adrian.klaver@aklaver.com>)
List psycopg
On Wed, 14 Jul 2021, Adrian Klaver wrote:

> Where are c.nbr and a.* coming from? If they are supposed to be table
> qualified values this will not work.

Adrian,

From the psql shell version.

> Also it is sql.Identifier.

Thanks; I certainly missed that.

> 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'
> """

Got it, thanks.

Sorting out the proper format for my queries will take a bit of time. You've
helped shorten the time frame.

Regards,

Rich



psycopg by date:

Previous
From: David Raymond
Date:
Subject: RE: New user questions
Next
From: Rich Shepard
Date:
Subject: RE: New user questions