Skip site navigation (1) Skip section navigation (2)

Re: BUG #5390: pg_dump does not check/include additional schema dependencies when writing schema/search path

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Timothy Seever" <tim(dot)seever(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5390: pg_dump does not check/include additional schema dependencies when writing schema/search path
Date: 2010-03-25 21:03:05
Message-ID: 24213.1269550985@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Timothy Seever" <tim(dot)seever(at)gmail(dot)com> writes:
> 1. Create schema A
> 2. Create schema B
> 3. Create function in schema A which depends on something in schema B
> without specifying it (i.e. the connected user has B included in the
> search_path, and the function A.xyz() has something like   val := yyz();  
> where yyz is actually B.yyz.  
> 4. This works properly in place due to the search path...  however upon
> dumping/restoring, pg_dump only specifies the single schema+public before
> each section, so it will fail to add A.xyz()/view/etc leading to cascaded
> missing items.

This does not matter because the script is only defining the function
not executing it.  Or are you speaking of an index function or something
like that?  In that case it really behooves you to make the function not
so sensitive to the caller's search path.  There is no way that pg_dump
can know that some function will only work as desired if called with a
particular search_path setting.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2010-03-25 21:04:43
Subject: Re: BUG #5389: Column order on dump/reload broken from defined setof function
Previous:From: Cesar EricesDate: 2010-03-25 21:01:55
Subject: Re: Fwd: [BUGS] Question about installation in 2003 server

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group