I think the restore process could be made more error proof if the following 
additions could be made:

pg_dump, (maybe started with a special flag) if run with superuser rights 
should not issue

\connect - username
create table foo (...
copy foo from ...

to create tables, but use this syntax:
create table foo(...
copy foo from ...
update pg_class 
     set relowner=u.usesysid 
   from pg_user u 
 where u.usename='username' and relname='foo';

This would avoid situations where a restore becomes impossible because 
password authentication is necessary. This would allow restoring  without 
having to set trust in pg_hba.conf. A patch would be simple, in fact I wrote 
it within a few minutes. 

Or am I completly wrong and there's a better way to accomplish this?

Best regards,
	Mario Weilguni

-- 
===================================================
 Mario Weilguni ï¿½ ï¿½ ï¿½ ï¿½ ï¿½ ï¿½ ï¿½ ï¿½               KPNQwest Austria GmbH
ï¿½Senior Engineer Web Solutions                         Nikolaiplatz 4
ï¿½tel: +43-316-813824 ï¿½ ï¿½ ï¿½ ï¿½                        8020 graz, austria
ï¿½fax: +43-316-813824-26 ï¿½ ï¿½ ï¿½              http://www.kpnqwest.at
ï¿½e-mail: mario.weilguni@kpnqwest.com
===================================================

Thu, 17 May 2001 17:50:56 +0200
Mario Weilguni <mweilguni@sime.com>
restore improvement
Mario Weilguni writes:

> pg_dump, (maybe started with a special flag) if run with superuser rights
> should not issue
>
> \connect - username
> create table foo (...
> copy foo from ...

> This would avoid situations where a restore becomes impossible because
> password authentication is necessary. This would allow restoring  without
> having to set trust in pg_hba.conf. A patch would be simple, in fact I wrote
> it within a few minutes.
>
> Or am I completly wrong and there's a better way to accomplish this?

set session authentication 'username';

The command already exists in 7.2devel sources.  Feel free to send a patch
to make pg_dump use it.  Note that this command requires superuser rights,
so there needs to be an alternative.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Thu, 17 May 2001 18:27:57 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: restore improvement