Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
沈秋雨
/
lyric_rhyme
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
f1966167
...
f1966167b2c5b0def51a3ef25cbd2aced17317f5
authored
2026-06-18 13:19:36 +0800
by
沈秋雨
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: set UTF8 client encoding for schema init
1 parent
2521ad87
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
scripts/local/init_postgres.py
scripts/local/init_postgres.py
View file @
f196616
...
...
@@ -19,10 +19,9 @@ def main() -> None:
psycopg
=
_import_psycopg
()
schema_sql
=
Path
(
args
.
schema
)
.
read_text
(
encoding
=
"utf-8"
)
with
psycopg
.
connect
(
args
.
dsn
)
as
conn
:
with
conn
.
cursor
()
as
cursor
:
cursor
.
execute
(
schema_sql
)
conn
.
commit
()
with
psycopg
.
connect
(
args
.
dsn
,
autocommit
=
True
)
as
conn
:
conn
.
execute
(
"SET client_encoding = 'UTF8'"
)
conn
.
execute
(
schema_sql
)
print
(
f
"initialized schema from {args.schema}"
)
...
...
Please
register
or
sign in
to post a comment