Re: [HACKERS] Multi-table-unique-constraint

2005-11-13 Thread Andrew Dunstan
Tom Lane wrote: Matt Newell <[EMAIL PROTECTED]> writes: BTW, i'm on the list now, so no need to cc me. Common practice around here is to cc people anyway --- this has grown out of a history of occasionally-slow list mail delivery. If you don't want it, best to fix it in your mail f

Re: [HACKERS] Multi-table-unique-constraint

2005-11-13 Thread Tom Lane
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes: > Maybe the solution is to make inherited tables actually the same table, > and jank it with an extra per-row attribute to differentiate them or > something :) Aside from destroying the inheritance-for-partitioning stuff, this wouldn't work for

Re: [HACKERS] Multi-table-unique-constraint

2005-11-12 Thread Christopher Kings-Lynne
Most of the people who have thought about this have figured that the right solution involves a single index spanning multiple tables (hence, adding a table ID to the index entry headers in such indexes). This fixes the lookup and entry problems, but it's not any help for the lock-against-schema-m

Re: [HACKERS] Multi-table-unique-constraint

2005-11-11 Thread Tom Lane
Matt Newell <[EMAIL PROTECTED]> writes: > On Friday 11 November 2005 11:07, you wrote: >> 1. How do you avoid deadlock among multiple processes all doing the >> above for similar (same page anyway) keys? > Isn't all that is required is that they iterate through the indexes in the > same order. Y

Re: [HACKERS] Multi-table-unique-constraint

2005-11-11 Thread Matt Newell
On Friday 11 November 2005 11:07, you wrote: > It's an idea, but you are now staring directly into the hornet's nest: > > 1. How do you avoid deadlock among multiple processes all doing the >above for similar (same page anyway) keys? It's difficult if not >impossible to ensure that they'l

Re: [HACKERS] Multi-table-unique-constraint

2005-11-11 Thread Tom Lane
Matt Newell <[EMAIL PROTECTED]> writes: > Would it be possible to make another routine that locates and aquires > a write lock on the page where the key would be inserted in each > index(for each table in the inheritance), and holds all these locks > until the key is inserted into the correct index

[HACKERS] Multi-table-unique-constraint

2005-11-11 Thread Matt Newell
On Thursday 10 November 2005 15:58, you wrote: > >> The multi-table-unique-constraint problem has to > >> be solved before we can even think much about multi-table FKs :-( > > > > Do you have ideas about how this should be solved? > > There's some discussions in the pghackers archives --- look for