Re: [GENERAL] pg_migrator not setting values of sequences?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, Tilmann Singer <tils(at)tils(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] pg_migrator not setting values of sequences?
Date: 2009-07-16 04:28:47
Message-ID: 200907160428.n6G4SlO11897@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Tom Lane wrote:
> >> The most effective solution might be to revert the change in pg_migrator
> >> and instead have pg_dump interpret --binary-upgrade --schema-only to
> >> include the data for sequences. It seems ugly as sin though :-(
>
> > Uh, how is this going to behave in 8.5? Do we still dump sequences, and
> > if so, aren't we heading down the road of dumping stuff only because a
> > previous release needed it?
>
> In 8.5 we'll probably have it go over to treating sequences the same as
> other user tables. What, do you think that'll be the only change
> required in pg_migrator's behavior between 8.4 and 8.5? I think it'll
> more likely be down in the noise ...

I am just worried about jerking pg_dump around as pg_migrator's needs
change.

> > Can we run a query that just shifts columns around in the sequence heap
> > files we migrated?
>
> Nope. That's not exposed at the SQL level, even if we allowed ALTER
> TABLE on sequences (which I sure hope we don't).

Ah, I see what you mean:

test=> create sequence xx;
seCREATE SEQUENCE
test=> select * from xx;
sequence_name | last_value | start_value | increment_by |
max_value | min_value | cache_value | log_cnt | is_cycled |
is_called
---------------+------------+-------------+--------------+---------------------+-----------+-------------+---------+-----------+-----------

xx | 1 | 1 | 1 |
9223372036854775807 | 1 | 1 | 1 | f | f
(1 row)

test=> update xx set last_value = 3;
ERROR: cannot change sequence "xx"

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Raji Sridar (raji) 2009-07-16 04:59:41 Concurrency issue under very heay loads
Previous Message Tom Lane 2009-07-16 04:16:23 Re: [GENERAL] pg_migrator not setting values of sequences?

Browse pgsql-hackers by date

  From Date Subject
Next Message KaiGai Kohei 2009-07-16 04:49:14 Re: [PATCH] [v8.5] Security checks on largeobjects
Previous Message KaiGai Kohei 2009-07-16 04:23:42 Re: [PATCH] SE-PgSQL/lite rev.2163