Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p9lH1-00024B-9s for pgsql-general@arkaria.postgresql.org; Mon, 26 Dec 2022 11:04:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p9lGz-0007cc-G0 for pgsql-general@arkaria.postgresql.org; Mon, 26 Dec 2022 11:04:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p9lGz-0007cS-4q for pgsql-general@lists.postgresql.org; Mon, 26 Dec 2022 11:04:01 +0000 Received: from rpt-glb-asav1.external.tpg.com.au ([60.241.0.10]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p9lGt-0001YE-IW for pgsql-general@lists.postgresql.org; Mon, 26 Dec 2022 11:03:59 +0000 X-Ironport-Abuse: host=124-168-84-235.tpgi.com.au, ip=124.168.84.235, date=12/26/22 22:03:49 X-SMTP-MATCH: 0 X-IPAS-Result: =?us-ascii?q?A2F1BAATf6lj/+tUqHxagQkJgUaDNIFYhE9cgnONUJJXi?= =?us-ascii?q?mUjgQIDGD4PAQMBAQEBAUQJBAEBAwEDhU8JhDkmNgcOAQEBBAEBAQEBAgUBA?= =?us-ascii?q?QEBAQEDAQEBBQECAQEBBAUBAQECgRmFLwwIJQ2COCIZZFM0AQEBAQEBAQEBA?= =?us-ascii?q?QEBAQEBAQEBAQEBAQEBEgIIBU0FWEmBCwImAoNxgyITrjZ6gTKBAYMWOgEVA?= =?us-ascii?q?T8BTJplgWeBFCyJD4gUPQaCDYEVNoJEgn08FwIBAluBT4MKgkUiBIEJlylvg?= =?us-ascii?q?T19gScOSBw3AxkrHUADC20KQTUXSysaGweBCiooFQMEBAMCBhMDI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8iy3BAvdgSpfGBazXjTNa9G5q2oYXQ6aYN 5ZfM2EyBPjDS0Qn1lM/DYw3muOlrmXnfHtTr1fTrLdfD237llEogOGyYYuEEjCMbeRxnneYi HvgxXrkBkoiC9G92CWX9Fv504cjmgu+Aur+DoaQ7vFxmVnWyWEVBQcfUXO/oOKlkQimXMlDJ FYZ4TMq668o+ySDS8f0WRm1iHuNvxpaUN1Ve9DW8ynUkPaRuljJQzhYC2QaNZo6rMA3Azct0 xmAgrsFGABSjVFcclrFnp/8kN94EXFERYPeTUfohjfpLzUuTE/fQ/4Pohte/HaJs+DI IronPort-HdrOrdr: A9a23:mxOaRKMIUSFct8BcTtijsMiBIKoaSvp037BN7TETdfU1SKKlfq +V88jzuSWYtN9zYhEdcLK7U5VoKEm0naKdirN6AV7NZmXbUSeTTb1f0Q== X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=Sophos;i="5.96,275,1665406800"; d="scan'208";a="251817999" Received: from 124-168-84-235.tpgi.com.au (HELO 192-168-1-104.tpgi.com.au) ([124.168.84.235]) by rpt-glb-asav1.external.tpg.com.au with ESMTP; 26 Dec 2022 22:03:49 +1100 Message-ID: Subject: Sample schemas and data that correlate with all examples in PostgreSQL documentation From: Minh Van Le To: pgsql-general@lists.postgresql.org Date: Mon, 26 Dec 2022 22:03:48 +1100 Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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.