pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Greg Wickham <greg@geelong.com>
Cc: pgsql-sql@hub.org
Subject: Re: plpgsql variable substitution problem ...
Date: Sun, 28 May 2000 14:15:44 -0400
Message-ID: <12699.959537744@sss.pgh.pa.us> (raw)
In-Reply-To: <20000528174811.70CF510B72@mail.surfcoast.net>
References: <20000528174811.70CF510B72@mail.surfcoast.net>

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



view thread (2+ messages)

Message-ID: <12699.959537744@sss.pgh.pa.us>
Permalink:  ../12699.959537744@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12699.959537744@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, greg@geelong.com, pgsql-sql@hub.org
  Subject: Re: plpgsql variable substitution problem ...
  In-Reply-To: <12699.959537744@sss.pgh.pa.us>
  References: <20000528174811.70CF510B72@mail.surfcoast.net> <12699.959537744@sss.pgh.pa.us>

* 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