`
postgres=# select oid from pg_class where relname=:'tablename';
oid
-------
24678
(1 row)
以下是我失败的几个尝试:
postgres=# select oid into partition_table_id from pg_class where relname=:'tablename';
ERROR: There is no hash distributable column
postgres=# select oid from pg_class where relname=:'tablename' into partition_table_id;
ERROR: syntax error at or near "into"
LINE 1: ...t oid from pg_class where relname='table_level_1' into parti...
`
手头没 pg 库,没执行,大概意思理解一下。
P.S.
variable_col
是变量名,我瞎起的;int
记得改成你那个oid
的数据类型。