Sample schemas and data that correlate with all examples in PostgreSQL documentation

Поиск
Список
Период
Сортировка
От Minh Van Le
Тема Sample schemas and data that correlate with all examples in PostgreSQL documentation
Дата
Msg-id bc6873bf572185641fa4468daf1d8766432b71a4.camel@tpg.com.au
обсуждение исходный текст
Список pgsql-general
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.





В списке pgsql-general по дате отправления:

Предыдущее
От: qihua wu
Дата:
Сообщение: best practice to patch a postgresql version?
Следующее
От: Ron
Дата:
Сообщение: Re: best practice to patch a postgresql version?