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 1fzudh-0007Ca-Pd for pgsql-general@arkaria.postgresql.org; Wed, 12 Sep 2018 02:12:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fzudd-00075I-6k for pgsql-general@arkaria.postgresql.org; Wed, 12 Sep 2018 02:12:17 +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 1fzudc-00075A-Tj for pgsql-general@lists.postgresql.org; Wed, 12 Sep 2018 02:12:16 +0000 Received: from chocolate.concordia.psi.br ([189.91.194.3]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fzudS-0003o5-Lp for pgsql-general@lists.postgresql.org; Wed, 12 Sep 2018 02:12:13 +0000 Received: from Marcio (unknown [186.226.37.77]) (Authenticated sender: marcio@zyontecnologia.com.br) by chocolate.concordia.psi.br (Postfix) with ESMTPA id 5276C1000C2B for ; Tue, 11 Sep 2018 23:11:58 -0300 (BRT) From: =?iso-8859-1?Q?M=E1rcio_Ant=F4nio_Sepp?= To: Subject: Table cannot be partiotioned using domain in argument Date: Tue, 11 Sep 2018 23:11:57 -0300 Message-ID: <012d01d44a3d$fb7c6100$f2752300$@com.br> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_012E_01D44A24.D62F2900" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AdRKPftc/sZisp+YQa6YRR3hQwmv9A== Content-Language: pt-br List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. ------=_NextPart_000_012E_01D44A24.D62F2900 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable =20 Hi, =20 =20 This query works fine: =20 create table t1 (d date) PARTITION BY RANGE (d); CREATE TABLE t1_p1 PARTITION OF t1 FOR VALUES FROM ('2000-01-01') TO ('2019-01-01'); =20 =20 =20 Same query, but now (using domain): =20 CREATE DOMAIN ddate AS date; =20 create table t1 (d ddate) PARTITION BY RANGE (d); CREATE TABLE t1_p1 PARTITION OF t1 FOR VALUES FROM ('2000-01-01') TO ('2019-01-01'); =20 The follow error occur: =20 SQL Error [42804]: ERROR: specified value cannot be cast to type ddate = for column "d" Detalhe: The cast requires a non-immutable conversion. Dica: Try putting the literal value in single quotes. Posi=E7=E3o: 55 =20 I cannot use domain in this case? =20 =20 Thanks in advance! =20 -- Att M=E1rcio=20 =20 ------=_NextPart_000_012E_01D44A24.D62F2900 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

 

Hi,

 

 

This query = works fine:

 <= /o:p>

create = table= = t1

(d = date)

PARTITION = BY = RANGE= = (d);

CREATE = TABLE= = t1_p1 PARTITION = OF t1 = FOR = VALUES = FROM<= /b> = ('2000-01-01'<= /span>) = TO = ('2019-01-01'<= /span>);

 

 

 

Same query, = but now (using domain):

 <= /o:p>

CREATE = DOMAIN = ddate

=A0=A0=A0 = AS = date;

 <= /p>

create = table= = t1

(d = ddate)

PARTITION = BY = RANGE= = (d);

CREATE = TABLE= = t1_p1 PARTITION = OF t1 = FOR = VALUES = FROM<= /b> = ('2000-01-01'<= /span>) = TO = ('2019-01-01'<= /span>);

 

The follow = error occur:

 

SQL Error [42804]: ERROR: specified value cannot be = cast to type ddate for column "d"

=A0 Detalhe: The cast requires a non-immutable = conversion.

=A0 Dica: Try putting the = literal value in single quotes.

=A0 = Posi=E7=E3o: 55

 

I cannot use = domain in this case?

 

 

Thanks in = advance!

 

--

Att

M=E1rcio =

 

------=_NextPart_000_012E_01D44A24.D62F2900--