Re: calling a function within a view causes problems doing a pg_dumpall

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: juerg(dot)rietmann(at)pup(dot)ch, pgsql-sql(at)postgresql(dot)org
Subject: Re: calling a function within a view causes problems doing a pg_dumpall
Date: 2001-05-07 14:53:49
Message-ID: web-52454@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Juerg,

> I need to transfer a db form one to another server. I wanted to do
> this
> with pg_dumpall and psql -e ....

Have you tried just using pg_dump instead of pg_dumpall? I understand
that there were a few bugs in pg_dumpall, and pg_dump will mean less
data to transfer.

> CREATE FUNCTION buildString(bpchar) RETURNS text AS '
> DECLARE
> list text;
> rec record;
> BEGIN
> list := '''';
> FOR rec IN SELECT z_u_umfang FROM zylinder_umfang WHERE
> z_u_typ
> = $1;
> list := list || text(rec.z_u_umfang) || '','';
> END LOOP;
> RETURN list;
> END;
> ' LANGUAGE 'plpgsql';

It would be nice to see the errors you're getting when you try to
restore. Could it be as simple as the dump file trying to create the
view before the function? Or plpgsql not being defined as a language on
the target server?

BTW, there is a better-performance way to do the same thing you're doing
with that function. Please browse the list archives with a search for
'catenate' -- you'll find a discussion of custom aggregates which
concatinate strings.

-Josh

______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Oliver Seidel 2001-05-07 15:14:14 OFFTOPIC: search and replace with unix tools
Previous Message juerg.rietmann 2001-05-07 08:28:24 calling a function within a view causes problems doing a pg_dumpall