Re: Syntax for partitioning

From: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Syntax for partitioning
Date: 2009-10-30 01:51:12
Message-ID: 20091030105111.F5FB.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


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?

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-10-30 02:14:13 Re: Syntax for partitioning
Previous Message Greg Stark 2009-10-29 23:52:13 Re: WIP: push AFTER-trigger execution into ModifyTable node