Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hj7bt-00054r-G1 for pgsql-general@arkaria.postgresql.org; Thu, 04 Jul 2019 19:41:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hj7bp-0001GR-In for pgsql-general@arkaria.postgresql.org; Thu, 04 Jul 2019 19:41:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hj7bp-00019H-3m for pgsql-general@lists.postgresql.org; Thu, 04 Jul 2019 19:41:33 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hj7bl-0004RQ-T6 for pgsql-general@postgresql.org; Thu, 04 Jul 2019 19:41:31 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id C2274154469C9 for ; Thu, 4 Jul 2019 12:41:27 -0700 (MST) Date: Thu, 4 Jul 2019 12:41:27 -0700 (MST) From: PegoraroF10 To: pgsql-general@postgresql.org Message-ID: <1562269287792-0.post@n3.nabble.com> Subject: Converting to identity columns with domains on PK columns MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Domains on Postgres are really strange to me. Am I creating a domain which is exactly equal to integer, right ? create domain i32 as integer; create domain T50 as varchar(50); Create table MyTable( ID I32 not null primary key, Description T50); Then, after inserts and updates done to that table, I want to convert that primary key to a identity column. alter table MyTable alter ID add generated always as identity; ERROR: identity column type must be smallint, integer, or bigint So, What do I need do to create this identity column ? Why Postgres consider different I32 and integer ? -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html