This file is indexed.

/usr/share/pgmodeler/schemas/catalog/domain.sch is in pgmodeler-common 0.9.1~beta-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Catalog queries for domains
# CAUTION: Do not modify this file unless you know what you are doing.
#          Code generation can be broken if incorrect changes are made.

%if {list} %then
  [SELECT dm.oid, dm.typname AS name FROM pg_type AS dm
    INNER JOIN information_schema.domains AS _dm1 ON dm.typname=_dm1.domain_name
   WHERE dm.typrelid=0 ]

  %if {schema} %then
    [ AND domain_schema=] '{schema}'
  %end

  %if {last-sys-oid} %then
     [ AND dm.oid ] {oid-filter-op} $sp {last-sys-oid}
  %end

  %if {not-ext-object} %then
    [ AND ]( {not-ext-object} )
  %end

%else
    %if {attribs} %then
     [SELECT dm.oid, dm.typname AS name, dm.typowner AS owner, dm.typnamespace AS schema, dm.typndims AS dimension,
	     dm.typbasetype AS type, ]

	#TODO: Discover which field is the acl for domain on PgSQL 9.0 and 9.1
				%if ({pgsql-ver} <=f "9.1") %then
	 [ NULL AS permission, NULL AS collation, ]
	%else
	 [ dm.typacl AS permission, dm.typcollation AS collation, ]
	%end

	[ CASE
	    WHEN _dm1.numeric_precision_radix IS NOT NULL THEN _dm1.numeric_precision_radix
	    ELSE _dm1.character_maximum_length
	  END AS length,

	  CASE
						WHEN _dm1.numeric_precision_radix IS NOT NULL THEN _dm1.numeric_scale ] %if ({pgsql-ver} <=f "9.1") %then [::varchar] %end
				[   WHEN _dm1.datetime_precision IS NOT NULL THEN _dm1.datetime_precision ] %if ({pgsql-ver} <=f "9.1") %then [::varchar] %end
				[   WHEN _dm1.interval_precision IS NOT NULL THEN _dm1.interval_precision ] %if ({pgsql-ver} <=f "9.1") %then [::varchar] %end
	[   ELSE NULL
	 END AS precision,

	  dm.typnotnull AS not_null_bool,
	  _dm1.interval_type, _dm1.domain_default AS default_value,
	  cn.conname AS constraint, cn.consrc AS expression, ]

      ({comment}) [ AS comment ]

      [ FROM pg_type AS dm
	LEFT JOIN pg_constraint AS cn ON cn.contypid=dm.oid
        LEFT JOIN information_schema.domains AS _dm1 ON dm.typname=_dm1.domain_name
        WHERE dm.typrelid=0 ]

      %if {filter-oids} %or {schema} %then
        [ AND ]
	%if {filter-oids} %then
          [  dm.oid IN (] {filter-oids} )

	   %if {schema} %then
	     [ AND ]
	   %end
	 %end

	 %if {schema} %then
	  [ _dm1.domain_schema= ] '{schema}'
	 %end
      %end

      %if {last-sys-oid} %then
        [ AND dm.oid ] {oid-filter-op} $sp {last-sys-oid}
      %end

      %if {not-ext-object} %then
        [ AND ]( {not-ext-object} )
      %end
    %end
%end