Re: Junk queries with variables? - Mailing list pgsql-sql

From Bricklen Anderson
Subject Re: Junk queries with variables?
Date
Msg-id 421E0C36.2030103@PresiNET.com
Whole thread Raw
In response to Re: Junk queries with variables?  ("Steve - DND" <postgres@digitalnothing.com>)
List pgsql-sql
Steve - DND wrote:
>>I don't know about pgAdmin, but in psql you can use \set:
>>
>>\set id 1
>>SELECT * FROM foo WHERE id = :id;
>>
>>\set name '\'Some Name\''
>>SELECT * FROM foo WHERE name = :name;
>>
> 
> 
> Whenever I try the above I get an error at the backslash. Do I need to
> create a different language for this? Right now I only have plpgsql
> available.
> 
> Thanks,
> Steve
>
\set name text('Some Name')
SELECT * FROM foo WHERE name = :name;



pgsql-sql by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Junk queries with variables?
Next
From: "Kent Anderson"
Date:
Subject: How do you compare contents of two tables using 2 pk