Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fzviA-0001lH-C3 for pgsql-general@arkaria.postgresql.org; Wed, 12 Sep 2018 03:21:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fzvi5-00014s-My for pgsql-general@arkaria.postgresql.org; Wed, 12 Sep 2018 03:20:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fzvi5-00014l-EZ for pgsql-general@lists.postgresql.org; Wed, 12 Sep 2018 03:20:57 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fzvi1-0005fI-Ei for pgsql-general@lists.postgresql.org; Wed, 12 Sep 2018 03:20:57 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w8C3Knq8001189; Tue, 11 Sep 2018 23:20:49 -0400 From: Tom Lane To: =?iso-8859-1?Q?M=E1rcio_Ant=F4nio_Sepp?= cc: pgsql-general@lists.postgresql.org Subject: Re: Table cannot be partiotioned using domain in argument In-reply-to: <012d01d44a3d$fb7c6100$f2752300$@com.br> References: <012d01d44a3d$fb7c6100$f2752300$@com.br> Comments: In-reply-to =?iso-8859-1?Q?M=E1rcio_Ant=F4nio_Sepp?= message dated "Tue, 11 Sep 2018 23:11:57 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1187.1536722449.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 11 Sep 2018 23:20:49 -0400 Message-ID: <1188.1536722449@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =3D?iso-8859-1?Q?M=3DE1rcio_Ant=3DF4nio_Sepp?=3D writes: > The follow error occur: > SQL Error [42804]: ERROR: specified value cannot be cast to type ddate f= or > column "d" > Detalhe: The cast requires a non-immutable conversion. > I cannot use domain in this case? Nope. The problem is suggested, if not exactly clearly explained, by the error message: casting a literal to ddate isn't a guaranteed fixed process. For example, suppose you created this table and then did alter domain ddate add check (value > '2020-01-01'); thereby rendering the partition bound values illegal for the domain. What would you expect to happen then? We might at some point work out plausible semantics for this situation, but it hasn't been done yet. regards, tom lane