From 8000fdd4621ef08b633588530d97e5ab83eb166e Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 20 Mar 2003 05:18:15 +0000 Subject: > > - Move SEQ_MAXVALUE, SEQ_MINVALUE definitions to sequence.h > > > > - Add check in pg_dump to see if the value returned is the max /min > > values and replace with NO MAXVALUE, NO MINVALUE. > > > > - Change START and INCREMENT to use START WITH and INCREMENT BY syntax. > > This makes it a touch easier to port to other databases with sequences > > (Oracle). PostgreSQL supports both syntaxes already. > > + char bufm[100], > + bufx[100]; > > This seems to be an arbitary size. Why not set it to the actual maximum > length? > > Also: > > + snprintf(bufm, 100, INT64_FORMAT, SEQ_MINVALUE); > + snprintf(bufx, 100, INT64_FORMAT, SEQ_MAXVALUE); > > sizeof(bufm), sizeof(bufx) is probably the more > maintenance-friendly/standard way to do it. I changed the code to use sizeof - but will wait for a response from Peter before changing the size. It's consistent throughout the sequence code to be 100 for this purpose. Rod Taylor --- src/backend/commands/sequence.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/backend/commands/sequence.c') diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index bca6512cef..74068181e4 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.92 2003/03/20 03:34:55 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.93 2003/03/20 05:18:14 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -24,19 +24,6 @@ #include "utils/acl.h" #include "utils/builtins.h" - -#ifndef INT64_IS_BUSTED -#ifdef HAVE_LL_CONSTANTS -#define SEQ_MAXVALUE ((int64) 0x7FFFFFFFFFFFFFFFLL) -#else -#define SEQ_MAXVALUE ((int64) 0x7FFFFFFFFFFFFFFF) -#endif -#else /* INT64_IS_BUSTED */ -#define SEQ_MAXVALUE ((int64) 0x7FFFFFFF) -#endif /* INT64_IS_BUSTED */ - -#define SEQ_MINVALUE (-SEQ_MAXVALUE) - /* * We don't want to log each fetching of a value from a sequence, * so we pre-log a few fetches in advance. In the event of -- cgit v1.2.1