我正在将数据库从 SQL Server 移植到 PostgreSQL。sysobjects
在 PostgreSQL 中有什么替代方法吗?如果是这样,那么它是什么以及如何使用它?
我的观点:
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';