Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeTOy-000696-Sg for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Jan 2018 22:20:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeTOy-0003kH-5B for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Jan 2018 22:20:16 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eeTOx-0003jk-SI for pgsql-bugs@lists.postgresql.org; Wed, 24 Jan 2018 22:20:16 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eeTOq-0007iA-8b for pgsql-bugs@postgresql.org; Wed, 24 Jan 2018 22:20:14 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1eeTOp-0005Tj-Ep; Wed, 24 Jan 2018 17:20:07 -0500 Date: Wed, 24 Jan 2018 17:20:07 -0500 From: Bruce Momjian To: Bogdan Stepanenko Cc: pgsql-bugs@postgresql.org Subject: Re: defaut value '1' in smallint column is a string value '1' in pgsql >= 9.5 Message-ID: <20180124222007.GQ17109@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I see you have posted three bug reports related to PDO but the Postgres community has no idea how your report relates to a bug in Postgres. --------------------------------------------------------------------------- On Fri, Dec 1, 2017 at 12:36:48PM +0300, Bogdan Stepanenko wrote: > related > https://github.com/yiisoft/yii2/issues/15247 > https://github.com/yiisoft/yii2/issues/15254 > > 1. create table with > > CREATE TABLE "type" ( > int_col integer NOT NULL, > int_col2 integer DEFAULT '1', > smallint_col smallint DEFAULT '1', > char_col char(100) NOT NULL, > char_col2 varchar(100) DEFAULT 'something', > char_col3 text, > float_col double precision NOT NULL, > float_col2 double precision DEFAULT '1.23', > blob_col bytea, > numeric_col decimal(5,2) DEFAULT '33.22', > time timestamp NOT NULL DEFAULT '2002-01-01 00:00:00', > bool_col boolean NOT NULL, > bool_col2 boolean DEFAULT TRUE, > ts_default TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, > bit_col BIT(8) NOT NULL DEFAULT B'10000010', > bigint_col BIGINT > ); > > 2. Get declaration of `types` from the information schema throw PDO > 3. Get data about `smallint_col` > Result: Default value of `smalint_col` is a raw string '1', not convert to int > 1 > > I try with this versions (official docker images like `image: postgres:9.4`): > 9.4 is convert string to int. > 9.5 and 10.1 is not convert string to int. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +