May 2018
Intermediate to advanced
576 pages
30h 25m
English
What do these changes mean? We have defined three variables, setting them respectively to the table name, column name and column value. 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 by 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.