pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
CURRENT_TIMESTAMP breaking with 7.1->7.2 dump/import
3+ messages / 2 participants
[nested] [flat]

* CURRENT_TIMESTAMP breaking with 7.1->7.2 dump/import
@ 2002-02-19 22:04 Mark Stosberg <mark@summersault.com>
  2002-02-19 22:47 ` Re: CURRENT_TIMESTAMP breaking with 7.1->7.2 dump/import Mark Stosberg <mark@summersault.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Mark Stosberg @ 2002-02-19 22:04 UTC (permalink / raw)
  To: pgsql-sql


Hello and thanks for the Postgres team for another fine release of
Postgres. I'm working on doing some test dump/imports from Postgres 7.1
to Postgres 7.2. 

I'm using a 7.1 pg_dumpall, and a 7.2 psql to import. 

It's hanging on this error:
##########################
CREATE TABLE "mail_history" (
        "mail_id" integer DEFAULT
nextval('mail_history_mail_id_seq'::text) NOT NULL,
        "subject" character varying(200),
        "body" text,
        "group_id" integer,
        "date_created" date DEFAULT date(('current'::"timestamp" +
'00:00'::"interval")) NOT NULL,
        "n_sent" integer DEFAULT 0
);
ERROR:  Bad timestamp external representation 'current'
##################

The use of 'current' is clearly not suported as stated in the upgrade
docs. What's frustrating is that the SQL I used to create the table WAS
valid, using the standard CURRENT_DATE function, but Postgres internally
connverted this into this broken format. Here was my original create statement:
#########
create table mail_history (
        mail_id                 serial,
        subject                 varchar(200),
        body                   text,
        group_id                  integer,
        date_created               date not null default CURRENT_DATE,
        n_sent                  integer default 0
);
#######

This is from an old project. It might have started in Postgres 6.5.x and
then been imported into Postgres 7.0 and then Postgres 7.1. Is there a
way that I help coax Postgres into providing better support for this
kind of legacy data? 

   -mark



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: CURRENT_TIMESTAMP breaking with 7.1->7.2 dump/import
  2002-02-19 22:04 CURRENT_TIMESTAMP breaking with 7.1->7.2 dump/import Mark Stosberg <mark@summersault.com>
@ 2002-02-19 22:47 ` Mark Stosberg <mark@summersault.com>
  2002-02-20 03:13   ` Re: CURRENT_TIMESTAMP breaking with 7.1->7.2 dump/import Christopher Kings-Lynne <chriskl@familyhealth.com.au>
  0 siblings, 1 reply; 3+ messages in thread

From: Mark Stosberg @ 2002-02-19 22:47 UTC (permalink / raw)
  To: pgsql-sql


This turned out to have an easy work around:

perl -pi.bak -e "s/'current'/CURRENT_TIMESTAMP/" my_dump.dmp

    -mark 

Mark Stosberg wrote:
> 
> Hello and thanks for the Postgres team for another fine release of
> Postgres. I'm working on doing some test dump/imports from Postgres 7.1
> to Postgres 7.2.
> 
> I'm using a 7.1 pg_dumpall, and a 7.2 psql to import.
> 
> It's hanging on this error:
> ##########################
> CREATE TABLE "mail_history" (
>         "mail_id" integer DEFAULT
> nextval('mail_history_mail_id_seq'::text) NOT NULL,
>         "subject" character varying(200),
>         "body" text,
>         "group_id" integer,
>         "date_created" date DEFAULT date(('current'::"timestamp" +
> '00:00'::"interval")) NOT NULL,
>         "n_sent" integer DEFAULT 0
> );
> ERROR:  Bad timestamp external representation 'current'
> ##################
> 
> The use of 'current' is clearly not suported as stated in the upgrade
> docs. What's frustrating is that the SQL I used to create the table WAS
> valid, using the standard CURRENT_DATE function, but Postgres internally
> connverted this into this broken format. Here was my original create statement:
> #########
> create table mail_history (
>         mail_id                 serial,
>         subject                 varchar(200),
>         body                   text,
>         group_id                  integer,
>         date_created               date not null default CURRENT_DATE,
>         n_sent                  integer default 0
> );
> #######
> 
> This is from an old project. It might have started in Postgres 6.5.x and
> then been imported into Postgres 7.0 and then Postgres 7.1. Is there a
> way that I help coax Postgres into providing better support for this
> kind of legacy data?
> 
>    -mark
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org

-- 
 . . . . . . . . . . . . . . . . . . . . . . . . . .
   Mark Stosberg              Principal Developer  
   mark@summersault.com       Summersault, LLC     
   765-939-9301 ext 223       website development  
 . . . . . http://www.summersault.com/ . . . . . . .



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: CURRENT_TIMESTAMP breaking with 7.1->7.2 dump/import
  2002-02-19 22:04 CURRENT_TIMESTAMP breaking with 7.1->7.2 dump/import Mark Stosberg <mark@summersault.com>
  2002-02-19 22:47 ` Re: CURRENT_TIMESTAMP breaking with 7.1->7.2 dump/import Mark Stosberg <mark@summersault.com>
@ 2002-02-20 03:13   ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
  0 siblings, 0 replies; 3+ messages in thread

From: Christopher Kings-Lynne @ 2002-02-20 03:13 UTC (permalink / raw)
  To: mark@summersault.com; pgsql-sql

Sure you don't want 'now' instead of 'current'??

Chris


> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org
> [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Mark Stosberg
> Sent: Wednesday, 20 February 2002 6:47 AM
> To: pgsql-sql@postgresql.org
> Subject: Re: [SQL] CURRENT_TIMESTAMP breaking with 7.1->7.2 dump/import
>
>
>
> This turned out to have an easy work around:
>
> perl -pi.bak -e "s/'current'/CURRENT_TIMESTAMP/" my_dump.dmp
>
>     -mark
>
> Mark Stosberg wrote:
> >
> > Hello and thanks for the Postgres team for another fine release of
> > Postgres. I'm working on doing some test dump/imports from Postgres 7.1
> > to Postgres 7.2.
> >
> > I'm using a 7.1 pg_dumpall, and a 7.2 psql to import.
> >
> > It's hanging on this error:
> > ##########################
> > CREATE TABLE "mail_history" (
> >         "mail_id" integer DEFAULT
> > nextval('mail_history_mail_id_seq'::text) NOT NULL,
> >         "subject" character varying(200),
> >         "body" text,
> >         "group_id" integer,
> >         "date_created" date DEFAULT date(('current'::"timestamp" +
> > '00:00'::"interval")) NOT NULL,
> >         "n_sent" integer DEFAULT 0
> > );
> > ERROR:  Bad timestamp external representation 'current'
> > ##################
> >
> > The use of 'current' is clearly not suported as stated in the upgrade
> > docs. What's frustrating is that the SQL I used to create the table WAS
> > valid, using the standard CURRENT_DATE function, but Postgres internally
> > connverted this into this broken format. Here was my original
> create statement:
> > #########
> > create table mail_history (
> >         mail_id                 serial,
> >         subject                 varchar(200),
> >         body                   text,
> >         group_id                  integer,
> >         date_created               date not null default CURRENT_DATE,
> >         n_sent                  integer default 0
> > );
> > #######
> >
> > This is from an old project. It might have started in Postgres 6.5.x and
> > then been imported into Postgres 7.0 and then Postgres 7.1. Is there a
> > way that I help coax Postgres into providing better support for this
> > kind of legacy data?
> >
> >    -mark
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: Have you searched our list archives?
> >
> > http://archives.postgresql.org
>
> --
>  . . . . . . . . . . . . . . . . . . . . . . . . . .
>    Mark Stosberg              Principal Developer
>    mark@summersault.com       Summersault, LLC
>    765-939-9301 ext 223       website development
>  . . . . . http://www.summersault.com/ . . . . . . .
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2002-02-20 03:13 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-02-19 22:04 CURRENT_TIMESTAMP breaking with 7.1->7.2 dump/import Mark Stosberg <mark@summersault.com>
2002-02-19 22:47 ` Mark Stosberg <mark@summersault.com>
2002-02-20 03:13   ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>

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