Is necessary to use SEQ_MAXVALUE in pg_dump?

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Is necessary to use SEQ_MAXVALUE in pg_dump?
Date: 2007-11-05 18:21:38
Message-ID: 472F5F32.6000504@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I'm trying fix independence of pg_dump.c on postgres.h. And I found
following construct in dumpSequence function:

09391 snprintf(bufm, sizeof(bufm), INT64_FORMAT, SEQ_MINVALUE);
09392 snprintf(bufx, sizeof(bufx), INT64_FORMAT, SEQ_MAXVALUE);
09393
09394 appendPQExpBuffer(query,
09395 "SELECT sequence_name, last_value,
increment_by, "
09396 "CASE WHEN increment_by > 0 AND max_value = %s
THEN NULL "
09397 " WHEN increment_by < 0 AND max_value = -1
THEN NULL "
09398 " ELSE max_value "
09399 "END AS max_value, "
09400 "CASE WHEN increment_by > 0 AND min_value = 1
THEN NULL "
09401 " WHEN increment_by < 0 AND min_value = %s
THEN NULL "
09402 " ELSE min_value "
09403 "END AS min_value, "
09404 "cache_value, is_cycled, is_called from %s",
09405 bufx, bufm,
09406 fmtId(tbinfo->dobj.name));

This construct is used to determine if max_value/min_value is used and
after that pg_dump add NO MAXVALUE to the output instead of the value.
If I compare it with manual documentation NO MAXVALUE uses default value
and I do not see any reason to have this code there. I think we can
remove this code and release dependency on sequence.h.

Any comments?

Zdenek

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2007-11-05 18:25:00 Re: Visibility map thoughts
Previous Message Bruce Momjian 2007-11-05 18:13:19 Re: Open items for 8.3