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

From Tom Lane
Subject Re: [BUGS] BUG #14666: Question on money type as the key of partitioned table
Date
Msg-id 30475.1496005465@sss.pgh.pa.us
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>)
List pgsql-bugs
Michael Paquier <michael.paquier@gmail.com> writes:
> Just mentioning... I found surprising to see that failing with a
> partition error:
> =# create table test(m money) partition by list(m);
> CREATE TABLE
> =#  create table test_1 partition of test for values in (10::money);
> ERROR:  42601: syntax error at or near "::"

Well, this is a misunderstanding of the syntax: the values in the
values list have to be simple literals, not expressions.

However, it's arguably not your fault, because the CREATE TABLE
reference page says that the list elements are "bound_literal"s,
a term which AFAICS is defined nowhere.  I'm inclined to change
that to something like
IN ( { numeric_literal | string_literal | NULL } [, ...] ) 

which seems less likely to leave the reader wondering what is meant.
        regards, tom lane


-- 
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: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14637: Tests fail with pl_PL.UTF-8 locale
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14666: Question on money type as the key of partitioned table