Re: use of alias

From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "Brett McBride" <brett(at)deakin(dot)edu(dot)au>
Cc: "Amit jain" <amitjain(dot)bit(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: use of alias
Date: 2008-02-12 05:59:22
Message-ID: 37ed240d0802112159s6595da16i188c235853cfa2ce@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Though to be safe you should be quoting MT and ST with quote_ident()
before putting them into a dynamic statement.

Cheers
BJ

On Feb 12, 2008 4:38 PM, Brett McBride <brett(at)deakin(dot)edu(dot)au> wrote:
> you could do this with 'execute' like so:
>
> execute 'select count(*) into count1 from ' || MT || ',' || ST || '
> where ' || MT || '.phonenumber= ' || ST || '.phonenumber' into v_variable;
>
> brett

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Matteo Beccati 2008-02-12 08:40:49 Re: patternsel() and histogram_selectivity() and the hard cutoff of 100
Previous Message Brett McBride 2008-02-12 05:38:17 Re: use of alias