[GENERAL] Column aliases in having or where for Postgres 8.3

2011-06-01 Thread Prafulla Tekawade
Hi, Anyone knows if I can use column aliases in having condition? Something like this. pgdb=# select sum(c_acctbal) as p from customer having p > 1000; select sum(c_acctbal) as p from customer having p > 1000; ERROR: column "p" does not exist LINE 1: select sum(c_acctbal) as p from customer

[GENERAL] Psql Internal Variable question

2011-05-31 Thread Prafulla Tekawade
Hi, I am trying to use psql \set and \echo commands to set some internal variables. My variable starts with single quote and ends with single quote. That is actual value of the variable. Eg. set cur_db 'pgdb' \echo :cur_db --I am expecting here 'pgdb' but psql shows pgdb As mentioned above, I am

[GENERAL] Psql Internal Variable question

2011-05-31 Thread Prafulla Tekawade
Hi, I am trying to use psql \set and \echo commands to set some internal variables. My variable starts with single quote and ends with single quote. That is actual value of the variable. Eg. set cur_db 'pgdb' \echo :cur_db --I am expecting here 'pgdb' but psql shows pgdb As mentioned above, I am