Re: importing db as text files

From: expect <expect(at)ihubbell(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: importing db as text files
Date: 2003-08-14 03:45:55
Message-ID: 20030813204555.755edd6b.expect@ihubbell.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 13 Aug 2003 16:30:04 -0500
Bruno Wolff III <bruno(at)wolff(dot)to> wrote:

> On Wed, Aug 13, 2003 at 14:14:20 -0700,
> expect <expect(at)ihubbell(dot)com> wrote:
> >
> > What's the big deal with importing text files? I have a 70 MB file to import
> > and it's been one problem after another. I used the copy command and it appears
> > that it's just not possible. I finally massaged the file into a .sql file and
>
> That is unlikely, but without more details it is hard to say what you need
> to do.

What's unlikely? That it didn't work? But it didn't work.

>
> > ran that using \i db.sql but that failed too because I overlooked ' in names
> > like D'Adario. The other problem I encountered was that a numeric field had
> > to have data in it, pg would not default to the default value. So instead of
>
> You can use the keyword default in insert statements to get a default value.

From what I've read it should use the default value when there is no value.
Is that not true? Is this a known issue?

>
> > massaging all the data again I decided to change the data type for that column.
> > This is my first experience with postgresql and I'm wondering if I should expect
> > to encounter similar pain as I go further into this? So far it's been very
> > painful trying to do what I thought would be easy and what I think should be
> > easy.
>
> The impression I get is that you expect postgres to make a best guess when

No you've come to the wrong impression. I believe that the problem lies in the
fact that pg will not default to the default value when no value is present.

> presented with ambiguous data. That is a very dangerous thing to do. I would
> much prefer ambiguous data be rejected so that I can make sure what I think
> the value is, is the same as what the database thinks the value is.
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message expect 2003-08-14 03:50:06 Re: importing db as text files
Previous Message expect 2003-08-14 03:39:41 Why the duplicate messages to pgsql-general?