From: Josh Berkus <josh@agliodbs.com>
To: juerg.rietmann@pup.ch
To: pgsql-sql@postgresql.org
Subject: Re: calling a function within a view causes problems doing a pg_dumpall
Date: Mon, 07 May 2001 07:53:49 -0700
Message-ID: <web-52454@davinci.ethosmedia.com> (raw)
In-Reply-To: <OFC18C0F7C.E3CC1843-ONC1256A45.002DBC77@pup.ch>
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@agliodbs.com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: josh@agliodbs.com, juerg.rietmann@pup.ch
Subject: Re: calling a function within a view causes problems doing a pg_dumpall
In-Reply-To: <web-52454@davinci.ethosmedia.com>
References: <OFC18C0F7C.E3CC1843-ONC1256A45.002DBC77@pup.ch> <web-52454@davinci.ethosmedia.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox