Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cDxyu-0007T4-Ba for pgsql-bugs@arkaria.postgresql.org; Mon, 05 Dec 2016 18:27:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cDxyt-000115-AP for pgsql-bugs@arkaria.postgresql.org; Mon, 05 Dec 2016 18:27:15 +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.84_2) (envelope-from ) id 1cDxys-00010O-Eq for pgsql-bugs@postgresql.org; Mon, 05 Dec 2016 18:27:14 +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.84_2) (envelope-from ) id 1cDxyp-0002hk-VL for pgsql-bugs@postgresql.org; Mon, 05 Dec 2016 18:27:13 +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 uB5IR9kH023050; Mon, 5 Dec 2016 13:27:09 -0500 From: Tom Lane To: hmahmood89@googlemail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14448: create table as values - type check skipped In-reply-to: <20161205143037.4377.60754@wrigleys.postgresql.org> References: <20161205143037.4377.60754@wrigleys.postgresql.org> Comments: In-reply-to hmahmood89@googlemail.com message dated "Mon, 05 Dec 2016 14:30:37 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23048.1480962429.1@sss.pgh.pa.us> Date: Mon, 05 Dec 2016 13:27:09 -0500 Message-ID: <23049.1480962429@sss.pgh.pa.us> X-Pg-Spam-Score: -4.9 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org hmahmood89@googlemail.com writes: > create temporary table product_codes as select * > from ( > values > ('abcdefg'::character varying(20)), > ('012345678901234567ABCDEFGHIJKLMN') > ) csv_data (product_code); > select * > from product_codes; > I would expect that the type check got applied across all values or that the > value got truncated. > The result column states "character varying(20)". Inserts/Updates/Casts all > truncate as expected. Hmm. I'm not sure whether that VALUES construct should be expected to produce varchar(20) or just unrestricted varchar, but I agree that if it claims to produce varchar(20) then the results should all meet that limit. Will look into it, thanks for the report! 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