anthonydb / practical-sql-2

Code and Data for the Second Edition of "Practical SQL" by Anthony DeBarros, published by No Starch Press (2022).
Other
502 stars 441 forks source link

Operators ! and !!, as well as function numeric_fac() has been removed in PostgreSQL 14. #11

Closed vasili111 closed 1 year ago

vasili111 commented 1 year ago

Remove factorial operators ! and !!, as well as function numeric_fac() (Mark Dilger)

From here: https://www.postgresql.org/docs/14/release-14.html

"!" Mentioned on p.78 in table. Also, on p.80 there is a code: SELECT 4 !;

that gives an error:

ERROR: syntax error at or near ";" LINE 1: SELECT 4 !; ^

SQL state: 42601 Character: 11

anthonydb commented 1 year ago

Hello,

Yes, that is correct, and this distinction is noted both on Page 81 of the second edition and in the code for that exercise here: https://github.com/anthonydb/practical-sql-2/blob/main/Chapter_06/Chapter_06.sql#L28

There are still a great many users working on versions 13 and older of PostgreSQL, so I don't believe this is an issue as long as it is clearly stated in both the book and the repo.