pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bricklen Anderson <BAnderson@PresiNET.com>
To: Steve - DND <postgres@digitalnothing.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Junk queries with variables?
Date: Thu, 24 Feb 2005 09:17:42 -0800
Message-ID: <421E0C36.2030103@PresiNET.com> (raw)
In-Reply-To: <LDEHKBBOEMIJKHKBOFNFIEHFLLAA.postgres@digitalnothing.com>
References: <LDEHKBBOEMIJKHKBOFNFIEHFLLAA.postgres@digitalnothing.com>

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;




view thread (13+ messages)  latest in thread

Message-ID: <421E0C36.2030103@PresiNET.com>
Permalink:  ../421E0C36.2030103@PresiNET.com/
Also on:    postgresql.org/message-id/421E0C36.2030103@PresiNET.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: BAnderson@PresiNET.com, postgres@digitalnothing.com
  Subject: Re: Junk queries with variables?
  In-Reply-To: <421E0C36.2030103@PresiNET.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox