Thread: CLUSTER in PgAdmin

CLUSTER in PgAdmin

From
Thom Brown
Date:
Hi

How does one run CLUSTER on a table using the PgAdmin GUI? (assuming I
have an index I selected "clustered" on)

-- 
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: CLUSTER in PgAdmin

From
Guillaume Lelarge
Date:
On Sat, 2011-07-02 at 10:23 +0100, Thom Brown wrote:
> Hi
> 
> How does one run CLUSTER on a table using the PgAdmin GUI? (assuming I
> have an index I selected "clustered" on)
> 

AFAICT, you can't. You can add the cluster bit on an index, but that's
all you can do. Seems we missed something that would be interesting to
add in 1.16.


-- 
Guillaume http://blog.guillaume.lelarge.info http://www.dalibo.com



Re: CLUSTER in PgAdmin

From
Thom Brown
Date:
On 2 July 2011 13:11, Guillaume Lelarge <guillaume@lelarge.info> wrote:
> On Sat, 2011-07-02 at 10:23 +0100, Thom Brown wrote:
>> Hi
>>
>> How does one run CLUSTER on a table using the PgAdmin GUI? (assuming I
>> have an index I selected "clustered" on)
>>
>
> AFAICT, you can't. You can add the cluster bit on an index, but that's
> all you can do. Seems we missed something that would be interesting to
> add in 1.16.

Okay, here's a patch for it. (see attached)  Not entirely confident on
the elegance of the code, but had a stab at it.

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment

Re: CLUSTER in PgAdmin

From
Thom Brown
Date:
On 2 July 2011 23:57, Thom Brown <thom@linux.com> wrote:
> On 2 July 2011 13:11, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>> On Sat, 2011-07-02 at 10:23 +0100, Thom Brown wrote:
>>> Hi
>>>
>>> How does one run CLUSTER on a table using the PgAdmin GUI? (assuming I
>>> have an index I selected "clustered" on)
>>>
>>
>> AFAICT, you can't. You can add the cluster bit on an index, but that's
>> all you can do. Seems we missed something that would be interesting to
>> add in 1.16.
>
> Okay, here's a patch for it. (see attached)  Not entirely confident on
> the elegance of the code, but had a stab at it.

Oh, just discovered you can cluster on a primary key or a unique
constraint, so modified it to support those too. (revised patch
attached)

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment

Re: CLUSTER in PgAdmin

From
Guillaume Lelarge
Date:
On Sun, 2011-07-03 at 00:45 +0100, Thom Brown wrote:
> On 2 July 2011 23:57, Thom Brown <thom@linux.com> wrote:
> > On 2 July 2011 13:11, Guillaume Lelarge <guillaume@lelarge.info> wrote:
> >> On Sat, 2011-07-02 at 10:23 +0100, Thom Brown wrote:
> >>> Hi
> >>>
> >>> How does one run CLUSTER on a table using the PgAdmin GUI? (assuming I
> >>> have an index I selected "clustered" on)
> >>>
> >>
> >> AFAICT, you can't. You can add the cluster bit on an index, but that's
> >> all you can do. Seems we missed something that would be interesting to
> >> add in 1.16.
> >
> > Okay, here's a patch for it. (see attached)  Not entirely confident on
> > the elegance of the code, but had a stab at it.
> 
> Oh, just discovered you can cluster on a primary key or a unique
> constraint, so modified it to support those too. (revised patch
> attached)
> 

Seems good to me. I don't see why you're "not entirely confident on the
elegance of the code". Anyway, commited and pushed.

Thanks for this new patch :)


-- 
Guillaume http://blog.guillaume.lelarge.info http://www.dalibo.com