Re: Using a variable as tablename ins plpgsql?

From: "Fernando Moreno" <azazel(dot)7(at)gmail(dot)com>
To: glynastill(at)yahoo(dot)co(dot)uk
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Using a variable as tablename ins plpgsql?
Date: 2008-10-20 16:54:53
Message-ID: b1c45530810200954j79388182t5630f38f8e982282@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2008/10/20 Glyn Astill <glynastill(at)yahoo(dot)co(dot)uk>

> Hi people,
>
> Hopefully this is a quickie, I want to pass in a table name to a plpgsql
> function and then use that table name in my queries.
>
> Is EXECUTE the only way to do this?
>

As far as I know, yes. That's the only way to create queries using dynamic
table and column names.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joshua Drake 2008-10-20 17:06:10 Booth Volunteers for LISA 08 (San Diego)
Previous Message Pavel Stehule 2008-10-20 16:51:33 Re: Using a variable as tablename ins plpgsql?