我有一个本地postgres数据库。我正在尝试使用connection.execute
运行简单的comment on命令。例如,
import sqlalchemy as sa
db_url = DB_URL
db_engine = sa.create_engine(db_url)
conn = db_engine.connect()
conn.execute('create schema test')
conn.execute('create table test.testing as (select 1 as value)')
conn.execute("comment on table test.testing is 'this is my table'")
这实际上会在我的本地数据库中创建一个表test.testing
,但是当我运行以下内容时:
select *
from pg_description
join pg_class
on pg_description.objoid = pg_class.oid
join pg_namespace
on pg_class.relnamespace = pg_namespace.oid
where pg_namespace.nspname = 'test'
and pg_class.relname = 'testing'
实际上没有返回任何行。