relpipe-data/examples/sql-dk_pg_1.sh
author František Kučera <franta-hg@frantovo.cz>
Mon, 08 Apr 2019 13:37:35 +0200
branchv_0
changeset 255 94b533007e77
permissions -rwxr-xr-x
examples: recfile (GNU Recutils) input and output
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