在Postgresql 8.1.23中,我想知道我的表所依赖的对象。
我做了:
SELECT * FROM pg_depend WHERE objid=
(SELECT oid FROM pg_class WHERE relname = 'prix_articleclient');
classid | objid | objsubid | refclassid | refobjid | refobjsubid | deptype
---------+---------+----------+------------+----------+-------------+---------
1259 | 5877366 | 0 | 2615 | 24605 | 0 | n
我的问题是:对象是什么 24605'? 我搜索了几十个表,网页,论坛,包括stackoverflow,但是找不到任何帮助。
因此,非常感谢任何帮助。
P.S。请注意,我试过" \ d + your_table"和" Find dependent objects for a table or view"没有成功
P.P.S。我也试过了,但它似乎无处可去:
# SELECT * FROM pg_class WHERE oid = 2615 ;
relname | relnamespace | reltype | relowner | relam | relfilenode | reltablespace | relpages | reltuples | reltoastrelid | reltoastidxid | relhasindex | relisshared | relkind | relnatts | relchecks | reltriggers | relukeys | relfkeys | relrefs | relhasoids | relhaspkey | relhasrules | relhassubclass | relacl
pg_namespace | 11 | 10275 | 10 | 0 | 2615 | 0 | 1 | 5 | 0 | 0 | t | f | r | 3 | 0 | 0 | 0 | 0 | 0 | t | f | f | f | {=r/postgres}
# SELECT * FROM pg_type WHERE oid=10275;
typname | typnamespace | typowner | typlen | typbyval | typtype | typisdefined | typdelim | typrelid | typelem | typinput | typoutput | typreceive | typsend | typanalyze | typalign | typstorage | typnotnull | typbasetype | typtypmod | typndims | typdefaultbin | typdefault
pg_namespace | 11 | 10 | -1 | f | c | t | , | 2615 | 0 | record_in | record_out | record_recv | record_send | - | d | x | f | 0 | -1 | 0 | |
P.P.P.S。正如Erwin Brandstetter所说:
SELECT *, refclassid::regclass AS referenced_class FROM pg_depend
WHERE objid = 'prix_articleclient'::regclass;"
给出了这个结果:
classid | objid | objsubid | refclassid | refobjid | refobjsubid | deptype | referenced_class
---------+---------+----------+------------+----------+-------------+---------+------------------
1259 | 5877366 | 0 | 2615 | 24605 | 0 | n | pg_namespace
然后:
SELECT * FROM pg_namespace WHERE oid = 24605;
...返回架构。
这意味着这种依赖是架构。
答案 0 :(得分:1)
refobjid oid任何OID列特定引用对象的OID
你必须在组合中解释:
refclassid oid pg_class.oid系统目录的OID 引用的对象在
中
找出相关内容的快捷方式是转换为regclass
:
SELECT *, refclassid::regclass AS referenced_class
FROM pg_depend
WHERE objid = 'prix_articleclient'::regclass
基础problem described to your link可能是各个列的序列不是所拥有的。更多细节:
但为什么要打死马呢? PostgreSQL 8.1 is just too old. EOL 2010. Upgrade to a current version.