Re: [BUGS] BUG #14666: Question on money type as the key ofpartitioned table - Mailing list pgsql-bugs

From Amit Langote
Subject Re: [BUGS] BUG #14666: Question on money type as the key ofpartitioned table
Date
Msg-id CA+HiwqEEGSwPHEkj05q+mOaVWypaf=o8v8HDsPjwCokaqyy42Q@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] BUG #14666: Question on money type as the key ofpartitioned table  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [BUGS] BUG #14666: Question on money type as the key ofpartitioned table  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-bugs
On Wed, May 24, 2017 at 10:54 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Tue, May 23, 2017 at 10:45 PM,  <tianbing@highgo.com> wrote:
>> When I use the money type as the key to create the partition table as
>> follows:
>>
>> postgres=# create table test(m money) partition by list(m);
>> CREATE TABLE
>> postgres=# create table test_1 partition of test for values in (10);
>> CREATE TABLE
>>
>> Partition bounds without apostrophe can be created, but it store the null
>> value,not '10' value.
>>
>> In fact, Correct grammar for creating partition is with apostrophe like
>> this:
>> postgres=# create table test_1 partition of test for values in ('10');
>>
>> But the first creating partition without apostrophe should report an error
>> like "ERROR:  operator does not exist: money = integer"  as adding a check
>> constraint.
>>
>> Looking forward to your reply.
>
> This looks like a justified complain to me, so added to the open item
> list. Those INSERTs should work:
> =# insert into test_1 values (10);
> ERROR:  23514: new row for relation "test_1" violates partition constraint
> DETAIL:  Failing row contains ($10.00).
> LOCATION:  ExecConstraints, execMain.c:2037
> =# insert into test values (10);
> ERROR:  23514: no partition of relation "test" found for row
> DETAIL:  Partition key of the failing row contains (m) = ($10.00).
> LOCATION:  ExecFindPartition, execMain.c:3343
> =# insert into test values ('10');
> ERROR:  23514: no partition of relation "test" found for row
> DETAIL:  Partition key of the failing row contains (m) = ($10.00).
> LOCATION:  ExecFindPartition, execMain.c:3343
> The shape of the partition definition looks broken.

Yep, looks like a bug; will look into it.

Thanks for adding to the open items list.

Regards,
Amit


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

pgsql-bugs by date:

Previous
From: ineyman@perceptron.com
Date:
Subject: [BUGS] BUG #14669: logical replication isn't working
Next
From: mohd.akram@live.com
Date:
Subject: [BUGS] BUG #14670: uuid_generate_v3 and uuid_generate_v5 do not supportbinary names