pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Lars Erik Thorsplass <thorsplass@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Inserts with incomplete rows... NOT NULL constraints
Date: Wed, 11 Aug 2004 14:35:32 +0200
Message-ID: <7eeb33a040811053563894d7b@mail.gmail.com> (raw)

Am trying to migrate some old data to a new database schema. I have
dumped the old data as SQL statements. The new datastructure just
contains some added fields to a few tables.

My plan was to just create a new database with the new structure, dump
the content only as SQL insert statements. And just run the statements
contained in the dump on the new database.

The problem am now facing is that postgres will try to insert a NULL
value for fields not specified in the insert query and that are
defined as NOT NULL in the table structure. Is this the correct
behaviour?

I would expect NULL fields not specified in the insert to get NULL
inserted automatically. But that fields which are NOT NULL in the
table structure gets inserted a NULL value too seems odd.

Am loosing my mind in this heat but, you should be able to insert just
half the fields of a table record if the datastructure would allow it?
Wouldnt you?

I feel like a such a noob :(

Please advise..

-- 
L.E.Thorsplass



view thread (4+ messages)  latest in thread

Message-ID: <7eeb33a040811053563894d7b@mail.gmail.com>
Permalink:  ../7eeb33a040811053563894d7b@mail.gmail.com/
Also on:    postgresql.org/message-id/7eeb33a040811053563894d7b@mail.gmail.com

 · 

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-sql@postgresql.org
  Cc: thorsplass@gmail.com
  Subject: Re: Inserts with incomplete rows... NOT NULL constraints
  In-Reply-To: <7eeb33a040811053563894d7b@mail.gmail.com>

* 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