vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Can anyone explain why the first one never completes, but the second one does? (the first one just keeps running, I canceled after ~1 min) PG version: 8.1 final -- tblname param has type varchar create or replace function getcolstring (tblname varchar) returns varchar as $$ declare table_columns varchar := ''; column_name record; begin for column_name in select pga.attname from pg_attribute pga, pg_class pgc where pga.attrelid = pgc.relfilenode and pgc.relname = tblname and pga.attnum > 0 loop table_columns := table_columns || column_name.attname || ','; end loop; -- chop the last ',' table_columns := substr(table_columns,1,(length(table_columns)-1)); return table_columns; end; $$ language plpgsql; -- tblname param has type text create or replace function getcolstring (tblname text) returns varchar as $$ declare table_columns varchar := ''; column_name record; begin for column_name in select pga.attname from pg_attribute pga, pg_class pgc where pga.attrelid = pgc.relfilenode and pgc.relname = tblname and pga.attnum > 0 loop table_columns := table_columns || column_name.attname || ','; end loop; -- chop the last ',' table_columns := substr(table_columns,1,(length(table_columns)-1)); return table_columns; end; $$ language plpgsql; /Mikael ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |
| |||
| On Wed, Nov 09, 2005 at 07:38:53PM +0100, Mikael Carneholm wrote: > Can anyone explain why the first one never completes, but the second > one does? (the first one just keeps running, I canceled after ~1 min) > > PG version: 8.1 final Both functions create fine here in 8.1.0 on FreeBSD 6.0/i386 and Solaris 9/sparc. What client are you using? If not psql, have you tried with psql? What platform are you on? -- Michael Fuhr ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |
| ||||
| "Mikael Carneholm" <Mikael.Carneholm@WirelessCar.com> writes: > Can anyone explain why the first one never completes, but the second > one does? They both work fine for me ... regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |