Re: virtual generated column as partition key - Mailing list pgsql-hackers

From jian he
Subject Re: virtual generated column as partition key
Date
Msg-id CACJufxFF0iDPU4m5OgJh4rRa5mm09dW9agyjYEzekURZ=4yRbw@mail.gmail.com
Whole thread
In response to Re: virtual generated column as partition key  (jian he <jian.universality@gmail.com>)
Responses Re: virtual generated column as partition key
List pgsql-hackers
Hi.

Rebasing and rechecking the code changes again.

typedef struct PartitionKeyData
{
    PartitionStrategy strategy; /* partitioning strategy */
    int16        partnatts;        /* number of columns in the partition key */
    AttrNumber *partattrs;
    List       *partexprs;
....
}

Normally, a partition key is mutually exclusive: it is either a simple column
(partattrs[i] != 0 and partexprs[i] == NULL) or an expression (partattrs[i] == 0
with partexprs[i] != NULL). However, for virtual generated columns, it's
possible for both to exist (partattrs[i] != 0 and partexprs[i] != NULL).

Because of this scenario, I  have double checked all occurrences of
`->partattrs` in the codebase to ensure partition keys with virtual generated
columns are handled properly.



--
jian
https://www.enterprisedb.com/

Attachment

pgsql-hackers by date:

Previous
From:
Date:
Subject: [BUG + PATCH] DSA pagemap out-of-bounds in make_new_segment odd-sized path
Next
From: John Naylor
Date:
Subject: Re: Need to install liblz4-dev