Re: plpgsql variable substitution problem ... - Mailing list pgsql-sql

From Tom Lane
Subject Re: plpgsql variable substitution problem ...
Date
Msg-id 12699.959537744@sss.pgh.pa.us
Whole thread Raw
In response to plpgsql variable substitution problem ...  (Greg Wickham <greg@geelong.com>)
List pgsql-sql
Greg Wickham <greg@geelong.com> writes:
> 000528.19:45:45.725  [9553] query: SELECT  max( $1 ) FROM  $2

There is no facility in plpgsql for run-time specification of a table
name, and probably never will be for the general case.  It's possible
that it could be made to work for selection of a particular table among
the inheritance children of a specified table, but not for any arbitrary
table, unless we want to give up preparsing and preplanning of plpgsql
queries.

pltcl does everything on-the-fly at runtime, so you could do this in
that language, I think (and accept the resulting speed penalty).

A more interesting question is whether you shouldn't redesign your
database schema so that you don't need to do this...
        regards, tom lane


pgsql-sql by date:

Previous
From: Greg Wickham
Date:
Subject: plpgsql variable substitution problem ...
Next
From: Carolyn Wong
Date:
Subject: date format