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