relpipe-data/examples/sql-dk_pg_1.sh
author František Kučera <franta-hg@frantovo.cz>
Mon, 21 Feb 2022 00:43:11 +0100
branchv_0
changeset 329 5bc2bb8b7946
parent 255 94b533007e77
permissions -rwxr-xr-x
Release v0.18
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