Re: [HACKERS] Syntax for partitioning

2011-11-16 Thread Dimitri Fontaine
Martijn van Oosterhout klep...@svana.org writes: That said, I still don't see how you can enforce a unique index over multiple segments over something other than the partition key while still allowing quick dropping of segments. If you can fix that you can make it work for the current

Re: [HACKERS] Syntax for partitioning

2011-11-14 Thread Dimitri Fontaine
Tom Lane t...@sss.pgh.pa.us writes: to match the desired granularity of data removal. I don't really see any way that the database can be expected to know what that is, unless it's told in advance. So AFAICS you really have to have a declarative way of telling it how to do the partitioning

Re: [HACKERS] Syntax for partitioning

2011-11-14 Thread Dimitri Fontaine
Martijn van Oosterhout klep...@svana.org writes: While I agree that explicit partitioning is somewhat of a hack, it's a really useful hack. But for me the most important use of partitioning is dropping a billion rows efficiently and getting the disk space back. And the biggest problem is

Re: [HACKERS] Syntax for partitioning

2011-11-14 Thread Martijn van Oosterhout
On Mon, Nov 14, 2011 at 10:33:36AM +0100, Dimitri Fontaine wrote: Martijn van Oosterhout klep...@svana.org writes: While I agree that explicit partitioning is somewhat of a hack, it's a really useful hack. But for me the most important use of partitioning is dropping a billion rows

Re: [HACKERS] Syntax for partitioning

2011-11-12 Thread Martijn van Oosterhout
On Thu, Nov 10, 2011 at 10:19:02PM +0100, Dimitri Fontaine wrote: Now the aim would be to be able to implement the operation you describe by using the new segment map, which is an index pointing to sequential ranges of on-disk blocks where the data is known to share a common key range over the

Re: [HACKERS] Syntax for partitioning

2011-11-12 Thread Tom Lane
Martijn van Oosterhout klep...@svana.org writes: While I agree that explicit partitioning is somewhat of a hack, it's a really useful hack. But for me the most important use of partitioning is dropping a billion rows efficiently and getting the disk space back. Right. The only way to make

Re: [HACKERS] Syntax for partitioning

2011-11-10 Thread Dimitri Fontaine
Jeff Janes jeff.ja...@gmail.com writes: shouldn't it need a DBA to declare it? How is the system supposed to anticipate that at some point years in the future I will want to run the command sequence create foo_archive as select from foo where year2009; delete from foo where year2009, or its

Re: [HACKERS] Syntax for partitioning

2011-11-10 Thread Daniel Farina
On Thu, Nov 10, 2011 at 1:19 PM, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Now the aim would be to be able to implement the operation you describe by using the new segment map, which is an index pointing to sequential ranges of on-disk blocks where the data is known to share a common key

Re: [HACKERS] Syntax for partitioning

2011-11-09 Thread Thom Brown
On 15 December 2009 02:31, Jaime Casanova jcasa...@systemguards.com.ec wrote: On Mon, Dec 14, 2009 at 7:29 PM, Simon Riggs si...@2ndquadrant.com wrote: On Fri, 2009-12-04 at 09:00 +, Simon Riggs wrote: On Fri, 2009-12-04 at 11:54 +0900, Itagaki Takahiro wrote: Here is an update

Re: [HACKERS] Syntax for partitioning

2011-11-09 Thread Jaime Casanova
On Wed, Nov 9, 2011 at 8:26 AM, Thom Brown t...@linux.com wrote: So will this be revived any time soon?  Were there any subsequent proposals which were posted? there was an updated patch, you can find in this thread:

Re: [HACKERS] Syntax for partitioning

2011-11-09 Thread Robert Haas
On Wed, Nov 9, 2011 at 9:35 AM, Jaime Casanova ja...@2ndquadrant.com wrote: On Wed, Nov 9, 2011 at 8:26 AM, Thom Brown t...@linux.com wrote: So will this be revived any time soon?  Were there any subsequent proposals which were posted? there was an updated patch, you can find in this

Re: [HACKERS] Syntax for partitioning

2011-11-09 Thread Thom Brown
On 9 November 2011 15:15, Robert Haas robertmh...@gmail.com wrote: On Wed, Nov 9, 2011 at 9:35 AM, Jaime Casanova ja...@2ndquadrant.com wrote: On Wed, Nov 9, 2011 at 8:26 AM, Thom Brown t...@linux.com wrote: So will this be revived any time soon?  Were there any subsequent proposals which

Re: [HACKERS] Syntax for partitioning

2011-11-09 Thread Dimitri Fontaine
Thom Brown t...@linux.com writes: Whenever I cross the topic of partitioning in PostgreSQL, it's always a tad embarrassing to explain that it's still hacky compared to other database systems (and this came up again last week), so this is of particular interest to me. At The more I think

Re: [HACKERS] Syntax for partitioning

2011-11-09 Thread Thom Brown
On 9 November 2011 21:05, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Thom Brown t...@linux.com writes: Whenever I cross the topic of partitioning in PostgreSQL, it's always a tad embarrassing to explain that it's still hacky compared to other database systems (and this came up again last

Re: [HACKERS] Syntax for partitioning

2011-11-09 Thread Greg Smith
On 11/09/2011 04:05 PM, Dimitri Fontaine wrote: The more I think about this problem, the more I think that the reason why we still don't have declarative partitioning is that it basically sucks. I think that we don't have it because no one has ever dumped the much larger than might be

Re: [HACKERS] Syntax for partitioning

2011-11-09 Thread Jeff Janes
On Wed, Nov 9, 2011 at 1:05 PM, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Thom Brown t...@linux.com writes: Whenever I cross the topic of partitioning in PostgreSQL, it's always a tad embarrassing to explain that it's still hacky compared to other database systems (and this came up again

Re: [HACKERS] Syntax for partitioning

2009-12-14 Thread Simon Riggs
On Fri, 2009-12-04 at 09:00 +, Simon Riggs wrote: On Fri, 2009-12-04 at 11:54 +0900, Itagaki Takahiro wrote: Here is an update partitioning syntax patch. A bug reported by Marko is fixed. I will review and eventually commit this, if appropriate, though it is 3rd in my queue and

Re: [HACKERS] Syntax for partitioning

2009-12-14 Thread Jaime Casanova
On Mon, Dec 14, 2009 at 7:29 PM, Simon Riggs si...@2ndquadrant.com wrote: On Fri, 2009-12-04 at 09:00 +, Simon Riggs wrote: On Fri, 2009-12-04 at 11:54 +0900, Itagaki Takahiro wrote: Here is an update partitioning syntax patch. A bug reported by Marko is fixed. I will review and

Re: [HACKERS] Syntax for partitioning

2009-12-06 Thread Greg Smith
Simon Riggs wrote: I will review and eventually commit this, if appropriate, though it is 3rd in my queue and will probably not be done for at least 2 weeks, possibly 4 weeks. I've marked Simon as the next reviewer and expected committer on this patch and have updated it to Returned with

Re: [HACKERS] Syntax for partitioning

2009-12-06 Thread Itagaki Takahiro
Greg Smith g...@2ndquadrant.com wrote: I've marked Simon as the next reviewer and expected committer on this patch and have updated it to Returned with Feedback. OK. I'll re-submit improved patches in the next commit fest. Regards, --- ITAGAKI Takahiro NTT Open Source Software Center --

Re: [HACKERS] Syntax for partitioning

2009-12-04 Thread Simon Riggs
On Fri, 2009-12-04 at 11:54 +0900, Itagaki Takahiro wrote: Here is an update partitioning syntax patch. A bug reported by Marko is fixed. I will review and eventually commit this, if appropriate, though it is 3rd in my queue and will probably not be done for at least 2 weeks, possibly 4

Re: [HACKERS] Syntax for partitioning

2009-11-24 Thread Emmanuel Cecchet
Hi, Sorry for commenting only now but I think that we need to be able to store the partitions in different tablespaces. Even if originally the create table creates all partitions in the same tablespace, individual partitions should be allowed to be moved in different tablespaces using alter

Re: [HACKERS] Syntax for partitioning

2009-11-24 Thread Itagaki Takahiro
Emmanuel Cecchet m...@asterdata.com wrote: I think that other databases allows the user to define a tablespace for each partition in the create table statement. WITH and TABLESPACE clause are supported for each partition. =# CREATE TABLE parent (...) PARTITION BY (key) (

Re: [HACKERS] Syntax for partitioning

2009-11-24 Thread Greg Smith
I just made a few updates to http://wiki.postgresql.org/wiki/Table_partitioning , merging in the stuff that had been on the ToDo page and expanding the links to discussion on this list a bit. The number of submitted patches over the last couple of years that handle some subset of the desired

Re: [HACKERS] Syntax for partitioning

2009-11-24 Thread Emmanuel Cecchet
Greg Smith wrote: I just made a few updates to http://wiki.postgresql.org/wiki/Table_partitioning , merging in the stuff that had been on the ToDo page and expanding the links to discussion on this list a bit. The number of submitted patches over the last couple of years that handle some

Re: [HACKERS] Syntax for partitioning

2009-11-24 Thread Itagaki Takahiro
Emmanuel Cecchet m...@asterdata.com wrote: Should we add the 'WITH (...) TABLESPACE tbs' options to the syntax since they are supported? Added the description. Do we support ALTER ... SET TABLESPACE? DROP/ALTER PARTITION are synonyms for DROP/ALTER TABLE. SET TABLESPACE is also supported.

Re: [HACKERS] Syntax for partitioning

2009-11-20 Thread Robert Haas
On Fri, Nov 20, 2009 at 2:08 AM, Simon Riggs si...@2ndquadrant.com wrote: On Thu, 2009-11-19 at 10:53 -0500, Robert Haas wrote: On Thu, Nov 19, 2009 at 9:58 AM, Markus Wanner mar...@bluegap.ch wrote: Hi, Robert Haas wrote: Settling on a syntax, and an internal representation for that

Re: [HACKERS] Syntax for partitioning

2009-11-19 Thread Markus Wanner
Hi, Robert Haas wrote: Settling on a syntax, and an internal representation for that syntax, I've been under the impression that this was only about syntax. What are the internal additions? Generally speaking, I'd agree with Simon or even vote for doing the internals first and add the

Re: [HACKERS] Syntax for partitioning

2009-11-19 Thread Robert Haas
On Thu, Nov 19, 2009 at 9:58 AM, Markus Wanner mar...@bluegap.ch wrote: Hi, Robert Haas wrote: Settling on a syntax, and an internal representation for that syntax, I've been under the impression that this was only about syntax. What are the internal additions? I haven't looked at it in

Re: [HACKERS] Syntax for partitioning

2009-11-19 Thread Peter Eisentraut
On ons, 2009-11-18 at 13:52 +0900, Itagaki Takahiro wrote: partinfo = (PartitionInfo *) malloc(ntups * sizeof(PartitionInfo)); Oops, it should be palloc. Thanks. A very low-level comment: 1) Please stop casting the results of palloc and malloc. We are not writing C++ here. 2) I would

Re: [HACKERS] Syntax for partitioning

2009-11-19 Thread Nikhil Sontakke
Hi, partinfo = (PartitionInfo *) malloc(ntups * sizeof(PartitionInfo)); 1) Please stop casting the results of palloc and malloc.  We are not writing C++ here. I thought it was/is a good C programming practice to typecast (void *) always to the returning structure type!! Regards, Nikhils

Re: [HACKERS] Syntax for partitioning

2009-11-19 Thread Peter Eisentraut
On fre, 2009-11-20 at 11:14 +0530, Nikhil Sontakke wrote: Hi, partinfo = (PartitionInfo *) malloc(ntups * sizeof(PartitionInfo)); 1) Please stop casting the results of palloc and malloc. We are not writing C++ here. I thought it was/is a good C programming practice to typecast

Re: [HACKERS] Syntax for partitioning

2009-11-19 Thread Tom Lane
Nikhil Sontakke nikhil.sonta...@enterprisedb.com writes: partinfo = (PartitionInfo *) malloc(ntups * sizeof(PartitionInfo)); 1) Please stop casting the results of palloc and malloc.  We are not writing C++ here. I thought it was/is a good C programming practice to typecast (void *) always

Re: [HACKERS] Syntax for partitioning

2009-11-19 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: 2) I would prefer that you apply sizeof on the variable, not on the type. That way, the expression is independent of any type changes of the variable, and can be reviewed without having to scroll around for the variable definition. FWIW, I think the

Re: [HACKERS] Syntax for partitioning

2009-11-19 Thread Simon Riggs
On Thu, 2009-11-19 at 10:53 -0500, Robert Haas wrote: On Thu, Nov 19, 2009 at 9:58 AM, Markus Wanner mar...@bluegap.ch wrote: Hi, Robert Haas wrote: Settling on a syntax, and an internal representation for that syntax, I've been under the impression that this was only about syntax.

Re: [HACKERS] Syntax for partitioning

2009-11-18 Thread Simon Riggs
On Wed, 2009-11-18 at 13:24 +0900, Itagaki Takahiro wrote: Simon Riggs si...@2ndquadrant.com wrote: Why not just wait until we have a whole patch and then apply? A whole patch can be written by many contributers instead of only one person, no? I think we need to split works for

Re: [HACKERS] Syntax for partitioning

2009-11-17 Thread Marko Tiikkaja
Hi, I'm reviewing your patch. The patch applies without problems and the feature works as advertised. I have yet to look at the code in detail, but it looks sane and seems to work. However, this looks like a mistake: partinfo = (PartitionInfo *) malloc(ntups * sizeof(PartitionInfo)); or am

Re: [HACKERS] Syntax for partitioning

2009-11-17 Thread Jaime Casanova
On Thu, Nov 12, 2009 at 5:54 AM, Itagaki Takahiro itagaki.takah...@oss.ntt.co.jp wrote: I added psql and pg_dump support to Partitioning Syntax patch. Paritioning information can be retrieved with a new system function pg_get_partitiondef(parentRelid). Both psql and pg_dump use it. i haven't

Re: [HACKERS] Syntax for partitioning

2009-11-17 Thread Marko Tiikkaja
Jaime Casanova wrote: * If a table with the same name already exists when a partition is created, the table is re-used as partition. This behavior is required for pg_dump to be simple. i guess the table must be empty, if not we should be throw an error... and i actually prefer some

Re: [HACKERS] Syntax for partitioning

2009-11-17 Thread Simon Riggs
On Thu, 2009-10-29 at 11:15 +0900, Itagaki Takahiro wrote: I think syntax support is a good start. I don't see a syntax-only patch as being any use at all to this community. We go to enormous lengths in other areas to never allow patches with restrictions. Why would we allow a patch that is

Re: [HACKERS] Syntax for partitioning

2009-11-17 Thread Robert Haas
On Tue, Nov 17, 2009 at 4:31 PM, Simon Riggs si...@2ndquadrant.com wrote: On Thu, 2009-10-29 at 11:15 +0900, Itagaki Takahiro wrote: I think syntax support is a good start. I don't see a syntax-only patch as being any use at all to this community. We go to enormous lengths in other areas

Re: [HACKERS] Syntax for partitioning

2009-11-17 Thread Itagaki Takahiro
Marko Tiikkaja marko.tiikk...@cs.helsinki.fi wrote: Jaime Casanova wrote: PARTITION name VALUES LESS THAN { range_upper | MAXVALUE } | PARTITION name VALUES IN ( list_value [,...] | DEFAULT ) i remember someone making a comment about actually using operators instead of LESS

Re: [HACKERS] Syntax for partitioning

2009-11-17 Thread Itagaki Takahiro
Simon Riggs si...@2ndquadrant.com wrote: Why not just wait until we have a whole patch and then apply? A whole patch can be written by many contributers instead of only one person, no? I think we need to split works for partitioning into serveral parts to encourage developing it. I just did

Re: [HACKERS] Syntax for partitioning

2009-11-17 Thread Itagaki Takahiro
Jaime Casanova jcasa...@systemguards.com.ec wrote: * If a table with the same name already exists when a partition is created, the table is re-used as partition. This behavior is required for pg_dump to be simple. i guess the table must be empty, if not we should be throw an

Re: [HACKERS] Syntax for partitioning

2009-11-17 Thread Itagaki Takahiro
Marko Tiikkaja marko.tiikk...@cs.helsinki.fi wrote: this looks like a mistake: partinfo = (PartitionInfo *) malloc(ntups * sizeof(PartitionInfo)); Oops, it should be palloc. Thanks. Maybe we should use something like PARTITION bar VALUES OPERATOR 0 when the user specifies the operator? I

Re: [HACKERS] Syntax for partitioning

2009-11-01 Thread Itagaki Takahiro
Devrim GNDZ dev...@gunduz.org wrote: Is this the same as / similar to Oracle's syntax? Yes. IIRC Nikhil's patch was Oracle's syntax No. See: http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_7002.htm#i2125922 Regards, --- ITAGAKI Takahiro NTT Open Source Software

Re: [HACKERS] Syntax for partitioning

2009-11-01 Thread Nikhil Sontakke
Hi, Is this the same as / similar to Oracle's syntax? Yes. IIRC Nikhil's patch was Oracle's syntax No. See: http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_7002.htm#i2125922 Any decent prevalent partitioning syntax should be ok IMHO. IIRC, MySQL paritioning

Re: [HACKERS] Syntax for partitioning

2009-10-30 Thread Peter Eisentraut
On Thu, 2009-10-29 at 15:19 -0700, Jeff Davis wrote: I can't help but wonder if the PERIOD type might be better for representing a partition range. It would make it easier to express and enforce the constraint that no two partition ranges overlap ;) I can't help but wonder if the period type

Re: [HACKERS] Syntax for partitioning

2009-10-30 Thread Devrim GÜNDÜZ
On Thu, 2009-10-29 at 11:15 +0900, Itagaki Takahiro wrote: I'd like to improve partitioning feature in 8.5. Nice. Here is syntax I propose: snip Is this the same as / similar to Oracle's syntax? IIRC Nikhil's patch was Oracle's syntax, and I prefer having that one instead of inventing our

Re: [HACKERS] Syntax for partitioning

2009-10-30 Thread Jeff Davis
On Fri, 2009-10-30 at 10:03 +0200, Peter Eisentraut wrote: I can't help but wonder if the period type might better be a generic container for pairs of scalar, totally-ordered types. That would be ideal. However, it doesn't really look like our type system was built to handle that kind of thing.

Re: [HACKERS] Syntax for partitioning

2009-10-30 Thread pg
PARTITION BY RANGE ( a_expr ) ... PARTITION BY HASH ( a_expr ) PARTITIONS num_partitions; Unless someone comes up with a maintenance plan for stable hashfunctions, we should probably not dare look into this yet. What would cover the common use case of per-day quals and drops over an

Re: [HACKERS] Syntax for partitioning

2009-10-30 Thread Heikki Linnakangas
Jeff Davis wrote: On Fri, 2009-10-30 at 10:03 +0200, Peter Eisentraut wrote: I can't help but wonder if the period type might better be a generic container for pairs of scalar, totally-ordered types. That would be ideal. However, it doesn't really look like our type system was built to

Re: [HACKERS] Syntax for partitioning

2009-10-30 Thread Jeff Davis
On Fri, 2009-10-30 at 19:12 +0200, Heikki Linnakangas wrote: Wait, it doesn't? A typmod is a 32-bit integer, like Oids. Am I missing something? Oid is unsigned, typmod is signed. We might be able to get away with it, but -1 is treated specially in some places outside of the type-specific

Re: [HACKERS] Syntax for partitioning

2009-10-30 Thread Stephen Frost
* Jeff Davis (pg...@j-davis.com) wrote: Oid is unsigned, typmod is signed. We might be able to get away with it, but -1 is treated specially in some places outside of the type-specific functions, e.g. exprTypmod(). Any negative result returned from the input handling function is considered an

Re: [HACKERS] Syntax for partitioning

2009-10-30 Thread Tom Lane
Jeff Davis pg...@j-davis.com writes: I haven't looked at all of these places yet, so maybe a few simple changes would allow us to treat typmod as a full 32 bits. Or perhaps it could just be expanded to a signed 64-bit int. What do you think? Neither is likely to happen, and even disregarding

Re: [HACKERS] Syntax for partitioning

2009-10-30 Thread Robert Haas
On Fri, Oct 30, 2009 at 5:16 PM, Tom Lane t...@sss.pgh.pa.us wrote: Jeff Davis pg...@j-davis.com writes: I haven't looked at all of these places yet, so maybe a few simple changes would allow us to treat typmod as a full 32 bits. Or perhaps it could just be expanded to a signed 64-bit int.

Re: [HACKERS] Syntax for partitioning

2009-10-30 Thread Jeff Davis
On Fri, 2009-10-30 at 17:39 -0400, Robert Haas wrote: IMO, the real problem is that the type interface is poorly encapsulated. There's way too much code that knows about the internal details of a type - namely, that it's a 32-bit integer modified by a second 32-bit integer. I think there are

Re: [HACKERS] Syntax for partitioning

2009-10-30 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: IMO, the real problem is that the type interface is poorly encapsulated. There's way too much code that knows about the internal details of a type - namely, that it's a 32-bit integer modified by a second 32-bit integer. I think there are still

Re: [HACKERS] Syntax for partitioning

2009-10-29 Thread Nikhil Sontakke
Hi, So, I'll take over the work if there are no ones to do it. I'm thinking to add syntax support first. Table partitioning was proposed many times, but it is still not applied into core. The reason is it is too difficult to make perfect partitioning feature at once. I think syntax support

Re: [HACKERS] Syntax for partitioning

2009-10-29 Thread Grzegorz Jaskiewicz
On 29 Oct 2009, at 02:15, Itagaki Takahiro wrote: I'd like to improve partitioning feature in 8.5. Kedar-san's previous work is wonderful, but I cannot see any updated patch. http://archives.postgresql.org/message-id/bd8134a40906080702s96c90a9q3bbb581b9bd0d...@mail.gmail.com So, I'll take

Re: [HACKERS] Syntax for partitioning

2009-10-29 Thread Heikki Linnakangas
Itagaki Takahiro 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. -- Heikki

Re: [HACKERS] Syntax for partitioning

2009-10-29 Thread Greg Stark
On Thu, Oct 29, 2009 at 3:35 AM, Nikhil Sontakke nikhil.sonta...@enterprisedb.com wrote: So +1 on solidifying the syntax first and then sorting out the other minute, intricate details later.. I like that idea as well but I have a concern. What will we do with pg_dump. If the PARTITION commands

Re: [HACKERS] Syntax for partitioning

2009-10-29 Thread Andres Freund
On Thursday 29 October 2009 18:33:22 Greg Stark wrote: On Thu, Oct 29, 2009 at 3:35 AM, Nikhil Sontakke nikhil.sonta...@enterprisedb.com wrote: So +1 on solidifying the syntax first and then sorting out the other minute, intricate details later.. I like that idea as well but I have a

Re: [HACKERS] Syntax for partitioning

2009-10-29 Thread Peter Eisentraut
On tor, 2009-10-29 at 11:15 +0900, Itagaki Takahiro wrote: Range partitioning: CREATE TABLE table_name ( columns ) PARTITION BY RANGE ( a_expr ) ( PARTITION name VALUES LESS THAN [(] const [)], PARTITION name VALUES LESS THAN [(] MAXVALUE [)] -- overflow partition

Re: [HACKERS] Syntax for partitioning

2009-10-29 Thread Jeff Davis
On Fri, 2009-10-30 at 00:10 +0200, Peter Eisentraut wrote: On tor, 2009-10-29 at 11:15 +0900, Itagaki Takahiro wrote: Range partitioning: CREATE TABLE table_name ( columns ) PARTITION BY RANGE ( a_expr ) ( PARTITION name VALUES LESS THAN [(] const [)], PARTITION

Re: [HACKERS] Syntax for partitioning

2009-10-29 Thread Itagaki Takahiro
Heikki Linnakangas heikki.linnakan...@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

Re: [HACKERS] Syntax for partitioning

2009-10-29 Thread Robert Haas
On Thu, Oct 29, 2009 at 9:51 PM, Itagaki Takahiro itagaki.takah...@oss.ntt.co.jp wrote: Heikki Linnakangas heikki.linnakan...@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

Re: [HACKERS] Syntax for partitioning

2009-10-29 Thread Itagaki Takahiro
Peter Eisentraut pete...@gmx.net wrote: On tor, 2009-10-29 at 11:15 +0900, Itagaki Takahiro wrote: Range partitioning: CREATE TABLE table_name ( columns ) PARTITION BY RANGE ( a_expr ) ( PARTITION name VALUES LESS THAN [(] const [)], PARTITION name VALUES LESS

Re: [HACKERS] Syntax for partitioning

2009-10-29 Thread Greg Stark
On Thu, Oct 29, 2009 at 7:14 PM, Robert Haas robertmh...@gmail.com wrote: 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

Re: [HACKERS] Syntax for partitioning

2009-10-29 Thread Itagaki Takahiro
Greg Stark gsst...@mit.edu wrote: * ALTER TABLE ... DROP [COLUMN] name [CASCADE | RESTRICT] * ALTER TABLE ... DROP PARTITION name [CASCADE | RESTRICT] Do we need a DROP PARTITION command at all? What would it even do? Currently no. So, it would be good to treat PARTITION as just a

Re: [HACKERS] Syntax for partitioning

2009-10-28 Thread Pavel Stehule
2009/10/29 Itagaki Takahiro itagaki.takah...@oss.ntt.co.jp: I'd like to improve partitioning feature in 8.5. Kedar-san's previous work is wonderful, but I cannot see any updated patch. http://archives.postgresql.org/message-id/bd8134a40906080702s96c90a9q3bbb581b9bd0d...@mail.gmail.com So,