Closed pfortin closed 2 weeks ago
Hi, thanks for filing this.
I took a look. Using both pgAdmin 4 and the psql command-line utility on PostgreSQL 15.3 on macOS, I see the following output that matches the book:
In pgAdmin:
In psql:
Those two tools are what the book supports. Now, for the heck of it, I tried the query in DataGrip, which produces:
So, I'm curious which OS and GUI you're using.
In terms of adding a DROP TABLE statement, I'm not sure that's necessary because we only create the table once in the book. (As far as I remember this early in the morning.) I didn't feel it was worth it to add such a statement to every CREATE in the book. Glad to hear another perspective.
Hi Anthony, Thanks for your response.
OS: Linux Mageia 9 https://www.mageia.org/en/ GUI: SQL Workbench/J https://www.sql-workbench.eu/ Using this because the Mageia team have been unable to provide a working pgAdmin -- tried installing from source and ran into dependency issues.
INSERT: The different output I saw caused me to dig into the "why"... As indicated: "Found SQL-workbench/J setting: Tools>Options...>Data formatting: Decimal digits 2 caused the above output."; so GUI settings may result in output that looks different. While minor, I'm detail oriented, so I had to find the source of the difference... :)
DROP TABLE: I'm going to have to assume I may have issued the CREATE TABLE, taken a break and repeated it later. Sorry for that noise.
Using PostgreSQL 15.3... Nits which may confuse real beginners... Listing 4.2 could use a "DROP TABLE IF EXISTS number_data_types;", or a different name to avoid table already exists error.
The INSERT enters the numbers as expected; but: SELECT * FROM number_data_types; displays:
instead of the full digits. I see the same output in SQL-workbench/J's Data Explorer Data view... Found SQL-workbench/J setting: Tools>Options...>Data formatting: Decimal digits 2 caused the above output.