From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> |
Cc: | Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Syntax for partitioning |
Date: | 2009-10-30 02:14:13 |
Message-ID: | 603c8f070910291914i72b03d37kacadb0eabe3aeab@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Oct 29, 2009 at 9:51 PM, Itagaki Takahiro
<itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> wrote:
>
> Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>
>> > The keyword "PARTITION" is
>> > added to the full-reserved keyword list to support ADD/DROP PARTITION.
>>
>> Any chance to avoid that? PARTITION seems like something people might
>> well use as a column or variable name. OTOH, it is reserved in SQL2008
>> and SQL2003.
>
> CREATE TABLE does not require PARTITION to be a reserved keyword,
> but there are conflicts in ALTER TABLE ADD/DROP PARTITION:
>
> * ALTER TABLE ... DROP [COLUMN] name [CASCADE | RESTRICT]
> * ALTER TABLE ... DROP PARTITION name [CASCADE | RESTRICT]
>
> There are some solutions:
>
> 1. Change COLUMN not to an optional word (unlikely)
> 2. Change syntax of DROP PARTITION to DROP TABLE PARITION or so
> 3. Change ALTER TABLE ADD/DROP PARTITION to top level
> => CREATE/DROP PARTITION name ON table_name
>
> Any better ideas?
I'm not sure if this is better, but what about:
CREATE PARTITION name ON TABLE name
DROP PARTITION name
Since partitions will live in pg_class and are in some sense "top
level" objects, it seems like it would make sense to use a syntax that
is similar to the one we use for indices... we can't say "DROP COLUMN
name", because the table must be specified. But a partition name must
be unambiguous, so making the user write it out explicitly doesn't
seem friendly.
...Robert
From | Date | Subject | |
---|---|---|---|
Next Message | Itagaki Takahiro | 2009-10-30 03:03:10 | Re: Syntax for partitioning |
Previous Message | Itagaki Takahiro | 2009-10-30 01:51:12 | Re: Syntax for partitioning |