CREATE OR REPLACE FORCE VIEW "PLANTA_PKS" ("TABLE_ID", "R_TABLE_ID", "RELATION", "RECURSION", "NAME", "FIRST_KEY_DI", "LAST_KEY_DI", "FIRST_DB_POS", "LAST_DB_POS") AS 
select "TABLE_ID","R_TABLE_ID","RELATION","RECURSION","NAME","FIRST_KEY_DI","LAST_KEY_DI","FIRST_DB_POS","LAST_DB_POS" from planta_relations r
where ( -- PK by definition:
	r.r_table_id = r.table_id
	and r.relation = '1:1'
	and r.recursion = '0'
)
order by r.table_id, r.r_table_id, r.first_key_di;/
