From: Minh Van Le <mvanle@tpg.com.au>
To: pgsql-general@lists.postgresql.org
Subject: Sample schemas and data that correlate with all examples in PostgreSQL documentation
Date: Mon, 26 Dec 2022 22:03:48 +1100
Message-ID: <bc6873bf572185641fa4468daf1d8766432b71a4.camel@tpg.com.au> (raw)
I would like to follow through and experiment with the examples in the
PostgreSQL documentation but find it difficult to compare impacts of
commands without actual working data.
Is there sample data or a default database that correlates with all the
examples in the PostgreSQL documentation ?
Problem
-------
Getting table or column "does not exist" errors when executing SQL in
documentation eg
(https://www.postgresql.org/docs/10/tutorial-window.html):
SELECT depname, empno, salary, enroll_date
FROM
(SELECT depname, empno, salary, enroll_date, rank() OVER (PARTITION
BY depname ORDER BY salary DESC, empno) AS pos
FROM empsalary
) AS ss
WHERE pos < 3;
Error
-----
SQL Error [42703]: ERROR: column "enroll_date" does not exist
Attempted workarounds
---------------------
* Stack Builder does not list sample data installation options
* The sources do not contain required sample data (eg. "src\tutorial"
directory et al in
https://ftp.postgresql.org/pub/source/v10.23/postgresql-10.23.tar.gz)
* Any 3rd-party sample data found appear incomplete or non-official
(eg. "advanced-psql-examples.sql" from
https://gist.github.com/marko-asplund/5561404 missing "enroll_date"
column)
Versions
--------
* PostgreSQL 10.23
(https://web3.pioneersoftware.co.uk/files/pgsql/10/postgresql-10.23-1-windows.exe
)
* Stack Builder 4.2.1
Addendum
--------
I found DDL and data for empsalary in "src\test\regress\sql\window.sql"
but there are other tables mentioned in the documentation that I cannot
find accompanying the sources (eg. regional_sales, top_regions,
included_parts etc) (ref: postgresql.org/docs/10/queries-with.html).
And of those that do have DDL (eg. orders, products) there is only
minimal sample data (eg. 1 row) simply to satisfy a regression test.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: mvanle@tpg.com.au
Subject: Re: Sample schemas and data that correlate with all examples in PostgreSQL documentation
In-Reply-To: <bc6873bf572185641fa4468daf1d8766432b71a4.camel@tpg.com.au>
References: <bc6873bf572185641fa4468daf1d8766432b71a4.camel@tpg.com.au>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox