Re: permissions/building commands from variables

From: Ross Boylan <ross(at)biostat(dot)ucsf(dot)edu>
To: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: permissions/building commands from variables
Date: 2012-05-31 20:36:52
Message-ID: 4FC7D664.8090808@biostat.ucsf.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 5/31/2012 12:49 PM, Josh Kupershmidt wrote:
> On Thu, May 31, 2012 at 12:25 PM, Ross Boylan<ross(at)biostat(dot)ucsf(dot)edu> wrote:
>> Thanks for the info. I am on 8.4.
>> I didn't realize plpgsql let you convert variables (i.e., results of a
>> select to get table names) into command text.
> Yup, you just have to remember to use the EXECUTE command in your
> PL/pgSQL function when you are constructing dynamic SQL. Here's an
> example relevant to your scenario:
> http://archives.postgresql.org/pgsql-general/2010-01/msg00871.php
>
> Josh
I thought the tip was worth preserving for the list, along with my
thanks, so I'm sending it to the list. I hadn't been thinking of
execute; I've got too much SAS macros on the brain.
Ross

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message bradawk 2012-06-01 16:00:06 database in different location owned by different user
Previous Message Josh Kupershmidt 2012-05-31 19:09:04 Re: permissions