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

INSERT with SELECT not working in pgAdmin

From: Stefan Wild <wilds81(at)yahoo(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: INSERT with SELECT not working in pgAdmin
Date: 2010-09-20 19:19:05
Message-ID: 715492.32171.qm@web26702.mail.ukl.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-general
Hi guys,

I'm trying to merge two tables to one with INSERT and SELECT commands: 

INSERT into c_transactions (timestamp) SELECT entrytimestamp from c_transactions

INSERT into c_transactions (timestamp) SELECT exittimestamp from c_transactions

But getting this error on execution (in pgAdmin): "ERROR: null value in column "id" violates not-null constraint
SQL Status:23502"

What I'm doing wrong or is there another possibility for table merging?

I'm using postgres 8.3.

Thanks.




Responses

pgsql-general by date

Next:From: Aram FingalDate: 2010-09-20 19:20:59
Subject: Re: Installing Contrib Modules with a Precompiled Binary
Previous:From: Colin 't HartDate: 2010-09-20 19:18:09
Subject: Re: to_date conversion semantics?

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