1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-22 21:53:06 +03:00

Clean up bogosities in pg_opclass, pg_amop, pg_amproc. There are amproc

entries now for int8 and network hash indexes.  int24_ops and int42_ops
are gone.  pg_opclass no longer contains multiple entries claiming to be
the default opclass for the same datatype.  opr_sanity regress test
extended to catch errors like these in the future.
This commit is contained in:
Tom Lane
2000-06-19 03:55:01 +00:00
parent a53dc5ee61
commit c590273fef
19 changed files with 272 additions and 357 deletions

View File

@@ -8,23 +8,27 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.47 2000/06/15 04:10:23 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.48 2000/06/19 03:54:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include <limits.h>
#include <time.h>
#include "postgres.h"
#include <limits.h>
#include <time.h>
#ifdef HAVE_FLOAT_H
#include <float.h>
#endif
#include "access/hash.h"
#include "miscadmin.h"
#include "utils/date.h"
#include "utils/nabstime.h"
static int
date2tm(DateADT dateVal, int *tzp, struct tm * tm, double *fsec, char **tzn);
static int date2tm(DateADT dateVal, int *tzp, struct tm * tm,
double *fsec, char **tzn);
/*****************************************************************************
@@ -762,6 +766,22 @@ timetz_cmp(PG_FUNCTION_ARGS)
PG_RETURN_INT32(0);
}
/*
* timetz, being an unusual size, needs a specialized hash function.
*/
Datum
timetz_hash(PG_FUNCTION_ARGS)
{
TimeTzADT *key = PG_GETARG_TIMETZADT_P(0);
/*
* Specify hash length as sizeof(double) + sizeof(int4), not as
* sizeof(TimeTzADT), so that any garbage pad bytes in the structure
* won't be included in the hash!
*/
return hash_any((char *) key, sizeof(double) + sizeof(int4));
}
Datum
timetz_larger(PG_FUNCTION_ARGS)
{