How To Declare Variable In PostgreSQL 9 Posted on by Webmaster IT Support Forum › Forums › Databases › PostgreSQL › SQL Queries › How To Declare Variable In PostgreSQL 9 Tagged: Variables This topic has 0 replies, 1 voice, and was last updated 6 years, 8 months ago by Webmaster. Viewing 0 reply threads Author Posts September 14, 2016 at 10:49 am #1930 WebmasterKeymaster 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. Author Posts Viewing 0 reply threads You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In