2020-08-21 00:15:51 +02:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
|
|
import psycopg2
|
|
|
|
|
|
|
|
db = psycopg2.connect("")
|
|
|
|
|
|
|
|
csr = db.cursor()
|
2020-08-21 00:24:26 +02:00
|
|
|
csr.execute("select version()")
|
|
|
|
for r in csr:
|
|
|
|
print(r[0])
|
2020-08-21 00:15:51 +02:00
|
|
|
csr.execute("drop table if exists t_pgcollate")
|
|
|
|
csr.execute("create table t_pgcollate(t text)")
|
|
|
|
for c in range(1, 0xD800):
|
|
|
|
csr.execute("insert into t_pgcollate(t) values(%s)", (chr(c),))
|
|
|
|
for c in range(0xE000, 0x110000):
|
|
|
|
csr.execute("insert into t_pgcollate(t) values(%s)", (chr(c),))
|
|
|
|
db.commit()
|
|
|
|
csr.execute("select * from t_pgcollate order by t")
|
|
|
|
for r in csr:
|
|
|
|
print(r)
|