Re: On partitioning

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Greg Stark <stark(at)mit(dot)edu>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: On partitioning
Date: 2014-08-29 17:22:16
Message-ID: 20140829172216.GF10109@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-08-29 13:15:16 -0400, Tom Lane wrote:
> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> > Tom Lane wrote:
> >> One other interesting thought that occurs to me: are we going to support
> >> UPDATEs that cause a row to belong to a different partition? If so, how
> >> are we going to handle the update chain links?
>
> > Bah, I didn't mention it? My current thinking is that it would be
> > disallowed; if you have chosen your partitioning key well enough it
> > shouldn't be necessary. As a workaround you can always DELETE/INSERT.
> > Maybe we can allow it later, but for a first cut this seems more than
> > good enough.
>
> Hm. I certainly agree that it's a case that could be disallowed for a
> first cut, but it'd be nice to have some clue about how we might allow it
> eventually.

Not pretty, but we could set t_ctid to some 'magic' value when switching
partitions. Everything chasing ctid chains could then error out when
hitting a invisible row with such a t_ctid. The usecases for doing such
updates really are more maintenance style commands, so it's possibly not
too bad from a usability POV :(

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-08-29 17:26:37 Inverse of pg_get_serial_sequence?
Previous Message Tom Lane 2014-08-29 17:15:16 Re: On partitioning