File: orafce--3.8--3.9.sql

package info (click to toggle)
orafce 4.16.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 2,856 kB
  • sloc: ansic: 12,643; sql: 8,984; lex: 1,049; makefile: 131; yacc: 82; python: 7; sh: 2
file content (13 lines) | stat: -rw-r--r-- 633 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
drop view oracle.user_constraints;

create view oracle.user_constraints as
    select conname as constraint_name,
           conindid::regclass as index_name,
           case contype when 'p' then 'P' when 'f' then 'R' end as constraint_type,
           conrelid::regclass as table_name,
           case contype when 'f' then (select conname
                                         from pg_constraint c2
                                        where contype = 'p' and c2.conindid = c1.conindid)
                                      end as r_constraint_name
      from pg_constraint c1, pg_class
     where conrelid = pg_class.oid;