Skip site navigation (1) Skip section navigation (2)

Re: Bug: COPY IN doesn't test domain constraints

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Bug: COPY IN doesn't test domain constraints
Date: 2002-09-17 15:19:32
Message-ID: 1032275973.32170.9.camel@jester (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Fixed this problem and added regression tests in domain.sql.

Also:
- Changed header file order (alphabetical)
- Changed to m = attnum - 1 in binary copy code for consistency

On Mon, 2002-09-16 at 17:54, Tom Lane wrote:
> In CVS tip:
> 
> regression=# create domain nnint int not null;
> CREATE DOMAIN
> regression=# create table foo (f1 nnint);
> CREATE TABLE
> regression=# insert into foo values(null);
> ERROR:  Domain nnint does not allow NULL values		-- okay
> regression=# \copy foo from stdin
> 123
> \N
> \.
> regression=# select * from foo;
>  f1
> -----
>  123
> 							-- not okay
> (2 rows)
> 
> regression=# create domain vc4 varchar(4);
> CREATE DOMAIN
> regression=# create table foot (f1 vc4);
> CREATE TABLE
> regression=# \copy foot from stdin
> 1234567890
> \.
> regression=# select * from foot;
>      f1
> ------------
>  1234567890						-- not okay
> (1 row)
> 
> 
> 			regards, tom lane
> 
-- 
  Rod Taylor

Attachment: domain_copy.patch
Description: text/plain (12.0 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Andrew SullivanDate: 2002-09-17 15:19:44
Subject: Re: [GENERAL] Still big problems with pg_dump!
Previous:From: Andrew SullivanDate: 2002-09-17 15:11:47
Subject: Re: [GENERAL] Still big problems with pg_dump!

pgsql-patches by date

Next:From: Neil ConwayDate: 2002-09-17 15:44:32
Subject: trivial doc fix
Previous:From: Bruno Wolff IIIDate: 2002-09-17 12:42:49
Subject: earthdistance fixes, but no cube stuff

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group