We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f807f1e commit ca09441Copy full SHA for ca09441
src/cs50/sql.py
@@ -370,7 +370,7 @@ def teardown_appcontext(exception):
370
# "(psycopg2.errors.ObjectNotInPrerequisiteState) lastval is not yet defined in this session",
371
# a la https://stackoverflow.com/a/24186770/5156190;
372
# cf. https://www.psycopg.org/docs/errors.html re 55000
373
- result = connection.execute("""
+ result = connection.execute(sqlalchemy.text("""
374
CREATE OR REPLACE FUNCTION _LASTVAL()
375
RETURNS integer LANGUAGE plpgsql
376
AS $$
@@ -382,7 +382,7 @@ def teardown_appcontext(exception):
382
END;
383
END $$;
384
SELECT _LASTVAL();
385
- """)
+ """))
386
ret = result.first()[0]
387
388
# If not PostgreSQL
0 commit comments