Re: [HACKERS] Declarative partitioning - another take - Mailing list pgsql-hackers

From Amit Langote
Subject Re: [HACKERS] Declarative partitioning - another take
Date
Msg-id b18028d8-9939-7f9f-3308-621bf5778c4b@lab.ntt.co.jp
Whole thread Raw
In response to Re: [HACKERS] Declarative partitioning - another take  (amul sul <sulamul@gmail.com>)
Responses Re: [HACKERS] Declarative partitioning - another take
List pgsql-hackers
On 2017/02/08 21:20, amul sul wrote:
> Regarding following code in ATExecDropNotNull function, I don't see
> any special check for RANGE partitioned, is it intended to have same
> restriction for LIST partitioned too, I guess not?
> 
>   /*
>      * If the table is a range partitioned table, check that the column is not
>      * in the partition key.
>      */
>     if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
>     {
>         PartitionKey key = RelationGetPartitionKey(rel);
>         int         partnatts = get_partition_natts(key),
>                     i;
> 
>         for (i = 0; i < partnatts; i++)
>         {
>             AttrNumber  partattnum = get_partition_col_attnum(key, i);
> 
>             if (partattnum == attnum)
>                 ereport(ERROR,
>                         (errcode(ERRCODE_INVALID_TABLE_DEFINITION),
>                          errmsg("column \"%s\" is in range partition key",
>                                 colName)));
>         }
>     }

Good catch!  Seems like an oversight, attached fixes it.

Thanks,
Amit

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Erik Rijkers
Date:
Subject: Re: [HACKERS] Logical replication existing data copy
Next
From: Peter Eisentraut
Date:
Subject: [HACKERS] CREATE COLLATION IF NOT EXISTS