Re: Syntax for partitioning - Mailing list pgsql-hackers

From Itagaki Takahiro
Subject Re: Syntax for partitioning
Date
Msg-id 20091030105111.F5FB.52131E4D@oss.ntt.co.jp
Whole thread Raw
In response to Re: Syntax for partitioning  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Syntax for partitioning  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.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 so3.
ChangeALTER 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




pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: WIP: push AFTER-trigger execution into ModifyTable node
Next
From: Robert Haas
Date:
Subject: Re: Syntax for partitioning