New user questions

2021-07-13 Thread Rich Shepard
I'm starting to learn psycopg2 and have read the basic module usage doc. Two questions on syntax: 1) I've seen a number of psycopg2 cursor execute examples where the select or insert statement is enclosed in a pydoc pair of three double quotes. Most examples in the basic module usage examples hav

Re: New user questions

2021-07-13 Thread Rich Shepard
On Tue, 13 Jul 2021, Adrian Klaver wrote: Triple quoting is used when the statement extends across more then one line. Pair of double quotes is used for single line statement, especially when there are single quoted values in the statement. Adrian, That makes sense: the statements are treated

Re: New user questions

2021-07-14 Thread Rich Shepard
On Tue, 13 Jul 2021, Adrian Klaver wrote: Then you want to take a look at this: https://www.psycopg.org/docs/sql.html Adrian, Based on pages 1-2 of that doc I've re-written one each of an insert and select query. When they are correct I'll do the rest of the insert and select queries. Query

Re: New user questions

2021-07-14 Thread Rich Shepard
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 rea

RE: New user questions

2021-07-14 Thread Rich Shepard
On Wed, 14 Jul 2021, David Raymond wrote: "The module contains objects and functions useful to generate SQL dynamically, in a convenient and safe way." David, There are many examples in the doc and I'm just learning which is appropriate for each of my queries. If there's nothing dynamic abo

cur.execute() syntax error

2022-04-04 Thread Rich Shepard
This MWE (test_combobox.py) produces a syntax error and I'm not seeing why: - import tkinter as tk from tkinter import ttk import psycopg2 class ContactDataForm(tk.Frame): # set up postgres # the connection con = psycopg2.connect(database='bustrac') # the cursor cur = con

Re: cur.execute() syntax error [RESOLVED]

2022-04-04 Thread Rich Shepard
On Mon, 4 Apr 2022, Christophe Pettus wrote: It looks like the LabelInput constructor includes some code. Did you mean something like: self.inputs['Contact Type'] = LabelInput( ContactDataForm, 'contact_type',) # query to fetch data from contacttypes table fetch_al

Re: Psycopg 2.8.1, 2.8.2 released

2019-04-14 Thread Rich Shepard
On Sun, Apr 14, 2019 at 06:42:26PM +0100, Daniele Varrazzo wrote: We have just released Psycopg 2.8.2; a few days ago Psycopg 2.8.1 was released. Daniele, 2.8.2 is not yet available on the web site, only 2.8.1. I'll try later today. Regards, Rich

Re: Psycopg 2.8.1, 2.8.2 released

2019-04-14 Thread Rich Shepard
On Sun, 14 Apr 2019, Rich Shepard wrote: 2.8.2 is not yet available on the web site, only 2.8.1. I'll try later today. Later has arrived. :-) Thanks! Rich