> This will not work for me as I do not know in advance what columns
> exist in test_a or test_b. I only know they are called the same (and
> have the same datatypes).
> So is there a dynamic way in which I can generate the INSERT statement
> given the name of the two tables?
You can write a procedure e.g. in pl/pgsql that will check the column names
from a system view like pg_* (I don't remember now) and create the query
from the column names and some sql keywords into a text variable. Later you
can use EXECUTE for executing such a query from a variable.
In response to
pgsql-general by date
|Next:||From: dipti shah||Date: 2010-03-30 11:05:27|
|Subject: Get the list of permissions on schema for current user|
|Previous:||From: Alban Hertroys||Date: 2010-03-30 10:27:46|
|Subject: Re: How to implement word wrap|