Обсуждение: pg_dump bug?

Поиск
Список
Период
Сортировка

pg_dump bug?

От
ohp@pyrenet.fr
Дата:
Hi all,

This is on 7.3.4
I had altered a user like this:
alter user set search_path = shema1,public

Then I had to pgdumpall, re-initdb and restore every thing.

The alter user did'nt get through. and broke my app.

Is it a pg_dump bug? I haven't tested on 7.4b

BTW, would'nt it be more logical if we could set the search_path on a
database basis. ALTER DATABASE doesn't seem to support it
Regards,

-- 
Olivier PRENANT                    Tel: +33-5-61-50-97-00 (Work)
6, Chemin d'Harraud Turrou           +33-5-61-50-97-01 (Fax)
31190 AUTERIVE                       +33-6-07-63-80-64 (GSM)
FRANCE                          Email: ohp@pyrenet.fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)


Re: pg_dump bug?

От
Bruce Momjian
Дата:
ohp@pyrenet.fr wrote:
> Hi all,
> 
> This is on 7.3.4
> I had altered a user like this:
> alter user set search_path = shema1,public
> 
> Then I had to pgdumpall, re-initdb and restore every thing.
> 
> The alter user did'nt get through. and broke my app.

Yes, it seems pg_dump doesn't dump per-database alter information, only
pg_dumpall does.  That information is considered global to the cluster,
rather than per-database.

Should we throw a warning or dump that info in pg_dump?

> Is it a pg_dump bug? I haven't tested on 7.4b
> 
> BTW, would'nt it be more logical if we could set the search_path on a
> database basis. ALTER DATABASE doesn't seem to support it
> Regards,

I just tried it in 7.4beta and it worked:
test=> alter database test set search_path to 'public';

When I disconnect and reconnect:test=> show search_path; search_path------------- public(1 row)

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


Re: pg_dump bug?

От
ohp@pyrenet.fr
Дата:
On Sun, 31 Aug 2003, Bruce Momjian wrote:

> Date: Sun, 31 Aug 2003 21:51:02 -0400 (EDT)
> From: Bruce Momjian <pgman@candle.pha.pa.us>
> To: ohp@pyrenet.fr
> Cc: pgsql-hackers list <pgsql-hackers@postgresql.org>
> Subject: Re: [HACKERS] pg_dump bug?
>
> ohp@pyrenet.fr wrote:
> > Hi all,
> >
> > This is on 7.3.4
> > I had altered a user like this:
> > alter user set search_path = shema1,public
> >
> > Then I had to pgdumpall, re-initdb and restore every thing.
> >
> > The alter user did'nt get through. and broke my app.
>
> Yes, it seems pg_dump doesn't dump per-database alter information, only
> pg_dumpall does.  That information is considered global to the cluster,
> rather than per-database.
Err, I had done a pg_dumpall..
Does alter database set serach_pat = blah works on 7.3.4?
>
> Should we throw a warning or dump that info in pg_dump?
>
> > Is it a pg_dump bug? I haven't tested on 7.4b
> >
> > BTW, would'nt it be more logical if we could set the search_path on a
> > database basis. ALTER DATABASE doesn't seem to support it
> > Regards,
>
> I just tried it in 7.4beta and it worked:
>
>     test=> alter database test set search_path to 'public';
>
> When I disconnect and reconnect:
>
>     test=> show search_path;
>      search_path
>     -------------
>      public
>     (1 row)
>
>

-- 
Olivier PRENANT                    Tel: +33-5-61-50-97-00 (Work)
6, Chemin d'Harraud Turrou           +33-5-61-50-97-01 (Fax)
31190 AUTERIVE                       +33-6-07-63-80-64 (GSM)
FRANCE                          Email: ohp@pyrenet.fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)


Re: pg_dump bug?

От
Bruce Momjian
Дата:
ohp@pyrenet.fr wrote:
> On Sun, 31 Aug 2003, Bruce Momjian wrote:
> 
> > Date: Sun, 31 Aug 2003 21:51:02 -0400 (EDT)
> > From: Bruce Momjian <pgman@candle.pha.pa.us>
> > To: ohp@pyrenet.fr
> > Cc: pgsql-hackers list <pgsql-hackers@postgresql.org>
> > Subject: Re: [HACKERS] pg_dump bug?
> >
> > ohp@pyrenet.fr wrote:
> > > Hi all,
> > >
> > > This is on 7.3.4
> > > I had altered a user like this:
> > > alter user set search_path = shema1,public
> > >
> > > Then I had to pgdumpall, re-initdb and restore every thing.
> > >
> > > The alter user did'nt get through. and broke my app.
> >
> > Yes, it seems pg_dump doesn't dump per-database alter information, only
> > pg_dumpall does.  That information is considered global to the cluster,
> > rather than per-database.
> Err, I had done a pg_dumpall..
> Does alter database set serach_pat = blah works on 7.3.4?

Oh 7.3.4.  (I see that above now.) Maybe it was a bug.  It works fine in
7.4.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073