Dynamic column name troubles

From: mstory(at)uchicago(dot)edu
To: pgsql-general(at)postgresql(dot)org
Subject: Dynamic column name troubles
Date: 2005-01-21 01:07:16
Message-ID: 1106269636.41f055c4530d2@churlish.uchicago.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a table that gets a column added to it for every insert on another table.
the general form of these columns are g_c_i_avg where i is the unique
identifyer for the insert that caused the column to be added. I need to use this
column to calculate a new value for another column in the same table on an
update to that column. I can find the altered column, and even build a text
string for it: something like column := ''NEW.g_c_'' || 7 || ''_avg'';

but then i can't use the double precision value for that column. Any help would
be appreciated.

matt

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Garamond 2005-01-21 01:54:05 Re: Best Linux Distribution
Previous Message Jim C. Nasby 2005-01-21 00:55:54 Re: [GENERAL] Ways to check the status of a long-running transaction