我正在将一个数据库从SQL Server移植到PostgreSQL。在PostgreSQL中有没有sysobjects的替代品?如果是,那么它是什么,如何使用它?
我的观点是:
create view int_objects_v as
select
io.*, soae."REQ_TYPE_NAME", soae."REQ_TABLE_NAME",
stc1."CODE_DESC" int_type_name, stc2."CODE_DESC" operation_type_name,
s."NAME" target_obj_name
from
int_objects io
left join
req_request_types_v soae on soae."ID" = io."SOURCE_OBJ_ID"
left join
std_type_codes_v stc1 on (stc1."CODE" = io."INT_TYPE"
and stc1."TYPE" = 'intr_type')
left join
std_type_codes_v stc2 on (stc2."CODE" = io."OPERATION_TYPE"
and stc2."TYPE" = 'opr_type')
left join
sysobjects s on (s."ID" = io."TARGET_OBJ_ID")
where
io."ACTIVE_FLAG" = '1';发布于 2012-10-23 14:27:50
PostgreSQL supports the SQL-standard information_schema.
MSSQL也是如此,但它也支持与information_schema相当的旧版本sysobjects。
如果您找到了一种使用information_schema术语重写查询的方法,那么一切都准备好了。
https://stackoverflow.com/questions/13024539
复制相似问题