On 2017/02/16 10:45, Amit Langote wrote:
> Also attaching 0002 (unchanged) for tab-completion support for the new
> partitioning syntax.
Robert already spawned a new thread titled "tab completion for
partitioning" for this [0].
> 0003 changes how ExecFindPartition() shows the row for which
> get_partition_for_tuple() failed to find a partition. As Simon commented
> upthread, we should show just the partition key, not the whole row in the
> error DETAIL. So the DETAIL now looks like what's shown by
> _bt_check_unique() upon uniqueness violation:
>
> DETAIL: Partition key of the failing row contains (key1, key2, ...)=(val1,
> val2, ...)
>
> The rules about which columns to show or whether to show the DETAIL at all
> are similar to those in BuildIndexValueDescription():
>
> - if user has SELECT privilege on the whole table, simply go ahead
>
> - if user doesn't have SELECT privilege on the table, check that they
> can see all the columns in the key (no point in showing partial key);
> however abort on finding an expression for which we don't try finding
> out privilege situation of whatever columns may be in the expression
I posted this patch in a new thread titled "error detail when partition
not found" [1].
Thanks,
Amit
[0]
https://www.postgresql.org/message-id/CA+TgmobYOj=A8GesiEs_V2Wq46-_w0+7MOwPiNWC+iuzJ-uWjA@mail.gmail.com
[1]
https://www.postgresql.org/message-id/9f9dc7ae-14f0-4a25-5485-964d9bfc19bd%40lab.ntt.co.jp