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

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

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Rod Taylor <rbt(at)rbt(dot)ca>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Bug: COPY IN doesn't test domain constraints
Date: 2002-09-20 03:48:07
Message-ID: 200209200348.g8K3m7R05712@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Patch applied.  Thanks.

---------------------------------------------------------------------------


Rod Taylor wrote:
> 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, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2002-09-20 03:54:21
Subject: Re: please apply patch to contrib/ltree
Previous:From: Gavin SherryDate: 2002-09-20 03:47:40
Subject: Re: Postgres 7.2.2 Segment Error

pgsql-patches by date

Next:From: Bruce MomjianDate: 2002-09-20 03:53:59
Subject: Re: trivial doc fix
Previous:From: Bruce MomjianDate: 2002-09-20 03:47:06
Subject: Re: earthdistance fixes, but no cube stuff

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