Click here to Skip to main content
15,791,963 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I would normally declare a variable in the following manner...

DECLARE @myVariable Text
SET @myVariable = 'pages'


How would this change in PostgreSQL (...pgAdmin III) query?

1 solution


Have a look here:[^]
There is no such feature in PostgreSQL. You can do it only in pl/PgSQL (or other pl/*), but not in plain SQL.
Share this answer
Runner55Code 8-May-13 12:45pm    
For a beginner ( PostgreSQL) the[^] solution is a bit confusing.
Thomas Daniels 8-May-13 12:47pm    
Yes, but it answers your question.
Runner55Code 8-May-13 13:05pm    
Ok, I'll work on it...but PostgreSQL seems to have made something relatively simple - complex.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900