Search Postgresql Archives

Re: What is the best plan to upgrade PostgreSQL from an ancient version?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2009-01-27 at 04:28 +0100, marcin mank wrote:
> On Mon, Jan 26, 2009 at 10:37 PM, Dann Corbit <DCorbit@xxxxxxxxx> wrote:
> > My notion is to do a character mode database dump as SQL statements and
> > then load into the new version by execution of psql against the sql
> > STATEMENTS.
> >
> > What are the "gotchas" we can expect with this approach?
> >
> > When I say 'ancient' I mean v7.1.3 and the target is v8.3.5.
> >
> 
> One gotcha is that some ancient versions (and I think 7.1 is one of
> these) used to silently truncate varchar values that don`t fit into
> the declared field width, while recent versions throw errors. Check if
> Your apps don`t depend on this behaviour.'

Wow that is reaching back. You can actually do this still:

postgres=# create table test_trunc(fname varchar(2)):
postgres-# 
postgres=# create table test_trunc(fname varchar(2));
CREATE TABLE
postgres=# insert into test_trunc values ('fo');
INSERT 0 1
postgres=# insert into test_trunc values ('foo');
ERROR:  value too long for type character varying(2)
postgres=# insert into test_trunc values ('foo'::varchar(2));
INSERT 0 1
postgres=# select * from test_trunc;
 fname 
-------
 fo
 fo
(2 rows)

Sincerely,

Joshua D. Drake


> good luck
> Marcin
> 
-- 
PostgreSQL - XMPP: jdrake@xxxxxxxxxxxxxxxxxxxxx
   Consulting, Development, Support, Training
   503-667-4564 - http://www.commandprompt.com/
   The PostgreSQL Company, serving since 1997


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux