Add CLUSTER ON to pg_dumps

Started by Christopher Kings-Lynneover 23 years ago5 messagespatches
Jump to latest
#1Christopher Kings-Lynne
chriskl@familyhealth.com.au

Adds

ALTER TABLE foo CLUSTER ON bar;

In pg_dumps, to preserve cluster settings.

Chris

Attachments:

pg_dump.txttext/plain; name=pg_dump.txtDownload+28-4
#2Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: Christopher Kings-Lynne (#1)
Re: Add CLUSTER ON to pg_dumps

On Fri, Mar 21, 2003 at 12:25:17PM +0800, Christopher Kings-Lynne wrote:

+ 				/* 
+ 				 * If the index is clustered, we need to issue a CLUSTER command
+ 				 * since that is the only way of setting indisclustered.
+ 				 */
+ 				if (indisclustered) {
+ 					appendPQExpBuffer(q, "\nALTER TABLE %s CLUSTER", 
+ 								 fmtId(tbinfo->relname));
+ 					appendPQExpBuffer(q, " ON %s;\n", 
+ 								 fmtId(indexrelname));
+ 				}

You forgot to update the comments...

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Escucha y olvidar�s; ve y recordar�s; haz y entender�s" (Confucio)

#3Bruce Momjian
bruce@momjian.us
In reply to: Christopher Kings-Lynne (#1)
Re: Add CLUSTER ON to pg_dumps

Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------

Christopher Kings-Lynne wrote:

Adds

ALTER TABLE foo CLUSTER ON bar;

In pg_dumps, to preserve cluster settings.

Chris

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#4Bruce Momjian
bruce@momjian.us
In reply to: Alvaro Herrera (#2)
Re: Add CLUSTER ON to pg_dumps

I will make this adjustment to the patch.

---------------------------------------------------------------------------

Alvaro Herrera wrote:

On Fri, Mar 21, 2003 at 12:25:17PM +0800, Christopher Kings-Lynne wrote:

+ 				/* 
+ 				 * If the index is clustered, we need to issue a CLUSTER command
+ 				 * since that is the only way of setting indisclustered.
+ 				 */
+ 				if (indisclustered) {
+ 					appendPQExpBuffer(q, "\nALTER TABLE %s CLUSTER", 
+ 								 fmtId(tbinfo->relname));
+ 					appendPQExpBuffer(q, " ON %s;\n", 
+ 								 fmtId(indexrelname));
+ 				}

You forgot to update the comments...

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Escucha y olvidar?s; ve y recordar?s; haz y entender?s" (Confucio)

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#5Bruce Momjian
bruce@momjian.us
In reply to: Christopher Kings-Lynne (#1)
Re: Add CLUSTER ON to pg_dumps

Patch applied. Thanks.

I updated the comments as mentioned by Alvaro.

---------------------------------------------------------------------------

Christopher Kings-Lynne wrote:

Adds

ALTER TABLE foo CLUSTER ON bar;

In pg_dumps, to preserve cluster settings.

Chris

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073