Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts/get-external-data.py does not work with psycopg2 2.9.1 #4447

Closed
cbluoss opened this issue Aug 3, 2021 · 1 comment · Fixed by #4451
Closed

scripts/get-external-data.py does not work with psycopg2 2.9.1 #4447

cbluoss opened this issue Aug 3, 2021 · 1 comment · Fixed by #4451
Labels

Comments

@cbluoss
Copy link

cbluoss commented Aug 3, 2021

Expected behavior

Script runs smoothly as expected (and how it did with psycopg2==2.8.6)

Actual behavior

Script crashes

INFO:root:Checking table simplified_water_polygons
Traceback (most recent call last):
  File "scripts/get-external-data.py.1", line 108, in index
    cur.execute('''VACUUM ANALYZE "{temp_schema}"."{name}";'''
psycopg2.errors.ActiveSqlTransaction: VACUUM cannot run inside a transaction block


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "scripts/get-external-data.py.1", line 294, in <module>
    main()
  File "scripts/get-external-data.py.1", line 284, in main
    this_table.index()
  File "scripts/get-external-data.py.1", line 111, in index
    self._conn.autocommit = old_autocommit
psycopg2.ProgrammingError: set_session cannot be used inside a transaction
@mboeringa
Copy link

mboeringa commented Aug 3, 2021

May be related to this issue and the associated changes in psycopg2 v2.9.0:

psycopg/psycopg2#941

See the first point in the release notes of 2.9.0:

https://github.com/psycopg/psycopg2/releases/tag/2_9

It seems quite a few more projects have issues with this change in psycopg2.

@pnorman pnorman added the bug label Aug 3, 2021
frankdean added a commit to frankdean/openstreetmap-carto that referenced this issue Aug 23, 2021
Fixes gravitystorm#4447

Tested against psycopg2 verions 2.8.6 and 2.9.1
frankdean added a commit to frankdean/openstreetmap-carto that referenced this issue Aug 23, 2021
Fixes gravitystorm#4447

Tested against psycopg2 versions 2.8.6 and 2.9.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants