Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id OAA74596 for ; Sun, 28 May 2000 14:16:04 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id OAA12702; Sun, 28 May 2000 14:15:44 -0400 (EDT) To: Greg Wickham cc: pgsql-sql@hub.org Subject: Re: plpgsql variable substitution problem ... In-reply-to: <20000528174811.70CF510B72@mail.surfcoast.net> References: <20000528174811.70CF510B72@mail.surfcoast.net> Comments: In-reply-to Greg Wickham message dated "Mon, 29 May 2000 03:48:11 +1000" Date: Sun, 28 May 2000 14:15:44 -0400 Message-ID: <12699.959537744@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200005/177 Greg Wickham 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