Created
August 30, 2021 17:37
-
-
Save Megaprog/0ff391cddafdca5b799aef6ef4647fa5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psycopg2.extras | |
# del os.environ["PGTZ"] | |
# os.environ["PGTZ"]="UTC" | |
# os.environ["PGTZ"]="Europe/Moscow" | |
conn = psycopg2.connect( | |
# host="postgres-corecms-slave.spb.play.dc", | |
host="postgres-context-slave.spb.play.dc", | |
port=5433, | |
dbname="context", | |
user="", | |
password="", | |
options="-c TimeZone=UTC" | |
# cursor_factory=psycopg2.extras.DictCursor, | |
# cursor_factory=psycopg2.extras.NamedTupleCursor, | |
) | |
cur = conn.cursor() | |
cur.execute("show timezone") | |
it = iter(cur) | |
print(next(it)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment