pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
CLUSTER and SERAIL type
2+ messages / 2 participants
[nested] [flat]

* CLUSTER and SERAIL type
@ 2000-02-11 09:02 Mattias Norlander <mattias@umc.se>
  2000-02-11 15:15 ` Re: [ADMIN] CLUSTER and SERAIL type Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Mattias Norlander @ 2000-02-11 09:02 UTC (permalink / raw)
  To: pgsql-admin

Reading the documentation on CLUSTER I see that 

"all grant permissions and other indexes are lost when clustering is
performed."

What does this really mean? I understand that all indexes and
permissions are gone, but are there other impacts as well?

Seems so to me that this also affects columns of type SERIAL and
columns that defaults to a nextval('sequence'):

--- X ---

[PostgreSQL 6.5.3 on i386-unknown-freebsd3.1, compiled by gcc 2.7.2.1]
...
test=> create table foo (id serial,name text);
NOTICE:  CREATE TABLE will create implicit sequence 'foo_id_seq' for SERIAL column 'foo.id'
NOTICE:  CREATE TABLE/UNIQUE will create implicit index 'foo_id_key' for table 'foo'
CREATE
test=> insert into foo(name) values('blah');
INSERT 25021983 1
test=> insert into foo(name) values('bleh');
INSERT 25021984 1
test=> insert into foo(name) values('bloh');
INSERT 25021985 1
test=> cluster foo_id_key on foo;
CLUSTER
test=> insert into foo(name) values('bluh');
INSERT 25021999 1
test=> select * from foo;
id|name
--+----
 1|blah
 2|bleh
 3|bloh
  |bluh

--- X ---

Grateful for explanations [and|or] workarounds !


-- 
Mattias Norlander
mattias@umc.se







^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [ADMIN] CLUSTER and SERAIL type
  2000-02-11 09:02 CLUSTER and SERAIL type Mattias Norlander <mattias@umc.se>
@ 2000-02-11 15:15 ` Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Bruce Momjian @ 2000-02-11 15:15 UTC (permalink / raw)
  To: Mattias Norlander <mattias@umc.se>; +Cc: pgsql-admin

So it seems it drops column defaults too.  Yikes.  I will add to manual
page.  Peter E. any chance of hacking this as part of DROP COLUMN?

> Reading the documentation on CLUSTER I see that 
> 
> "all grant permissions and other indexes are lost when clustering is
> performed."
> 
> What does this really mean? I understand that all indexes and
> permissions are gone, but are there other impacts as well?
> 
> Seems so to me that this also affects columns of type SERIAL and
> columns that defaults to a nextval('sequence'):
> 
> --- X ---
> 
> [PostgreSQL 6.5.3 on i386-unknown-freebsd3.1, compiled by gcc 2.7.2.1]
> ...
> test=> create table foo (id serial,name text);
> NOTICE:  CREATE TABLE will create implicit sequence 'foo_id_seq' for SERIAL column 'foo.id'
> NOTICE:  CREATE TABLE/UNIQUE will create implicit index 'foo_id_key' for table 'foo'
> CREATE
> test=> insert into foo(name) values('blah');
> INSERT 25021983 1
> test=> insert into foo(name) values('bleh');
> INSERT 25021984 1
> test=> insert into foo(name) values('bloh');
> INSERT 25021985 1
> test=> cluster foo_id_key on foo;
> CLUSTER
> test=> insert into foo(name) values('bluh');
> INSERT 25021999 1
> test=> select * from foo;
> id|name
> --+----
>  1|blah
>  2|bleh
>  3|bloh
>   |bluh
> 
> --- X ---
> 
> Grateful for explanations [and|or] workarounds !
> 
> 
> -- 
> Mattias Norlander
> mattias@umc.se
> 
> 
> 
> 
> 
> ************
> 
> 


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2000-02-11 15:15 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-02-11 09:02 CLUSTER and SERAIL type Mattias Norlander <mattias@umc.se>
2000-02-11 15:15 ` Bruce Momjian <pgman@candle.pha.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox