Re: Inherited constraints and search paths (was Re: Preserving

From: Berend Tober <btober(at)seaworthysys(dot)com>
To: pgsql-general(at)postgreSQL(dot)org
Subject: Re: Inherited constraints and search paths (was Re: Preserving
Date: 2005-05-20 07:49:31
Message-ID: 428D968B.7090505@seaworthysys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Tom Lane wrote:

> Berend Tober <btober(at)seaworthysys(dot)com> writes:
>
>
>> Now what, oh most wise one?
>>
>
>
> OK, now I finally get the point: you are creating child tables in
> different schemas than their parents live in. This creates a problem
> because reverse-listing of the constraints varies depending on what
> the search path is.
>
>
Close but not exactly. In my case the child tables are in the same
schema as the parent, but it is the function call referenced in the
check constraint that lives in a different schema than the tables.
However, as an alternative in developing this idea, I did consider the
possibility of defining a separate schema where all the child tables
would live so that the child tables could have the same name as the
parent tables, since this particular implementation is such that the
child tables represent change histories of the parent tables.

> An example in CVS tip is:...
>
> It's the same constraint, but the different reverse-listing fools
> pg_dump into assuming that it's different.
>
> At the moment I'm not seeing any really nice way to fix this.
>
>
If the pg_dump output produced "SET search_path" statement with the
complete actual path required to find all objects in subsequent DDL
statements, my world would be at peace. (But I have no idea how
complicated it would be to implement that.)

> It can be argued that we should actually prohibit dropping inherited
> constraints, which'd eliminate that problem. I seem to recall that this
> has come up before and we explicitly decided against making such a
> restriction ... but given that a dump/restore will cause the inherited
> constraint to come back anyway, it can hardly be claimed that we really
> support dropping them.
>
> Comments anyone?
>
>
I like that arguement to prohibit dropping inherited constraints.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Zlatko Matic 2005-05-20 08:25:12 Re: MS-Access and Stored procedures
Previous Message Richard Huxton 2005-05-20 07:19:30 Re: Postgresql 7.4.7 docs(PDF)

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2005-05-20 11:11:43 Re: [HACKERS] Inherited constraints and search paths (was Re:
Previous Message ITAGAKI Takahiro 2005-05-20 05:41:51 Notification when freespaces empty