Postgres machine OS: RHEL release 2.1 (Panama)
PGAdminIII client OS: WinXP Pro 2002 SP2
Clients: psql, PGAdminIII Query tool
dfol=> select version();
version
-------------------------------------------------------------
PostgreSQL 8.1.0 on i686-pc-linux-gnu, compiled by GCC 2.96
The original versions looked like this (same behaviour though):
create or replace function dfol.getcolstring (tblname varchar) returns varchar as $$
declare
table_columns text;
column_name record;
begin
-- skapa kolumnnamns-strängarna
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;
-- kapa av sista kommatecknet
table_columns := substring(table_columns from 1 for length(table_columns)-1);
return table_columns;
end;
$$
language plpgsql;
create or replace function dfol.getcolstring (tblname text) returns varchar as $$
declare
table_columns text;
column_name record;
begin
-- skapa kolumnnamns-strängarna
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;
-- kapa av sista kommatecknet
table_columns := substring(table_columns from 1 for length(table_columns)-1);
return table_columns;
end;
$$
language plpgsql;
-----Original Message-----
From: Michael Fuhr [mailto:mike@fuhr.org]
Sent: den 9 november 2005 19:56
To: Mikael Carneholm
Cc: 'Pgsql-General (E-mail)
Subject: Re: [GENERAL] Hanging creating of function
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