This file is indexed.

/usr/share/pgmodeler/samples/demo.dbm 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
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
<?xml version="1.0" encoding="UTF-8"?>
<!--
CAUTION: Do not modify this file unless you know what you are doing.
         Unexpected results may occur if the code is changed deliberately.
-->
<dbmodel pgmodeler-ver="0.9.0" last-position="99,0" last-zoom="1"
	 default-schema="public" default-owner="postgres">
<database name="demodb">
</database>

<tag name="red_tables">
	<style id="table-body" colors="#fcfcfc,#fcfcfc,#808080"/>
	<style id="table-ext-body" colors="#fcfcfc,#fcfcfc,#808080"/>
	<style id="table-name" colors="#ffffff"/>
	<style id="table-schema-name" colors="#ffffff"/>
	<style id="table-title" colors="#ff0000,#aa0000,#710000"/>
</tag>
<schema name="public" rect-visible="true" fill-color="#6abdb2" sql-disabled="true">
</schema>

<schema name="schema_a" rect-visible="true" fill-color="#df83eb">
	<role name="postgres"/>
</schema>

<schema name="schema_b" rect-visible="true" fill-color="#fbe97f">
	<role name="postgres"/>
</schema>

<table name="table_a">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="160" y="500"/>
	<column name="id_a" not-null="true">
		<type name="serial" length="1"/>
	</column>
	<column name="name">
		<type name="varchar" length="200"/>
	</column>
	<constraint name="table_a_pk" type="pk-constr" table="public.table_a">
		<columns names="id_a" ref-type="src-columns"/>
	</constraint>
	<constraint name="table_a_uq" type="uq-constr" table="public.table_a">
		<columns names="name" ref-type="src-columns"/>
	</constraint>
</table>

<table name="table_b">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="400" y="640"/>
	<column name="id_b" not-null="true">
		<type name="serial" length="1"/>
	</column>
	<column name="sku" not-null="true">
		<type name="integer" length="1"/>
	</column>
	<constraint name="table_b_pk" type="pk-constr" table="public.table_b">
		<columns names="id_b" ref-type="src-columns"/>
	</constraint>
</table>

<domain name="email" not-null="true">
	<schema name="public"/>
	<role name="postgres"/>
		<type name="varchar" length="256"/>
</domain>

<table name="table_f">
	<schema name="schema_a"/>
	<role name="postgres"/>
	<position x="820" y="1026"/>
	<column name="id_f" not-null="true">
		<type name="bigserial" length="1"/>
	</column>
	<constraint name="table_f_pk" type="pk-constr" table="schema_a.table_f">
		<columns names="id_f" ref-type="src-columns"/>
	</constraint>
</table>

<table name="table_c">
	<schema name="public"/>
	<role name="postgres"/>
	<position x="140" y="720"/>
	<column name="id_c" not-null="true">
		<type name="serial" length="1"/>
	</column>
	<column name="name">
		<type name="varchar" length="200"/>
	</column>
	<column name="date">
		<type name="date" length="1"/>
	</column>
	<column name="email">
		<type name="public.email" length="1"/>
	</column>
	<constraint name="table_c_pk" type="pk-constr" table="public.table_c">
		<columns names="id_c" ref-type="src-columns"/>
	</constraint>
</table>

<table name="table_d">
	<schema name="schema_a"/>
	<role name="postgres"/>
	<position x="1160" y="426"/>
</table>

<table name="table_h">
	<schema name="schema_a"/>
	<role name="postgres"/>
	<position x="1200" y="686"/>
	<column name="id_h" not-null="true">
		<type name="serial" length="1"/>
	</column>
	<column name="table_a_id">
		<type name="integer" length="1"/>
	</column>
	<column name="table_e_id">
		<type name="integer" length="1"/>
	</column>
	<column name="table_f_id">
		<type name="integer" length="1"/>
	</column>
	<constraint name="table_h_pk" type="pk-constr" table="schema_a.table_h">
		<columns names="id_h" ref-type="src-columns"/>
	</constraint>
</table>

<table name="table_g">
	<schema name="schema_b"/>
	<role name="postgres"/>
	<tag name="red_tables"/>
	<position x="160" y="260"/>
</table>

<relationship name="table_a_has_many_table_d" type="rel1n"
	 src-col-pattern="{sc}_{st}"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 custom-color="#678013"
	 src-table="public.table_a"
	 dst-table="schema_a.table_d"
	 src-required="true" dst-required="false"
	 identifier="true"
>
	<label ref-type="src-label">
		<position x="15.01" y="-12.2"/>
	</label>
	<label ref-type="name-label">
		<position x="-8.98035" y="-51.1607"/>
	</label>
	<column name="test_attrib" not-null="true">
		<type name="smallint" length="1"/>
	</column>
</relationship>

<relationship name="table_g_copies_table_a" type="reldep"
	 pk-pattern="{dt}_pk"
	 custom-color="#145d49"
	 src-table="schema_b.table_g"
	 dst-table="public.table_a">
	<special-pk-cols indexes="0"/>
</relationship>

<relationship name="table_b_has_many_table_d" type="rel1n"
	 src-col-pattern="{sc}_{st}"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 custom-color="#fe0300"
	 src-table="public.table_b"
	 dst-table="schema_a.table_d"
	 src-required="true" dst-required="false">
	<label ref-type="name-label">
		<position x="98.5197" y="-25.1606"/>
	</label>
</relationship>

<table name="table_e">
	<schema name="schema_a"/>
	<role name="postgres"/>
	<position x="820" y="766"/>
</table>

<relationship name="table_f_has_many_table_c" type="rel1n"
	 src-col-pattern="{sc}_{st}"
	 pk-pattern="{dt}_pk" uq-pattern="{dt}_uq"
	 src-fk-pattern="{st}_fk"
	 custom-color="#456796"
	 src-table="schema_a.table_f"
	 dst-table="public.table_c"
	 src-required="false" dst-required="false">
	<label ref-type="src-label">
		<position x="-46.91" y="0"/>
	</label>
	<label ref-type="name-label">
		<position x="35.5197" y="9.93933"/>
	</label>
</relationship>

<function name="dummy_trig_func"
		window-func="false"
		returns-setof="false"
		behavior-type="CALLED ON NULL INPUT"
		function-type="VOLATILE"
		security-type="SECURITY INVOKER"
		execution-cost="1"
		row-amount="0">
	<schema name="schema_b"/>
	<role name="postgres"/>
	<language name="plpgsql" sql-disabled="true"/>
	<return-type>
	<type name="trigger" length="1"/>
	</return-type>
	<definition><![CDATA[BEGIN
  -- this functions does nothing! --
  RETURN NEW;
END;]]></definition>
</function>

<trigger name="dummy_trigger" firing-type="BEFORE" per-line="true" constraint="false"
	 ins-event="true" del-event="false" upd-event="false" trunc-event="false"
	 table="schema_a.table_h">
		<function signature="schema_b.dummy_trig_func()"/>
</trigger>

<view name="view_test">
	<schema name="schema_b"/>
	<role name="postgres"/>
	<position x="540" y="240"/>
	<reference table="schema_a.table_d" column="id_a_table_a" alias="td" column-alias="id"/>
	<reference table="public.table_a" alias="ta"/>
	<reference alias="_expr">
		<expression><![CDATA[(SELECT random())]]></expression>
	</reference>
	<expression type="select-exp">0,1,2</expression>
	<expression type="from-exp">0,1</expression>
</view>

<relationship name="rel_view_test_table_d" type="reltv"
	 src-table="schema_b.view_test"
	 dst-table="schema_a.table_d"
	 src-required="false" dst-required="false"/>

<relationship name="rel_view_test_table_a" type="reltv"
	 custom-color="#8a114b"
	 src-table="schema_b.view_test"
	 dst-table="public.table_a"
	 src-required="false" dst-required="false"/>

<textbox name="pagila_desc" font-size="11">
	<position x="600" y="20"/>
	<comment><![CDATA[[ demodb database ]

This database model demonstrate some features when designing
database models. It does not represent any specific context but can
be exported to the database since it generates well formed SQL syntax.]]></comment>
</textbox>

<textbox name="view_test_txt" font-size="9">
	<position x="720" y="220"/>
	<comment><![CDATA[Views can be constructed from
references to tables or using 
SQL expressions.]]></comment>
</textbox>

<textbox name="tag_txt" font-size="9">
	<position x="160" y="120"/>
	<comment><![CDATA[Note the table below with a different color.
pgModeler implements the concept of "tags"
in order to permit user to graphically separate
tables through different colors.]]></comment>
</textbox>

<textbox name="col_propag_txt" font-size="9">
	<position x="140" y="900"/>
	<comment><![CDATA[pgModeler implements a mechanism
called "column propagation" when using
relationships 1:1, 1:n and generalization.

This mechanism creates the needed columns
and constraints in a cascade way on all set
of tables affected by one or more relationships.

For instance, the "table_c" is linked to "table_f"
through the column "id_f_table_f" generated by
the relationship that connects them. Ahead,
the "table_e" inherits "table_c", and, as a
result, all columns of the latter are copied
to the first, including the column "id_f_table_f"
product of another relationship.]]></comment>
</textbox>

<textbox name="fk_rel_txt" font-size="9">
	<position x="1440" y="680"/>
	<comment><![CDATA[User is not obligated to use the relationships
to generate the foreign keys. You can manually
create your own foreign keys on the desired tables
and pgModeler will automatically create the
relationships to graphically represent the 
link between them.

You can check that situation on "table_h". There
we have three foreign keys created by hand 
pointing repectively to "table_a", "table_e" and 
"table_f". Note the relationships linking the 
mentioned tables, those objects weren't created
by the user.]]></comment>
</textbox>

<relationship name="table_e_inherits_table_c" type="relgen"
	 pk-pattern="{dt}_pk"
	 custom-color="#124544"
	 src-table="schema_a.table_e"
	 dst-table="public.table_c">
	<special-pk-cols indexes="0"/>
</relationship>

<relationship name="many_table_e_has_many_table_e" type="relnn"
	 src-col-pattern="{sc}_{st}" dst-col-pattern="{sc}_{dt}"
	 pk-pattern="{gt}_pk" uq-pattern="{gt}_uq"
	 src-fk-pattern="{st}_fk" dst-fk-pattern="{dt}_fk"
	 pk-col-pattern="id"
	 custom-color="#d28818"
	 src-table="schema_a.table_e"
	 dst-table="schema_a.table_e"
	 src-required="false" dst-required="false"
	 table-name="many_table_e_has_many_table_e">
	<line>
		<position x="1032.83" y="823.603"/>
	<position x="1032.83" y="755"/>
	<position x="954.556" y="755"/>
	</line>
	<label ref-type="src-label">
		<position x="8" y="-15.76"/>
	</label>
	<label ref-type="name-label">
		<position x="-71.6303" y="-3.60001"/>
	</label>
</relationship>

<constraint name="table_a_fk" type="fk-constr" comparison-type="MATCH FULL"
	 upd-action="NO ACTION" del-action="NO ACTION" ref-table="public.table_a" table="schema_a.table_h">
	<columns names="table_a_id" ref-type="src-columns"/>
	<columns names="id_a" ref-type="dst-columns"/>
</constraint>

<constraint name="table_g_fk" type="fk-constr" comparison-type="MATCH FULL"
	 upd-action="NO ACTION" del-action="NO ACTION" ref-table="schema_a.table_f" table="schema_a.table_h">
	<columns names="table_f_id" ref-type="src-columns"/>
	<columns names="id_f" ref-type="dst-columns"/>
</constraint>

<constraint name="table_e_fk" type="fk-constr" comparison-type="MATCH FULL"
	 upd-action="NO ACTION" del-action="NO ACTION" ref-table="schema_a.table_e" table="schema_a.table_h">
	<columns names="table_e_id" ref-type="src-columns"/>
	<columns names="id_c" ref-type="dst-columns"/>
</constraint>

<relationship name="rel_table_h_table_a" type="relfk"
	 custom-color="#0a21ad"
	 src-table="schema_a.table_h"
	 dst-table="public.table_a"
	 src-required="false" dst-required="false">
	<label ref-type="dst-label">
		<position x="9.54001" y="35.8"/>
	</label>
</relationship>

<relationship name="rel_table_h_table_f" type="relfk"
	 custom-color="#1c70ed"
	 src-table="schema_a.table_h"
	 dst-table="schema_a.table_f"
	 src-required="false" dst-required="false"/>

<relationship name="rel_table_h_table_e" type="relfk"
	 custom-color="#127d6b"
	 src-table="schema_a.table_h"
	 dst-table="schema_a.table_e"
	 src-required="false" dst-required="false">
	<label ref-type="dst-label">
		<position x="15.54" y="25.4"/>
	</label>
</relationship>

</dbmodel>