SELECT FROM 'varying_table'

From: Nart Tamash <nart(dot)tamash(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: SELECT FROM 'varying_table'
Date: 2012-05-18 10:47:10
Message-ID: CAM1YuxQk7W-0d+xuDXRJ1gojq5gm0KRW3MQTX9EhMFCQnuXA8w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

Is it possible to have a query that that would run on a different table
every time it is executed? This query would be integrated in a trigger
function that would serve a trigger that fires every time a new table is
inserted in the database. This would be monitored through the individual
records in a certain "index" table which would have a column that holds the
table names. How can I sort of select these string values that hold the
table names and cast them in actual "table names" type in my query?

All my searching leaded to the EXECUTE command but didn't quite figured out
how that works when I need to return the whole table and not just a RECORD
type.

My specific case:

INSERT INTO *table(column)*
SELECT ....
FROM *varying table*
*
*
*
*
Regards,

Nart

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Alejandro Barragan 2012-05-18 18:10:35 Page Usage Information
Previous Message Tom Lane 2012-05-17 18:44:37 Re: Updating a chkpass column in postgres v8.1.21