May 2019
Intermediate to advanced
600 pages
20h 46m
English
What do these changes mean? We have defined three variables, setting them to the table name, column name, and column value, respectively. Then, we have replaced the mentions of those specific values with the name of the variable preceded by a colon, which in psql means replace with the value of this variable. In the case of colval, we have also surrounded the variable name with single quotes, meaning treat the value as a string.
If we want vartest.sql to add a different column, we just have to make one change to the top of the script, where all variables are conveniently set. Then, the new column name will be used.
Read now
Unlock full access