From: Rajesh Kumar Mallah <mallah@trade-india.com>
To: Geoffrey Wossum <geoffrey@pager.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@postgresql.org
Subject: Re: Problems upgrading from 7.1.3
Date: Fri, 7 Feb 2003 12:04:16 +0530
Message-ID: <200302071204.16336.mallah@trade-india.com> (raw)
In-Reply-To: <200302060957.54830.geoffrey@pager.net>
References: <200302051128.35997.geoffrey@pager.net>
<200302061801.47318.mallah@trade-india.com>
<200302060957.54830.geoffrey@pager.net>
thanks Geoffrey for posting the observation.
I hope you will soon find the answer to your
question on investigation.
regds
mallah.
On Thursday 06 February 2003 09:27 pm, Geoffrey Wossum wrote:
> On Thursday 06 February 2003 06:31 am, Rajesh Kumar Mallah wrote:
> > In my case the message "Invalid command \N" was coming
> > during COPY command execution when some other SQL command had
> > failed prior to COPY execution. ie the COPY command and data
> > in that part were perfectly fine.
>
> Ah, found my problem. The following table was created as:
>
> CREATE TABLE bases (
> serialno integer NOT NULL,
> ip character varying(15) DEFAULT 'FF.FF.FF.FF.FF',
> mac character varying(17) DEFAULT 'FF:FF:FF:FF:FF:FF:FF',
> modem_init character varying,
> enc_key character varying,
> status integer,
> "location" integer DEFAULT '-1'
> );
>
> You'll notice that the mac column is a VARCHAR(17), but the default value
> is 20 characters long! I got the following errors:
>
> ERROR: value too long for type character varying(17)
> ERROR: Relation "bases" does not exist
>
> So that caused the bases table to not be created. When psql got the "COPY"
> command for bases, the table wasn't there, so it didn't really execute the
> COPY. Then psql thought all the data for the COPY was really commands,
> hence the "Invalid command \N" message. Apparently this really got it
> confused.
>
> If I hand editted the dump to change the 17 to a 20, everything was happy.
>
> Apparently PostgreSQL 7.1.3 didn't really enforce the length on
> VARCHAR(#)'s, which is why this never caused a problem with it.
>
> Now, why did this all work fine if I added "-D" to pg_dump/pg_dumpall?
> Shouldn't that have failed for the same reason?
>
> Thanks,
> ---
> Geoffrey Wossum
> Software Engineer
> Long Range Systems - http://www.pager.net
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
--
Regds
Mallah
----------------------------------------
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)
Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: mallah@trade-india.com, geoffrey@pager.net, tgl@sss.pgh.pa.us
Subject: Re: Problems upgrading from 7.1.3
In-Reply-To: <200302071204.16336.mallah@trade-india.com>
References: <200302051128.35997.geoffrey@pager.net> <200302061801.47318.mallah@trade-india.com> <200302060957.54830.geoffrey@pager.net> <200302071204.16336.mallah@trade-india.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