summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/array/array_iterator.c5
-rw-r--r--contrib/intagg/int_aggregate.c16
-rw-r--r--contrib/intarray/_int.c310
-rw-r--r--contrib/miscutil/misc_utils.c3
-rw-r--r--contrib/noupdate/noup.c2
-rw-r--r--contrib/pgcrypto/px.c4
-rw-r--r--contrib/pgstattuple/pgstattuple.c4
-rw-r--r--contrib/rserv/rserv.c6
-rw-r--r--contrib/spi/refint.c10
-rw-r--r--contrib/tsearch/query.c6
-rw-r--r--contrib/tsearch/txtidx.c2
-rw-r--r--contrib/xml/pgxml.c8
-rw-r--r--contrib/xml/pgxml_dom.c4
13 files changed, 187 insertions, 193 deletions
diff --git a/contrib/array/array_iterator.c b/contrib/array/array_iterator.c
index 3622cf9819..8a2455b673 100644
--- a/contrib/array/array_iterator.c
+++ b/contrib/array/array_iterator.c
@@ -49,7 +49,7 @@ array_iterator(Oid elemtype, Oid proc, int and, ArrayType *array, Datum value)
/* Sanity checks */
if (array == (ArrayType *) NULL)
{
- /* elog(NOTICE, "array_iterator: array is null"); */
+ /* elog(WARNING, "array_iterator: array is null"); */
return (0);
}
@@ -60,10 +60,7 @@ array_iterator(Oid elemtype, Oid proc, int and, ArrayType *array, Datum value)
dim = ARR_DIMS(array);
nitems = ArrayGetNItems(ndim, dim);
if (nitems == 0)
- {
- /* elog(NOTICE, "array_iterator: nitems = 0"); */
return (0);
- }
/* Lookup element type information */
get_typlenbyval(elemtype, &typlen, &typbyval);
diff --git a/contrib/intagg/int_aggregate.c b/contrib/intagg/int_aggregate.c
index b2187fdb0d..6e8d17b747 100644
--- a/contrib/intagg/int_aggregate.c
+++ b/contrib/intagg/int_aggregate.c
@@ -1,7 +1,7 @@
/*
* Integer array aggregator / enumerator
*
- * Mark L. Woodward
+ * Mark L. Woodward
* DMN Digital Music Network.
* www.dmn.com
*
@@ -73,9 +73,9 @@ PG_FUNCTION_INFO_V1(int_agg_final_count);
PG_FUNCTION_INFO_V1(int_agg_final_array);
PG_FUNCTION_INFO_V1(int_enum);
-/*
- * Manage the aggregation state of the array
- * You need to specify the correct memory context, or it will vanish!
+/*
+ * Manage the aggregation state of the array
+ * You need to specify the correct memory context, or it will vanish!
*/
static PGARRAY * GetPGArray(int4 state, int fAdd)
{
@@ -129,7 +129,7 @@ static PGARRAY * GetPGArray(int4 state, int fAdd)
return p;
}
-/* Shrinks the array to its actual size and moves it into the standard
+/* Shrinks the array to its actual size and moves it into the standard
* memory allocation context, frees working memory */
static PGARRAY *ShrinkPGArray(PGARRAY *p)
{
@@ -156,7 +156,7 @@ static PGARRAY *ShrinkPGArray(PGARRAY *p)
elog(ERROR, "Integer aggregator, can't allocate memory");
}
pfree(p);
- }
+ }
return pnew;
}
@@ -206,14 +206,14 @@ Datum int_enum(PG_FUNCTION_ARGS)
if(!p)
{
- elog(NOTICE, "No data sent\n");
+ elog(WARNING, "No data sent\n");
return 0;
}
if(!rsi)
{
elog(ERROR, "No ReturnSetInfo sent! function must be declared returning a 'setof' integer");
PG_RETURN_NULL();
-
+
}
if(!fcinfo->context)
{
diff --git a/contrib/intarray/_int.c b/contrib/intarray/_int.c
index 35ee7a659e..ba91a0eba4 100644
--- a/contrib/intarray/_int.c
+++ b/contrib/intarray/_int.c
@@ -33,8 +33,8 @@
/* dimension of array */
#define NDIM 1
-/*
- * flags for gist__int_ops, use ArrayType->flags
+/*
+ * flags for gist__int_ops, use ArrayType->flags
* which is unused (see array.h)
*/
#define LEAFKEY (1<<31)
@@ -112,7 +112,7 @@ printarr(ArrayType *a, int num)
sprintf(cur, "%d ", d[l]);
cur = strchr(cur, '\0');
}
- elog(NOTICE, "\t\t%s", bbb);
+ elog(DEBUG3, "\t\t%s", bbb);
}
static void
printbitvec(BITVEC bv)
@@ -123,7 +123,7 @@ printbitvec(BITVEC bv)
str[SIGLENBIT] = '\0';
LOOPBIT(str[i] = (GETBIT(bv, i)) ? '1' : '0');
- elog(NOTICE, "BV: %s", str);
+ elog(DEBUG3, "BV: %s", str);
}
#endif
@@ -234,7 +234,7 @@ static void rt__intbig_size(ArrayType *a, float *sz);
/*****************************************************************************
- * Boolean Search
+ * Boolean Search
*****************************************************************************/
#define BooleanSearchStrategy 20
@@ -261,17 +261,17 @@ typedef struct {
PG_FUNCTION_INFO_V1(bqarr_in);
PG_FUNCTION_INFO_V1(bqarr_out);
-Datum bqarr_in(PG_FUNCTION_ARGS);
+Datum bqarr_in(PG_FUNCTION_ARGS);
Datum bqarr_out(PG_FUNCTION_ARGS);
-
+
PG_FUNCTION_INFO_V1(boolop);
-Datum boolop(PG_FUNCTION_ARGS);
+Datum boolop(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(rboolop);
-Datum rboolop(PG_FUNCTION_ARGS);
+Datum rboolop(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(querytree);
-Datum querytree(PG_FUNCTION_ARGS);
+Datum querytree(PG_FUNCTION_ARGS);
static bool signconsistent( QUERYTYPE *query, BITVEC sign, bool leaf );
static bool execconsistent( QUERYTYPE *query, ArrayType *array, bool leaf );
@@ -294,10 +294,10 @@ g_int_consistent(PG_FUNCTION_ARGS) {
bool retval;
if ( strategy == BooleanSearchStrategy )
- PG_RETURN_BOOL(execconsistent( (QUERYTYPE*)query,
+ PG_RETURN_BOOL(execconsistent( (QUERYTYPE*)query,
(ArrayType *) DatumGetPointer(entry->key),
ISLEAFKEY( (ArrayType *) DatumGetPointer(entry->key) ) ) );
-
+
/* XXX are we sure it's safe to scribble on the query object here? */
/* XXX what about toasted input? */
/* sort query for fast search, key is already sorted */
@@ -317,10 +317,10 @@ g_int_consistent(PG_FUNCTION_ARGS) {
query);
break;
case RTContainedByStrategyNumber:
- if ( GIST_LEAF(entry) )
+ if ( GIST_LEAF(entry) )
retval = inner_int_contains(query,
(ArrayType *) DatumGetPointer(entry->key) );
- else
+ else
retval = inner_int_overlap((ArrayType *) DatumGetPointer(entry->key),
query);
break;
@@ -334,9 +334,9 @@ Datum
g_int_union(PG_FUNCTION_ARGS)
{
PG_RETURN_POINTER( _int_common_union(
- (bytea *) PG_GETARG_POINTER(0),
- (int *) PG_GETARG_POINTER(1),
- inner_int_union
+ (bytea *) PG_GETARG_POINTER(0),
+ (int *) PG_GETARG_POINTER(1),
+ inner_int_union
) );
}
@@ -371,10 +371,10 @@ g_int_compress(PG_FUNCTION_ARGS)
if ( r != (ArrayType*)DatumGetPointer(entry->key) )
pfree(r);
PG_RETURN_POINTER(entry);
- }
+ }
if ( (len=ARRNELEMS(r)) >= 2 * MAXNUMRANGE) { /* compress */
- if ( r == (ArrayType*)DatumGetPointer( entry->key) )
+ if ( r == (ArrayType*)DatumGetPointer( entry->key) )
r = (ArrayType *) PG_DETOAST_DATUM_COPY(entry->key);
r = resize_intArrayType(r, 2 * (len));
@@ -434,11 +434,11 @@ g_int_decompress(PG_FUNCTION_ARGS)
if (lenin < 2 * MAXNUMRANGE || ISLEAFKEY( in ) ) { /* not comressed value */
if ( in != (ArrayType *) DatumGetPointer(entry->key)) {
retval = palloc(sizeof(GISTENTRY));
- gistentryinit(*retval, PointerGetDatum(in),
+ gistentryinit(*retval, PointerGetDatum(in),
entry->rel, entry->page, entry->offset, VARSIZE(in), FALSE);
PG_RETURN_POINTER(retval);
- }
+ }
PG_RETURN_POINTER(entry);
}
@@ -456,7 +456,7 @@ g_int_decompress(PG_FUNCTION_ARGS)
if (in != (ArrayType *) DatumGetPointer(entry->key))
pfree(in);
retval = palloc(sizeof(GISTENTRY));
- gistentryinit(*retval, PointerGetDatum(r),
+ gistentryinit(*retval, PointerGetDatum(r),
entry->rel, entry->page, entry->offset, VARSIZE(r), FALSE);
PG_RETURN_POINTER(retval);
@@ -468,10 +468,10 @@ g_int_decompress(PG_FUNCTION_ARGS)
Datum
g_int_penalty(PG_FUNCTION_ARGS)
{
- PG_RETURN_POINTER( _int_common_penalty(
- (GISTENTRY *)PG_GETARG_POINTER(0),
- (GISTENTRY *)PG_GETARG_POINTER(1),
- (float *) PG_GETARG_POINTER(2),
+ PG_RETURN_POINTER( _int_common_penalty(
+ (GISTENTRY *)PG_GETARG_POINTER(0),
+ (GISTENTRY *)PG_GETARG_POINTER(1),
+ (float *) PG_GETARG_POINTER(2),
inner_int_union, rt__int_size
) );
}
@@ -481,12 +481,12 @@ Datum
g_int_picksplit(PG_FUNCTION_ARGS)
{
PG_RETURN_POINTER( _int_common_picksplit(
- (bytea *)PG_GETARG_POINTER(0),
+ (bytea *)PG_GETARG_POINTER(0),
(GIST_SPLITVEC *)PG_GETARG_POINTER(1),
inner_int_union,
inner_int_inter,
rt__int_size,
- 0.01
+ 0.01
) );
}
@@ -520,14 +520,14 @@ g_int_same(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(result);
}
-Datum
+Datum
_int_contained(PG_FUNCTION_ARGS)
{
- PG_RETURN_BOOL( DatumGetBool(
- DirectFunctionCall2(
- _int_contains,
- PointerGetDatum(PG_GETARG_POINTER(1)),
- PointerGetDatum(PG_GETARG_POINTER(0))
+ PG_RETURN_BOOL( DatumGetBool(
+ DirectFunctionCall2(
+ _int_contains,
+ PointerGetDatum(PG_GETARG_POINTER(1)),
+ PointerGetDatum(PG_GETARG_POINTER(0))
)
));
}
@@ -570,7 +570,7 @@ inner_int_contains(ArrayType *a, ArrayType *b)
db = ARRPTR(b);
#ifdef GIST_DEBUG
- elog(NOTICE, "contains %d %d", na, nb);
+ elog(DEBUG3, "contains %d %d", na, nb);
#endif
i = j = n = 0;
@@ -593,14 +593,14 @@ inner_int_contains(ArrayType *a, ArrayType *b)
* Operator class for R-tree indexing
*****************************************************************************/
-Datum
+Datum
_int_different(PG_FUNCTION_ARGS)
{
- PG_RETURN_BOOL( ! DatumGetBool(
- DirectFunctionCall2(
- _int_same,
- PointerGetDatum(PG_GETARG_POINTER(0)),
- PointerGetDatum(PG_GETARG_POINTER(1))
+ PG_RETURN_BOOL( ! DatumGetBool(
+ DirectFunctionCall2(
+ _int_same,
+ PointerGetDatum(PG_GETARG_POINTER(0)),
+ PointerGetDatum(PG_GETARG_POINTER(1))
)
));
}
@@ -690,7 +690,7 @@ inner_int_overlap(ArrayType *a, ArrayType *b)
db = ARRPTR(b);
#ifdef GIST_DEBUG
- elog(NOTICE, "g_int_overlap");
+ elog(DEBUG3, "g_int_overlap");
#endif
i = j = 0;
@@ -1030,7 +1030,7 @@ rt__intbig_size(ArrayType *a, float *sz)
GETBITBYTE(bv,7) ;
bv = (BITVECP) ( ((char*)bv) + 1 );
);
-
+
*sz = (float) len;
return;
}
@@ -1116,19 +1116,19 @@ g_intbig_compress(PG_FUNCTION_ARGS)
in = NULL;
if (!entry->leafkey) {
- LOOPBYTE(
+ LOOPBYTE(
if ( ( ((char*)ARRPTR(in))[i] & 0xff ) != 0xff ) {
maycompress = false;
break;
}
- );
+ );
if ( maycompress ) {
retval = palloc(sizeof(GISTENTRY));
r = new_intArrayType(1);
- gistentryinit(*retval, PointerGetDatum(r),
+ gistentryinit(*retval, PointerGetDatum(r),
entry->rel, entry->page, entry->offset, VARSIZE(r), FALSE);
PG_RETURN_POINTER( retval );
- }
+ }
PG_RETURN_POINTER( entry );
}
@@ -1148,17 +1148,17 @@ g_intbig_compress(PG_FUNCTION_ARGS)
ARRPTR(in),
ARRNELEMS(in));
- LOOPBYTE(
+ LOOPBYTE(
if( ( ((char*)ARRPTR(in))[i] & 0xff ) != 0xff ) {
maycompress = false;
break;
}
- );
+ );
if ( maycompress ) {
pfree(r);
r = new_intArrayType(1);
- }
+ }
gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page, entry->offset, VARSIZE(r), FALSE);
@@ -1182,7 +1182,7 @@ g_intbig_decompress(PG_FUNCTION_ARGS)
retval = palloc(sizeof(GISTENTRY));
- gistentryinit(*retval, PointerGetDatum(key),
+ gistentryinit(*retval, PointerGetDatum(key),
entry->rel, entry->page, entry->offset, (key) ? VARSIZE(key) : 0, FALSE);
PG_RETURN_POINTER( retval );
}
@@ -1192,9 +1192,9 @@ g_intbig_decompress(PG_FUNCTION_ARGS)
retval = palloc(sizeof(GISTENTRY));
newkey = new_intArrayType(SIGLENINT);
- MemSet( (void*)ARRPTR(newkey), 0xff, SIGLEN );
+ MemSet( (void*)ARRPTR(newkey), 0xff, SIGLEN );
- gistentryinit(*retval, PointerGetDatum(newkey),
+ gistentryinit(*retval, PointerGetDatum(newkey),
entry->rel, entry->page, entry->offset, VARSIZE(newkey), FALSE);
PG_RETURN_POINTER( retval );
}
@@ -1205,7 +1205,7 @@ Datum
g_intbig_picksplit(PG_FUNCTION_ARGS)
{
PG_RETURN_POINTER( _int_common_picksplit(
- (bytea *)PG_GETARG_POINTER(0),
+ (bytea *)PG_GETARG_POINTER(0),
(GIST_SPLITVEC *)PG_GETARG_POINTER(1),
_intbig_union,
_intbig_inter,
@@ -1217,37 +1217,37 @@ g_intbig_picksplit(PG_FUNCTION_ARGS)
Datum
g_intbig_union(PG_FUNCTION_ARGS)
{
- PG_RETURN_POINTER( _int_common_union(
- (bytea *) PG_GETARG_POINTER(0),
- (int *) PG_GETARG_POINTER(1),
- _intbig_union
- ) );
+ PG_RETURN_POINTER( _int_common_union(
+ (bytea *) PG_GETARG_POINTER(0),
+ (int *) PG_GETARG_POINTER(1),
+ _intbig_union
+ ) );
}
Datum
g_intbig_penalty(PG_FUNCTION_ARGS)
{
- PG_RETURN_POINTER( _int_common_penalty(
- (GISTENTRY *)PG_GETARG_POINTER(0),
- (GISTENTRY *)PG_GETARG_POINTER(1),
- (float *) PG_GETARG_POINTER(2),
+ PG_RETURN_POINTER( _int_common_penalty(
+ (GISTENTRY *)PG_GETARG_POINTER(0),
+ (GISTENTRY *)PG_GETARG_POINTER(1),
+ (float *) PG_GETARG_POINTER(2),
_intbig_union, rt__intbig_size
) );
}
Datum
g_intbig_consistent(PG_FUNCTION_ARGS) {
- GISTENTRY *entry = (GISTENTRY *)PG_GETARG_POINTER(0);
- ArrayType *query = ( ArrayType * )PG_GETARG_POINTER(1);
- StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+ GISTENTRY *entry = (GISTENTRY *)PG_GETARG_POINTER(0);
+ ArrayType *query = ( ArrayType * )PG_GETARG_POINTER(1);
+ StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
bool retval;
ArrayType *q;
if ( strategy == BooleanSearchStrategy )
- PG_RETURN_BOOL(signconsistent( (QUERYTYPE*)query,
+ PG_RETURN_BOOL(signconsistent( (QUERYTYPE*)query,
SIGPTR((ArrayType *) DatumGetPointer(entry->key)),
false ) );
-
+
/* XXX what about toasted input? */
if (ARRISVOID(query))
return FALSE;
@@ -1293,7 +1293,7 @@ _int_common_union(bytea *entryvec, int *sizep, formarray unionf)
ArrayType *tmp;
#ifdef GIST_DEBUG
- elog(NOTICE, "_int_common_union in");
+ elog(DEBUG3, "_int_common_union in");
#endif
numranges = (VARSIZE(entryvec) - VARHDRSZ) / sizeof(GISTENTRY);
@@ -1314,12 +1314,12 @@ _int_common_union(bytea *entryvec, int *sizep, formarray unionf)
{
pfree(out);
#ifdef GIST_DEBUG
- elog(NOTICE, "_int_common_union out1");
+ elog(DEBUG3, "_int_common_union out1");
#endif
return NULL;
}
#ifdef GIST_DEBUG
- elog(NOTICE, "_int_common_union out");
+ elog(DEBUG3, "_int_common_union out");
#endif
return (out);
@@ -1339,7 +1339,7 @@ _int_common_penalty(GISTENTRY *origentry, GISTENTRY *newentry, float *result,
tmp2;
#ifdef GIST_DEBUG
- elog(NOTICE, "penalty");
+ elog(DEBUG3, "penalty");
#endif
ud = (*unionf) ((ArrayType *) DatumGetPointer(origentry->key),
(ArrayType *) DatumGetPointer(newentry->key));
@@ -1349,7 +1349,7 @@ _int_common_penalty(GISTENTRY *origentry, GISTENTRY *newentry, float *result,
pfree(ud);
#ifdef GIST_DEBUG
- elog(NOTICE, "--penalty\t%g", *result);
+ elog(DEBUG3, "--penalty\t%g", *result);
#endif
return (result);
@@ -1360,7 +1360,7 @@ typedef struct {
float cost;
} SPLITCOST;
-static int
+static int
comparecost( const void *a, const void *b ) {
if ( ((SPLITCOST*)a)->cost == ((SPLITCOST*)b)->cost )
return 0;
@@ -1408,7 +1408,7 @@ _int_common_picksplit(bytea *entryvec,
SPLITCOST *costvector;
#ifdef GIST_DEBUG
- elog(NOTICE, "--------picksplit %d", (VARSIZE(entryvec) - VARHDRSZ) / sizeof(GISTENTRY));
+ elog(DEBUG3, "--------picksplit %d", (VARSIZE(entryvec) - VARHDRSZ) / sizeof(GISTENTRY));
#endif
maxoff = ((VARSIZE(entryvec) - VARHDRSZ) / sizeof(GISTENTRY)) - 2;
@@ -1471,7 +1471,7 @@ _int_common_picksplit(bytea *entryvec,
maxoff = OffsetNumberNext(maxoff);
/*
- * sort entries
+ * sort entries
*/
costvector=(SPLITCOST*)palloc( sizeof(SPLITCOST)*maxoff );
for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i)) {
@@ -1486,7 +1486,7 @@ _int_common_picksplit(bytea *entryvec,
costvector[i-1].cost = abs( (size_alpha - size_l) - (size_beta - size_r) );
}
qsort( (void*)costvector, maxoff, sizeof(SPLITCOST), comparecost );
-
+
/*
* Now split up the regions between the two seeds. An important
* property of this split algorithm is that the split vector v has the
@@ -1499,7 +1499,7 @@ _int_common_picksplit(bytea *entryvec,
* tuples and i == maxoff + 1.
*/
-
+
for (j = 0; j < maxoff; j++) {
i = costvector[j].pos;
@@ -1562,13 +1562,13 @@ _int_common_picksplit(bytea *entryvec,
v->spl_rdatum = PointerGetDatum(datum_r);
#ifdef GIST_DEBUG
- elog(NOTICE, "--------ENDpicksplit %d %d", v->spl_nleft, v->spl_nright);
+ elog(DEBUG3, "--------ENDpicksplit %d %d", v->spl_nleft, v->spl_nright);
#endif
return v;
}
/*****************************************************************************
- * BoolSearch
+ * BoolSearch
*****************************************************************************/
@@ -1607,7 +1607,7 @@ typedef struct {
/*
* get token from query string
*/
-static int4
+static int4
gettoken( WORKSTATE* state, int4* val ) {
char nnn[16], *curnnn;
@@ -1616,7 +1616,7 @@ gettoken( WORKSTATE* state, int4* val ) {
switch(state->state) {
case WAITOPERAND:
curnnn=nnn;
- if ( (*(state->buf)>='0' && *(state->buf)<='9') ||
+ if ( (*(state->buf)>='0' && *(state->buf)<='9') ||
*(state->buf)=='-' ) {
state->state = WAITENDOPERAND;
*curnnn = *(state->buf);
@@ -1629,7 +1629,7 @@ gettoken( WORKSTATE* state, int4* val ) {
state->count++;
(state->buf)++;
return OPEN;
- } else if ( *(state->buf) != ' ' )
+ } else if ( *(state->buf) != ' ' )
return ERR;
break;
case WAITENDOPERAND:
@@ -1640,7 +1640,7 @@ gettoken( WORKSTATE* state, int4* val ) {
*curnnn = '\0';
*val=(int4)atoi( nnn );
state->state = WAITOPERATOR;
- return ( state->count && *(state->buf) == '\0' )
+ return ( state->count && *(state->buf) == '\0' )
? ERR : VAL;
}
break;
@@ -1648,7 +1648,7 @@ gettoken( WORKSTATE* state, int4* val ) {
if ( *(state->buf) == '&' || *(state->buf) == '|' ) {
state->state = WAITOPERAND;
*val = (int4) *(state->buf);
- (state->buf)++;
+ (state->buf)++;
return OPR;
} else if ( *(state->buf) == ')' ) {
(state->buf)++;
@@ -1659,11 +1659,11 @@ gettoken( WORKSTATE* state, int4* val ) {
} else if ( *(state->buf) != ' ' )
return ERR;
break;
- default:
+ default:
return ERR;
break;
- }
- (state->buf)++;
+ }
+ (state->buf)++;
}
return END;
}
@@ -1686,7 +1686,7 @@ pushquery( WORKSTATE *state, int4 type, int4 val ) {
/*
* make polish notaion of query
*/
-static int4
+static int4
makepol(WORKSTATE *state) {
int4 val,type;
int4 stack[STACKDEPTH];
@@ -1696,7 +1696,7 @@ makepol(WORKSTATE *state) {
switch(type) {
case VAL:
pushquery(state, type, val);
- while ( lenstack && (stack[ lenstack-1 ] == (int4)'&' ||
+ while ( lenstack && (stack[ lenstack-1 ] == (int4)'&' ||
stack[ lenstack-1 ] == (int4)'!') ) {
lenstack--;
pushquery(state, OPR, stack[ lenstack ]);
@@ -1705,7 +1705,7 @@ makepol(WORKSTATE *state) {
case OPR:
if ( lenstack && val == (int4) '|' ) {
pushquery(state, OPR, val);
- } else {
+ } else {
if ( lenstack == STACKDEPTH )
elog(ERROR,"Stack too short");
stack[ lenstack ] = val;
@@ -1714,7 +1714,7 @@ makepol(WORKSTATE *state) {
break;
case OPEN:
if ( makepol( state ) == ERR ) return ERR;
- if ( lenstack && (stack[ lenstack-1 ] == (int4)'&' ||
+ if ( lenstack && (stack[ lenstack-1 ] == (int4)'&' ||
stack[ lenstack-1 ] == (int4)'!') ) {
lenstack--;
pushquery(state, OPR, stack[ lenstack ]);
@@ -1731,7 +1731,7 @@ makepol(WORKSTATE *state) {
default:
elog(ERROR,"Syntax error");
return ERR;
-
+
}
}
@@ -1772,7 +1772,7 @@ checkcondition_arr( void *checkval, int4 val ) {
static bool
checkcondition_bit( void *checkval, int4 val ) {
- return GETBIT( checkval, HASHVAL( val ) );
+ return GETBIT( checkval, HASHVAL( val ) );
}
/*
@@ -1784,8 +1784,8 @@ execute( ITEM* curitem, void *checkval, bool calcnot, bool (*chkcond)(void *chec
if ( curitem->type == VAL ) {
return (*chkcond)( checkval, curitem->val );
} else if ( curitem->val == (int4)'!' ) {
- return ( calcnot ) ?
- ( ( execute(curitem - 1, checkval, calcnot, chkcond) ) ? false : true )
+ return ( calcnot ) ?
+ ( ( execute(curitem - 1, checkval, calcnot, chkcond) ) ? false : true )
: true;
} else if ( curitem->val == (int4)'&' ) {
if ( execute(curitem + curitem->left, checkval, calcnot, chkcond) )
@@ -1799,35 +1799,35 @@ execute( ITEM* curitem, void *checkval, bool calcnot, bool (*chkcond)(void *chec
return execute(curitem - 1, checkval, calcnot, chkcond);
}
return false;
-}
+}
/*
* signconsistent & execconsistent called by *_consistent
*/
-static bool
+static bool
signconsistent( QUERYTYPE *query, BITVEC sign, bool calcnot ) {
- return execute(
- GETQUERY(query) + query->size-1 ,
- (void*)sign, calcnot,
- checkcondition_bit
- );
+ return execute(
+ GETQUERY(query) + query->size-1 ,
+ (void*)sign, calcnot,
+ checkcondition_bit
+ );
}
-static bool
+static bool
execconsistent( QUERYTYPE *query, ArrayType *array, bool calcnot ) {
CHKVAL chkval;
chkval.arrb = ARRPTR(array);
chkval.arre = chkval.arrb + ARRNELEMS(array);
- return execute(
- GETQUERY(query) + query->size-1 ,
- (void*)&chkval, calcnot,
- checkcondition_arr
+ return execute(
+ GETQUERY(query) + query->size-1 ,
+ (void*)&chkval, calcnot,
+ checkcondition_arr
);
}
/*
- * boolean operations
+ * boolean operations
*/
Datum
rboolop(PG_FUNCTION_ARGS) {
@@ -1844,7 +1844,7 @@ boolop(PG_FUNCTION_ARGS) {
QUERYTYPE *query = ( QUERYTYPE * )PG_DETOAST_DATUM(PG_GETARG_POINTER(1));
CHKVAL chkval;
bool result;
-
+
if ( ARRISVOID( val ) ) {
pfree(val);
PG_FREE_IF_COPY(query,1);
@@ -1854,10 +1854,10 @@ boolop(PG_FUNCTION_ARGS) {
PREPAREARR(val);
chkval.arrb = ARRPTR(val);
chkval.arre = chkval.arrb + ARRNELEMS(val);
- result = execute(
- GETQUERY(query) + query->size-1 ,
- &chkval, true,
- checkcondition_arr
+ result = execute(
+ GETQUERY(query) + query->size-1 ,
+ &chkval, true,
+ checkcondition_arr
);
pfree(val);
@@ -1868,7 +1868,7 @@ boolop(PG_FUNCTION_ARGS) {
static void
findoprnd( ITEM *ptr, int4 *pos ) {
#ifdef BS_DEBUG
- elog(NOTICE, ( ptr[*pos].type == OPR ) ?
+ elog(DEBUG3, ( ptr[*pos].type == OPR ) ?
"%d %c" : "%d %d ", *pos, ptr[*pos].val );
#endif
if ( ptr[*pos].type == VAL ) {
@@ -1880,7 +1880,7 @@ findoprnd( ITEM *ptr, int4 *pos ) {
findoprnd( ptr, pos );
} else {
ITEM *curitem = &ptr[*pos];
- int4 tmp = *pos;
+ int4 tmp = *pos;
(*pos)--;
findoprnd(ptr,pos);
curitem->left = *pos - tmp;
@@ -1914,7 +1914,7 @@ bqarr_in(PG_FUNCTION_ARGS) {
/* make polish notation (postfix, but in reverse order) */
makepol( &state );
- if (!state.num)
+ if (!state.num)
elog( ERROR,"Empty query");
commonlen = COMPUTESIZE(state.num);
@@ -1924,26 +1924,26 @@ bqarr_in(PG_FUNCTION_ARGS) {
ptr = GETQUERY(query);
for(i=state.num-1; i>=0; i-- ) {
- ptr[i].type = state.str->type;
+ ptr[i].type = state.str->type;
ptr[i].val = state.str->val;
tmp = state.str->next;
pfree( state.str );
state.str = tmp;
}
-
+
pos = query->size-1;
findoprnd( ptr, &pos );
#ifdef BS_DEBUG
cur = pbuf;
*cur = '\0';
for( i=0;i<query->size;i++ ) {
- if ( ptr[i].type == OPR )
+ if ( ptr[i].type == OPR )
sprintf(cur, "%c(%d) ", ptr[i].val, ptr[i].left);
- else
+ else
sprintf(cur, "%d ", ptr[i].val );
- cur = strchr(cur,'\0');
+ cur = strchr(cur,'\0');
}
- elog(NOTICE,"POR: %s", pbuf);
+ elog(DEBUG3,"POR: %s", pbuf);
#endif
PG_RETURN_POINTER( query );
@@ -1986,17 +1986,17 @@ infix(INFIX *in, bool first) {
RESIZEBUF(in, 2);
sprintf(in->cur, "( ");
in->cur = strchr( in->cur, '\0' );
- }
+ }
infix( in, isopr );
if ( isopr ) {
RESIZEBUF(in, 2);
sprintf(in->cur, " )");
in->cur = strchr( in->cur, '\0' );
- }
+ }
} else {
int4 op = in->curpol->val;
INFIX nrm;
-
+
in->curpol--;
if ( op == (int4)'|' && ! first) {
RESIZEBUF(in, 2);
@@ -2007,10 +2007,10 @@ infix(INFIX *in, bool first) {
nrm.curpol = in->curpol;
nrm.buflen = 16;
nrm.cur = nrm.buf = (char*)palloc( sizeof(char) * nrm.buflen );
-
+
/* get right operand */
infix( &nrm, false );
-
+
/* get & print left operand */
in->curpol = nrm.curpol;
infix( in, false );
@@ -2036,13 +2036,13 @@ bqarr_out(PG_FUNCTION_ARGS) {
INFIX nrm;
if ( query->size == 0 )
- elog(ERROR,"Empty");
+ elog(ERROR,"Empty");
nrm.curpol = GETQUERY(query) + query->size - 1;
nrm.buflen = 32;
nrm.cur = nrm.buf = (char*)palloc( sizeof(char) * nrm.buflen );
*(nrm.cur) = '\0';
infix( &nrm, true );
-
+
PG_FREE_IF_COPY(query,0);
PG_RETURN_POINTER( nrm.buf );
}
@@ -2054,16 +2054,16 @@ countdroptree( ITEM *q, int4 pos ) {
} else if ( q[pos].val == (int4)'!' ) {
return 1+countdroptree(q, pos-1);
} else {
- return 1 + countdroptree(q, pos-1) + countdroptree(q, pos + q[pos].left);
- }
+ return 1 + countdroptree(q, pos-1) + countdroptree(q, pos + q[pos].left);
+ }
}
/*
* common algorithm:
- * result of all '!' will be = 'true', so
+ * result of all '!' will be = 'true', so
* we can modify query tree for clearing
*/
-static int4
+static int4
shorterquery( ITEM *q, int4 len ) {
int4 index,posnot,poscor;
bool notisleft = false;
@@ -2093,7 +2093,7 @@ shorterquery( ITEM *q, int4 len ) {
if ( poscor == posnot+1 ) {
notisleft = false;
break;
- } else if ( q[poscor].left + poscor == posnot ) {
+ } else if ( q[poscor].left + poscor == posnot ) {
notisleft = true;
break;
}
@@ -2104,9 +2104,9 @@ shorterquery( ITEM *q, int4 len ) {
q[poscor-1].type=VAL;
for(i=poscor+1;i<len;i++)
if ( q[i].type == OPR && q[i].left + i <= poscor )
- q[i].left += drop - 2;
- memcpy( (void*)&q[poscor-drop+1],
- (void*)&q[poscor-1],
+ q[i].left += drop - 2;
+ memcpy( (void*)&q[poscor-drop+1],
+ (void*)&q[poscor-1],
sizeof(ITEM) * ( len - (poscor-1) ));
len -= drop - 2;
} else if ( q[poscor].val == (int4)'|' ) {
@@ -2116,16 +2116,16 @@ shorterquery( ITEM *q, int4 len ) {
q[poscor].left=-1;
for(i=poscor+1;i<len;i++)
if ( q[i].type == OPR && q[i].left + i < poscor )
- q[i].left += drop - 2;
- memcpy( (void*)&q[poscor-drop+1],
- (void*)&q[poscor-1],
+ q[i].left += drop - 2;
+ memcpy( (void*)&q[poscor-drop+1],
+ (void*)&q[poscor-1],
sizeof(ITEM) * ( len - (poscor-1) ));
len -= drop - 2;
} else { /* &-operator */
- if (
- (notisleft && q[poscor-1].type == OPR &&
+ if (
+ (notisleft && q[poscor-1].type == OPR &&
q[poscor-1].val == (int4)'!' ) ||
- (!notisleft && q[poscor+q[poscor].left].type == OPR &&
+ (!notisleft && q[poscor+q[poscor].left].type == OPR &&
q[poscor+q[poscor].left].val == (int4)'!' )
) { /* drop subtree */
drop = countdroptree(q, poscor);
@@ -2134,26 +2134,26 @@ shorterquery( ITEM *q, int4 len ) {
q[poscor].left=-1;
for(i=poscor+1;i<len;i++)
if ( q[i].type == OPR && q[i].left + i < poscor )
- q[i].left += drop - 2;
- memcpy( (void*)&q[poscor-drop+1],
- (void*)&q[poscor-1],
+ q[i].left += drop - 2;
+ memcpy( (void*)&q[poscor-drop+1],
+ (void*)&q[poscor-1],
sizeof(ITEM) * ( len - (poscor-1) ));
len -= drop - 2;
} else { /* drop only operator */
- int4 subtreepos = ( notisleft ) ?
+ int4 subtreepos = ( notisleft ) ?
poscor-1 : poscor+q[poscor].left;
int4 subtreelen = countdroptree( q, subtreepos );
drop = countdroptree(q, poscor);
for(i=poscor+1;i<len;i++)
if ( q[i].type == OPR && q[i].left + i < poscor )
- q[i].left += drop - subtreelen;
- memcpy( (void*)&q[ subtreepos+1 ],
- (void*)&q[poscor+1],
- sizeof(ITEM)*( len - (poscor-1) ) );
- memcpy( (void*)&q[ poscor-drop+1 ],
- (void*)&q[subtreepos-subtreelen+1],
+ q[i].left += drop - subtreelen;
+ memcpy( (void*)&q[ subtreepos+1 ],
+ (void*)&q[poscor+1],
+ sizeof(ITEM)*( len - (poscor-1) ) );
+ memcpy( (void*)&q[ poscor-drop+1 ],
+ (void*)&q[subtreepos-subtreelen+1],
sizeof(ITEM)*( len - (drop-subtreelen) ) );
- len -= drop - subtreelen;
+ len -= drop - subtreelen;
}
}
} while( index );
diff --git a/contrib/miscutil/misc_utils.c b/contrib/miscutil/misc_utils.c
index 0779fcc1fc..d313392965 100644
--- a/contrib/miscutil/misc_utils.c
+++ b/contrib/miscutil/misc_utils.c
@@ -103,10 +103,7 @@ active_listeners(text *relname)
d = heap_getattr(lTuple, Anum_pg_listener_pid, tdesc, &isnull);
pid = DatumGetInt32(d);
if ((pid == ourpid) || (kill(pid, SIGTSTP) == 0))
- {
- /* elog(NOTICE, "%d ok", pid); */
count++;
- }
}
heap_endscan(sRel);
diff --git a/contrib/noupdate/noup.c b/contrib/noupdate/noup.c
index af857c41f6..3fac897742 100644
--- a/contrib/noupdate/noup.c
+++ b/contrib/noupdate/noup.c
@@ -95,7 +95,7 @@ noup(PG_FUNCTION_ARGS)
if (!isnull)
{
- elog(NOTICE, "%s: update not allowed", args[i]);
+ elog(WARNING, "%s: update not allowed", args[i]);
SPI_finish();
return PointerGetDatum(NULL);
}
diff --git a/contrib/pgcrypto/px.c b/contrib/pgcrypto/px.c
index 891888efb9..ed7e330edc 100644
--- a/contrib/pgcrypto/px.c
+++ b/contrib/pgcrypto/px.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: px.c,v 1.6 2001/11/20 18:54:07 momjian Exp $
+ * $Id: px.c,v 1.7 2002/03/06 06:09:10 momjian Exp $
*/
#include <postgres.h>
@@ -217,7 +217,7 @@ combo_decrypt(PX_Combo * cx, const uint8 *data, unsigned dlen,
/* error reporting should be done in pgcrypto.c */
block_error:
- elog(NOTICE, "Data not a multiple of block size");
+ elog(WARNING, "Data not a multiple of block size");
return -1;
}
diff --git a/contrib/pgstattuple/pgstattuple.c b/contrib/pgstattuple/pgstattuple.c
index b5afab80de..beda282172 100644
--- a/contrib/pgstattuple/pgstattuple.c
+++ b/contrib/pgstattuple/pgstattuple.c
@@ -1,5 +1,5 @@
/*
- * $Header: /cvsroot/pgsql/contrib/pgstattuple/pgstattuple.c,v 1.3 2001/12/19 20:28:41 tgl Exp $
+ * $Header: /cvsroot/pgsql/contrib/pgstattuple/pgstattuple.c,v 1.4 2002/03/06 06:09:10 momjian Exp $
*
* Copyright (c) 2001 Tatsuo Ishii
*
@@ -123,7 +123,7 @@ pgstattuple(PG_FUNCTION_ARGS)
free_percent = (double) free_space *100.0 / table_len;
}
- elog(NOTICE, "physical length: %.2fMB live tuples: %.0f (%.2fMB, %.2f%%) dead tuples: %.0f (%.2fMB, %.2f%%) free/reusable space: %.2fMB (%.2f%%) overhead: %.2f%%",
+ elog(DEBUG3, "physical length: %.2fMB live tuples: %.0f (%.2fMB, %.2f%%) dead tuples: %.0f (%.2fMB, %.2f%%) free/reusable space: %.2fMB (%.2f%%) overhead: %.2f%%",
table_len / (1024 * 1024), /* physical length in MB */
diff --git a/contrib/rserv/rserv.c b/contrib/rserv/rserv.c
index 6faab692d7..401cc5fd9c 100644
--- a/contrib/rserv/rserv.c
+++ b/contrib/rserv/rserv.c
@@ -132,7 +132,7 @@ _rserv_log_()
GetCurrentTransactionId(), deleted, rel->rd_id, okey);
if (debug)
- elog(NOTICE, sql);
+ elog(DEBUG3, sql);
ret = SPI_exec(sql, 0);
@@ -153,7 +153,7 @@ _rserv_log_()
deleted, okey);
if (debug)
- elog(NOTICE, sql);
+ elog(DEBUG3, sql);
ret = SPI_exec(sql, 0);
@@ -177,7 +177,7 @@ _rserv_log_()
rel->rd_id, GetCurrentTransactionId(), okey);
if (debug)
- elog(NOTICE, sql);
+ elog(DEBUG3, sql);
ret = SPI_exec(sql, 0);
diff --git a/contrib/spi/refint.c b/contrib/spi/refint.c
index b4e6845ac6..82a07871fb 100644
--- a/contrib/spi/refint.c
+++ b/contrib/spi/refint.c
@@ -59,7 +59,7 @@ check_primary_key(PG_FUNCTION_ARGS)
int i;
#ifdef DEBUG_QUERY
- elog(NOTICE, "Check_primary_key Enter Function");
+ elog(DEBUG3, "Check_primary_key Enter Function");
#endif
/*
@@ -249,7 +249,7 @@ check_foreign_key(PG_FUNCTION_ARGS)
r;
#ifdef DEBUG_QUERY
- elog(NOTICE, "Check_foreign_key Enter Function");
+ elog(DEBUG3, "Check_foreign_key Enter Function");
#endif
/*
@@ -453,7 +453,7 @@ check_foreign_key(PG_FUNCTION_ARGS)
strcmp(type, "date") && strcmp(type, "datetime")) == 0)
is_char_type = 1;
#ifdef DEBUG_QUERY
- elog(NOTICE, "Check_foreign_key Debug value %s type %s %d",
+ elog(DEBUG3, "Check_foreign_key Debug value %s type %s %d",
nv, type, is_char_type);
#endif
@@ -519,7 +519,7 @@ check_foreign_key(PG_FUNCTION_ARGS)
}
plan->nplans = nrefs;
#ifdef DEBUG_QUERY
- elog(NOTICE, "Check_foreign_key Debug Query is : %s ", sql);
+ elog(DEBUG3, "Check_foreign_key Debug Query is : %s ", sql);
#endif
}
@@ -563,7 +563,7 @@ check_foreign_key(PG_FUNCTION_ARGS)
}
#ifdef REFINT_VERBOSE
else
- elog(NOTICE, "%s: %d tuple(s) of %s are %s",
+ elog(DEBUG3, "%s: %d tuple(s) of %s are %s",
trigger->tgname, SPI_processed, relname,
(action == 'c') ? "deleted" : "setted to null");
#endif
diff --git a/contrib/tsearch/query.c b/contrib/tsearch/query.c
index 46703d70a3..6666720c9b 100644
--- a/contrib/tsearch/query.c
+++ b/contrib/tsearch/query.c
@@ -449,7 +449,7 @@ static void
findoprnd(ITEM * ptr, int4 *pos)
{
#ifdef BS_DEBUG
- elog(NOTICE, (ptr[*pos].type == OPR) ?
+ elog(DEBUG3, (ptr[*pos].type == OPR) ?
"%d %c" : "%d %d ", *pos, ptr[*pos].val);
#endif
if (ptr[*pos].type == VAL || ptr[*pos].type == VALTRUE)
@@ -557,7 +557,7 @@ queryin(char *buf, void (*pushval) (QPRS_STATE *, int, char *, int))
sprintf(cur, "%d(%s) ", ptr[i].val, GETOPERAND(query) + ptr[i].distance);
cur = strchr(cur, '\0');
}
- elog(NOTICE, "POR: %s", pbuf);
+ elog(DEBUG3, "POR: %s", pbuf);
#endif
return query;
@@ -609,7 +609,7 @@ mqtxt_in(PG_FUNCTION_ARGS)
sprintf(cur, "%d(%s) ", ptr[i].val, GETOPERAND(query) + ptr[i].distance);
cur = strchr(cur, '\0');
}
- elog(NOTICE, "POR: %s", pbuf);
+ elog(DEBUG3, "POR: %s", pbuf);
#endif
pfree(res);
PG_RETURN_POINTER(query);
diff --git a/contrib/tsearch/txtidx.c b/contrib/tsearch/txtidx.c
index 5eeb69b151..14f69913b7 100644
--- a/contrib/tsearch/txtidx.c
+++ b/contrib/tsearch/txtidx.c
@@ -556,7 +556,7 @@ tsearch(PG_FUNCTION_ARGS)
oidtype = SPI_gettypeid(rel->rd_att, numattr);
if (numattr < 0 || (!(oidtype == TEXTOID || oidtype == VARCHAROID)))
{
- elog(NOTICE, "TSearch: can not find field '%s'", trigger->tgargs[i]);
+ elog(WARNING, "TSearch: can not find field '%s'", trigger->tgargs[i]);
continue;
}
txt_toasted = (text *) DatumGetPointer(SPI_getbinval(rettuple, rel->rd_att, numattr, &isnull));
diff --git a/contrib/xml/pgxml.c b/contrib/xml/pgxml.c
index 3939250e25..682e7395b9 100644
--- a/contrib/xml/pgxml.c
+++ b/contrib/xml/pgxml.c
@@ -75,7 +75,7 @@ pgxml_parse(PG_FUNCTION_ARGS)
if (!XML_Parse(p, (char *) VARDATA(t), docsize, 1))
{
/*
- * elog(NOTICE, "Parse error at line %d:%s",
+ * elog(WARNING, "Parse error at line %d:%s",
* XML_GetCurrentLineNumber(p),
* XML_ErrorString(XML_GetErrorCode(p)));
*/
@@ -158,7 +158,7 @@ build_xpath_results(text *doc, text *pathstr)
if (!XML_Parse(p, (char *) VARDATA(doc), docsize, 1))
{
/*
- * elog(NOTICE, "Parse error at line %d:%s",
+ * elog(WARNING, "Parse error at line %d:%s",
* XML_GetCurrentLineNumber(p),
* XML_ErrorString(XML_GetErrorCode(p)));
*/
@@ -267,7 +267,7 @@ pgxml_starthandler(void *userData, const XML_Char * name,
char sepstr[] = "/";
if ((strlen(name) + strlen(UD->currentpath)) > MAXPATHLENGTH - 2)
- elog(NOTICE, "Path too long");
+ elog(WARNING, "Path too long");
else
{
strncat(UD->currentpath, sepstr, 1);
@@ -302,7 +302,7 @@ pgxml_endhandler(void *userData, const XML_Char * name)
}
if (strcmp(name, sepptr + 1) != 0)
{
- elog(NOTICE, "Wanted [%s], got [%s]", sepptr, name);
+ elog(WARNING, "Wanted [%s], got [%s]", sepptr, name);
/* unmatched entry, so do nothing */
}
else
diff --git a/contrib/xml/pgxml_dom.c b/contrib/xml/pgxml_dom.c
index f2f9973b89..0c22aced06 100644
--- a/contrib/xml/pgxml_dom.c
+++ b/contrib/xml/pgxml_dom.c
@@ -213,7 +213,7 @@ pgxml_xpath(PG_FUNCTION_ARGS)
comppath = xmlXPathCompile(xpath);
if (comppath == NULL)
{
- elog(NOTICE, "XPath syntax error");
+ elog(WARNING, "XPath syntax error");
xmlFreeDoc(doctree);
pfree((void *) xpath);
PG_RETURN_NULL();
@@ -242,7 +242,7 @@ pgxml_xpath(PG_FUNCTION_ARGS)
xpresstr = xmlStrdup(res->stringval);
break;
default:
- elog(NOTICE, "Unsupported XQuery result: %d", res->type);
+ elog(WARNING, "Unsupported XQuery result: %d", res->type);
xpresstr = xmlStrdup("<unsupported/>");
}