pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: hmahmood89@googlemail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14448: create table as values - type check skipped
Date: Mon, 05 Dec 2016 13:27:09 -0500
Message-ID: <23049.1480962429@sss.pgh.pa.us> (raw)
In-Reply-To: <20161205143037.4377.60754@wrigleys.postgresql.org>
References: <20161205143037.4377.60754@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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



view thread (2+ messages)

Message-ID: <23049.1480962429@sss.pgh.pa.us>
Permalink:  ../23049.1480962429@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23049.1480962429@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, hmahmood89@googlemail.com
  Subject: Re: BUG #14448: create table as values - type check skipped
  In-Reply-To: <23049.1480962429@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox