1 - I added some new notes. 2 - That code I know and works fine. I used it in slightly different contexts in other projects Here it is a case . A table with two columns , data type is irrelevant I have a need in which I may get a.col1,a.col2 and other variations Point is yes I could build any variation re-running a slightly different way the query in the catalogs But why hit 3 or 4 times when I could manipulate an array like below ? This code just came in my mind (and works) CREATE OR REPLACE FUNCTION test1 () RETURNS void AS $$ DECLARE var1 text[]; var2 text; var3 text; var4 text; begin execute 'select ARRAY( select column_name::text from information_schema.columns where table_name=' || quote_literal('foo') ||')' into var1; raise notice '%', var1; select array_to_string(array(select 'a.'||unnest(var1)),',') into var4; raise notice '%', var4; END; $$ LANGUAGE plpgsql ; levregdb1=# select test1(); NOTICE: {col1,col2} NOTICE: a.col1,a.col2 Note the a. being prepended to each of the array’s elements 3 - I appreciate the help. Keep in mind I am not a developer and this is a new venture for me. On the same token I am not an ignorant either . What irritates me is the TRUE lack in this case of explanations in the docs. I know another DBMS just as bad in the documentation area (worse in fact) I turned to the community. And yes I know how to make cases since I worked support. Frankly I am turning off since I sure as heck don’t like being patronized. Did not accept this (and never will) from my own mom let alone somebody else My apologies for asking help. Will try not to do it again Thanks and laters On Nov 21, 2016, at 7:12 PM, David G. Johnston <david.g.johnston@xxxxxxxxx> wrote:
|