relpipe-data/examples/sql-dk_pg_1.sh
author František Kučera <franta-hg@frantovo.cz>
Tue, 28 May 2019 21:18:20 +0200
branchv_0
changeset 258 2868d772c27e
parent 255 94b533007e77
permissions -rwxr-xr-x
Release v0.12 – AWK
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
255
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
sql-dk --db "$postgresql_db" --sql "
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
SELECT
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
	table_schema,
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
	table_name,
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
	table_type
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
FROM information_schema.tables
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
WHERE table_schema IN ('pg_catalog', 'information_schema')
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
LIMIT 3;
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
SELECT
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
	typName,
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
	typCategory,
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
	typByVal
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
FROM pg_type
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
LIMIT 4" \
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
	--relation tables \
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
	--relation types \
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
	--formatter xml \
94b533007e77 examples: recfile (GNU Recutils) input and output
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
	| relpipe-in-xml