Declaring variables in PostgreSQL 9 is not as simple as with MSSQL. To declare a variable in PostgreSQL 9, you must use the following syntax:
DO $$
DECLARE variableName TEXT := ‘value of variable’;
BEGIN
END $$;
You can assign variables in PosgreSQL by simply typing the variables name, followed by := ???, where ??? is the value of the variable you want to set.