Latest round of fmgr updates. All functions with bool,char, or int2

inputs have been converted to newstyle.  This should go a long way towards
fixing our portability problems with platforms where char and short
parameters are passed differently from int-width parameters.  Still
more to do for the Alpha port however.
This commit is contained in:
Tom Lane 2000-06-05 07:29:25 +00:00
parent c61db5ba2d
commit 48165ec226
47 changed files with 2201 additions and 2034 deletions

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.25 2000/04/12 17:14:44 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.26 2000/06/05 07:28:35 tgl Exp $
* *
* NOTES * NOTES
* These functions are stored in pg_amproc. For each operator class * These functions are stored in pg_amproc. For each operator class
@ -21,134 +21,132 @@
#include "access/hash.h" #include "access/hash.h"
uint32 Datum
hashint2(int16 key) hashint2(PG_FUNCTION_ARGS)
{ {
return (uint32) ~key; PG_RETURN_UINT32((uint32) ~ PG_GETARG_INT16(0));
} }
uint32 Datum
hashint4(uint32 key) hashint4(PG_FUNCTION_ARGS)
{ {
return ~key; PG_RETURN_UINT32(~ PG_GETARG_UINT32(0));
} }
uint32 Datum
hashint8(int64 *key) hashint8(PG_FUNCTION_ARGS)
{ {
return ~((uint32) *key); /* we just use the low 32 bits... */
PG_RETURN_UINT32(~((uint32) PG_GETARG_INT64(0)));
} }
/* Hash function from Chris Torek. */ /* Hash function from Chris Torek. */
uint32 Datum
hashfloat4(float32 keyp) hashfloat4(PG_FUNCTION_ARGS)
{ {
int len; float4 key = PG_GETARG_FLOAT4(0);
char *kp = (char *) &key;
int len = sizeof(key);
int loop; int loop;
uint32 h; uint32 h;
char *kp = (char *) keyp;
len = sizeof(float32data);
#define HASH4a h = (h << 5) - h + *kp++; #define HASH4a h = (h << 5) - h + *kp++;
#define HASH4b h = (h << 5) + h + *kp++; #define HASH4b h = (h << 5) + h + *kp++;
#define HASH4 HASH4b #define HASH4 HASH4b
h = 0; h = 0;
if (len > 0) /*
{ * This is a tad silly, given that we expect len = 4, but a smart
loop = (len + 8 - 1) >> 3; * compiler should be able to eliminate the redundant code...
*/
loop = (len + 8 - 1) >> 3;
switch (len & (8 - 1)) switch (len & (8 - 1))
{ {
case 0: case 0:
do do
{ /* All fall throughs */ { /* All fall throughs */
HASH4; HASH4;
case 7: case 7:
HASH4; HASH4;
case 6: case 6:
HASH4; HASH4;
case 5: case 5:
HASH4; HASH4;
case 4: case 4:
HASH4; HASH4;
case 3: case 3:
HASH4; HASH4;
case 2: case 2:
HASH4; HASH4;
case 1: case 1:
HASH4; HASH4;
} while (--loop); } while (--loop);
}
} }
return h; PG_RETURN_UINT32(h);
} }
Datum
uint32 hashfloat8(PG_FUNCTION_ARGS)
hashfloat8(float64 keyp)
{ {
int len; float8 key = PG_GETARG_FLOAT8(0);
char *kp = (char *) &key;
int len = sizeof(key);
int loop; int loop;
uint32 h; uint32 h;
char *kp = (char *) keyp;
len = sizeof(float64data);
#define HASH4a h = (h << 5) - h + *kp++; #define HASH4a h = (h << 5) - h + *kp++;
#define HASH4b h = (h << 5) + h + *kp++; #define HASH4b h = (h << 5) + h + *kp++;
#define HASH4 HASH4b #define HASH4 HASH4b
h = 0; h = 0;
if (len > 0) /*
* This is a tad silly, given that we expect len = 8, but a smart
* compiler should be able to eliminate the redundant code...
*/
loop = (len + 8 - 1) >> 3;
switch (len & (8 - 1))
{ {
loop = (len + 8 - 1) >> 3; case 0:
do
switch (len & (8 - 1)) { /* All fall throughs */
{ HASH4;
case 0: case 7:
do HASH4;
{ /* All fall throughs */ case 6:
HASH4; HASH4;
case 7: case 5:
HASH4; HASH4;
case 6: case 4:
HASH4; HASH4;
case 5: case 3:
HASH4; HASH4;
case 4: case 2:
HASH4; HASH4;
case 3: case 1:
HASH4; HASH4;
case 2: } while (--loop);
HASH4;
case 1:
HASH4;
} while (--loop);
}
} }
return h; PG_RETURN_UINT32(h);
} }
Datum
uint32 hashoid(PG_FUNCTION_ARGS)
hashoid(Oid key)
{ {
return (uint32) ~key; PG_RETURN_UINT32(~(uint32) PG_GETARG_OID(0));
} }
uint32 Datum
hashoidvector(Oid *key) hashoidvector(PG_FUNCTION_ARGS)
{ {
Oid *key = (Oid *) PG_GETARG_POINTER(0);
int i; int i;
uint32 result = 0; uint32 result = 0;
for (i = INDEX_MAX_KEYS; --i >= 0;) for (i = INDEX_MAX_KEYS; --i >= 0;)
result = (result << 1) ^ (~(uint32) key[i]); result = (result << 1) ^ (~(uint32) key[i]);
return result; PG_RETURN_UINT32(result);
} }
/* /*
@ -156,55 +154,50 @@ hashoidvector(Oid *key)
* hash function, because it has no pg_proc entry. We only need it * hash function, because it has no pg_proc entry. We only need it
* for catcache indexing. * for catcache indexing.
*/ */
uint32 Datum
hashint2vector(int16 *key) hashint2vector(PG_FUNCTION_ARGS)
{ {
int16 *key = (int16 *) PG_GETARG_POINTER(0);
int i; int i;
uint32 result = 0; uint32 result = 0;
for (i = INDEX_MAX_KEYS; --i >= 0;) for (i = INDEX_MAX_KEYS; --i >= 0;)
result = (result << 1) ^ (~(uint32) key[i]); result = (result << 1) ^ (~(uint32) key[i]);
return result; PG_RETURN_UINT32(result);
} }
#define PRIME1 37 #define PRIME1 37
#define PRIME2 1048583 #define PRIME2 1048583
uint32 Datum
hashchar(char key) hashchar(PG_FUNCTION_ARGS)
{ {
uint32 h; uint32 h;
/* Convert char to integer */ /* Convert char to integer */
h = (key - ' '); h = (PG_GETARG_CHAR(0) - ' ');
h %= PRIME2; h %= PRIME2;
return h; PG_RETURN_UINT32(h);
} }
Datum
uint32 hashname(PG_FUNCTION_ARGS)
hashname(NameData *n)
{ {
char *key = NameStr(* PG_GETARG_NAME(0));
int len = NAMEDATALEN;
uint32 h; uint32 h;
int len;
char *key;
key = NameStr(*n);
h = 0; h = 0;
len = NAMEDATALEN;
/* Convert string to integer */ /* Convert string to integer */
while (len--) while (len--)
h = h * PRIME1 ^ (*key++ - ' '); h = h * PRIME1 ^ (*key++ - ' ');
h %= PRIME2; h %= PRIME2;
return h; PG_RETURN_UINT32(h);
} }
/* /*
* (Comment from the original db3 hashing code: ) * (Comment from the original db3 hashing code: )
* *
@ -216,19 +209,17 @@ hashname(NameData *n)
* *
* "OZ's original sdbm hash" * "OZ's original sdbm hash"
*/ */
uint32 Datum
hashtext(struct varlena * key) hashtext(PG_FUNCTION_ARGS)
{ {
text *key = PG_GETARG_TEXT_P(0);
int keylen; int keylen;
char *keydata; char *keydata;
uint32 n; uint32 n;
int loop; int loop;
keydata = VARDATA(key); keydata = VARDATA(key);
keylen = VARSIZE(key); keylen = VARSIZE(key) - VARHDRSZ;
/* keylen includes the four bytes in which string keylength is stored */
keylen -= sizeof(VARSIZE(key));
#define HASHC n = *keydata++ + 65599 * n #define HASHC n = *keydata++ + 65599 * n
@ -260,5 +251,5 @@ hashtext(struct varlena * key)
} while (--loop); } while (--loop);
} }
} }
return n; PG_RETURN_UINT32(n);
} }

View File

@ -8,141 +8,203 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.34 2000/04/12 17:14:49 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.35 2000/06/05 07:28:36 tgl Exp $
* *
* NOTES * NOTES
* These functions are stored in pg_amproc. For each operator class *
* defined on btrees, they compute * These functions are stored in pg_amproc. For each operator class
* defined on btrees, they compute
* *
* compare(a, b): * compare(a, b):
* < 0 if a < b, * < 0 if a < b,
* = 0 if a == b, * = 0 if a == b,
* > 0 if a > b. * > 0 if a > b.
*
* The result is always an int32 regardless of the input datatype.
*
* NOTE: although any negative int32 is acceptable for reporting "<",
* and any positive int32 is acceptable for reporting ">", routines
* that work on 32-bit or wider datatypes can't just return "a - b".
* That could overflow and give the wrong answer.
*
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
#include "postgres.h" #include "postgres.h"
#include "utils/builtins.h" #include "utils/builtins.h"
int32 Datum
btint2cmp(int16 a, int16 b) btboolcmp(PG_FUNCTION_ARGS)
{ {
return (int32) (a - b); bool a = PG_GETARG_BOOL(0);
bool b = PG_GETARG_BOOL(1);
PG_RETURN_INT32((int32) a - (int32) b);
} }
int32 Datum
btint4cmp(int32 a, int32 b) btint2cmp(PG_FUNCTION_ARGS)
{ {
int16 a = PG_GETARG_INT16(0);
int16 b = PG_GETARG_INT16(1);
PG_RETURN_INT32((int32) a - (int32) b);
}
Datum
btint4cmp(PG_FUNCTION_ARGS)
{
int32 a = PG_GETARG_INT32(0);
int32 b = PG_GETARG_INT32(1);
if (a > b) if (a > b)
return 1; PG_RETURN_INT32(1);
else if (a == b) else if (a == b)
return 0; PG_RETURN_INT32(0);
else else
return -1; PG_RETURN_INT32(-1);
} }
int32 Datum
btint8cmp(int64 *a, int64 *b) btint8cmp(PG_FUNCTION_ARGS)
{ {
if (*a > *b) int64 a = PG_GETARG_INT64(0);
return 1; int64 b = PG_GETARG_INT64(1);
else if (*a == *b)
return 0;
else
return -1;
}
int32
btint24cmp(int16 a, int32 b)
{
return ((int32) a) - b;
}
int32
btint42cmp(int32 a, int16 b)
{
return a - ((int32) b);
}
int32
btfloat4cmp(float32 a, float32 b)
{
if (*a > *b)
return 1;
else if (*a == *b)
return 0;
else
return -1;
}
int32
btfloat8cmp(float64 a, float64 b)
{
if (*a > *b)
return 1;
else if (*a == *b)
return 0;
else
return -1;
}
int32
btoidcmp(Oid a, Oid b)
{
if (a > b) if (a > b)
return 1; PG_RETURN_INT32(1);
else if (a == b) else if (a == b)
return 0; PG_RETURN_INT32(0);
else else
return -1; PG_RETURN_INT32(-1);
} }
int32 Datum
btoidvectorcmp(Oid *a, Oid *b) btint24cmp(PG_FUNCTION_ARGS)
{ {
int16 a = PG_GETARG_INT16(0);
int32 b = PG_GETARG_INT32(1);
if (a > b)
PG_RETURN_INT32(1);
else if (a == b)
PG_RETURN_INT32(0);
else
PG_RETURN_INT32(-1);
}
Datum
btint42cmp(PG_FUNCTION_ARGS)
{
int32 a = PG_GETARG_INT32(0);
int16 b = PG_GETARG_INT16(1);
if (a > b)
PG_RETURN_INT32(1);
else if (a == b)
PG_RETURN_INT32(0);
else
PG_RETURN_INT32(-1);
}
Datum
btfloat4cmp(PG_FUNCTION_ARGS)
{
float4 a = PG_GETARG_FLOAT4(0);
float4 b = PG_GETARG_FLOAT4(1);
if (a > b)
PG_RETURN_INT32(1);
else if (a == b)
PG_RETURN_INT32(0);
else
PG_RETURN_INT32(-1);
}
Datum
btfloat8cmp(PG_FUNCTION_ARGS)
{
float8 a = PG_GETARG_FLOAT8(0);
float8 b = PG_GETARG_FLOAT8(1);
if (a > b)
PG_RETURN_INT32(1);
else if (a == b)
PG_RETURN_INT32(0);
else
PG_RETURN_INT32(-1);
}
Datum
btoidcmp(PG_FUNCTION_ARGS)
{
Oid a = PG_GETARG_OID(0);
Oid b = PG_GETARG_OID(1);
if (a > b)
PG_RETURN_INT32(1);
else if (a == b)
PG_RETURN_INT32(0);
else
PG_RETURN_INT32(-1);
}
Datum
btoidvectorcmp(PG_FUNCTION_ARGS)
{
Oid *a = (Oid *) PG_GETARG_POINTER(0);
Oid *b = (Oid *) PG_GETARG_POINTER(1);
int i; int i;
for (i = 0; i < INDEX_MAX_KEYS; i++) for (i = 0; i < INDEX_MAX_KEYS; i++)
/* we use this because we need the int4gt, etc */ {
if (!int4eq(a[i], b[i])) if (a[i] != b[i])
{ {
if (int4gt(a[i], b[i])) if (a[i] > b[i])
return 1; PG_RETURN_INT32(1);
else else
return -1; PG_RETURN_INT32(-1);
} }
return 0; }
PG_RETURN_INT32(0);
} }
int32 int32
btabstimecmp(AbsoluteTime a, AbsoluteTime b) btabstimecmp(AbsoluteTime a, AbsoluteTime b)
{ {
if (AbsoluteTimeIsBefore(a, b)) if (AbsoluteTimeIsBefore(a, b))
return -1; PG_RETURN_INT32(-1);
else if (AbsoluteTimeIsBefore(b, a)) else if (AbsoluteTimeIsBefore(b, a))
return 1; PG_RETURN_INT32(1);
else else
return 0; PG_RETURN_INT32(0);
} }
int32 Datum
btcharcmp(char a, char b) btcharcmp(PG_FUNCTION_ARGS)
{ {
return (int32) ((uint8) a - (uint8) b); char a = PG_GETARG_CHAR(0);
char b = PG_GETARG_CHAR(1);
/* Be careful to compare chars as unsigned */
PG_RETURN_INT32((int32) ((uint8) a) - (int32) ((uint8) b));
} }
int32 Datum
btnamecmp(NameData *a, NameData *b) btnamecmp(PG_FUNCTION_ARGS)
{ {
return strncmp(NameStr(*a), NameStr(*b), NAMEDATALEN); Name a = PG_GETARG_NAME(0);
Name b = PG_GETARG_NAME(1);
PG_RETURN_INT32(strncmp(NameStr(*a), NameStr(*b), NAMEDATALEN));
} }
int32 Datum
bttextcmp(struct varlena * a, struct varlena * b) bttextcmp(PG_FUNCTION_ARGS)
{ {
text *a = PG_GETARG_TEXT_P(0);
text *b = PG_GETARG_TEXT_P(1);
int res; int res;
unsigned char *ap, unsigned char *ap,
*bp; *bp;
@ -187,7 +249,7 @@ bttextcmp(struct varlena * a, struct varlena * b)
{ {
do do
{ {
res = (int) (*ap++ - *bp++); res = (int) *ap++ - (int) *bp++;
len--; len--;
} while (res == 0 && len != 0); } while (res == 0 && len != 0);
} }
@ -195,7 +257,7 @@ bttextcmp(struct varlena * a, struct varlena * b)
#endif #endif
if (res != 0 || VARSIZE(a) == VARSIZE(b)) if (res != 0 || VARSIZE(a) == VARSIZE(b))
return res; PG_RETURN_INT32(res);
/* /*
* The two strings are the same in the first len bytes, and they are * The two strings are the same in the first len bytes, and they are
@ -203,13 +265,7 @@ bttextcmp(struct varlena * a, struct varlena * b)
*/ */
if (VARSIZE(a) < VARSIZE(b)) if (VARSIZE(a) < VARSIZE(b))
return -1; PG_RETURN_INT32(-1);
else else
return 1; PG_RETURN_INT32(1);
}
int32
btboolcmp(bool a, bool b)
{
return (int32) ((uint8) a - (uint8) b);
} }

View File

@ -1,12 +1,12 @@
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* *
* xid.c * xid.c
* POSTGRES transaction identifier code. * POSTGRES transaction identifier type.
* *
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: xid.c,v 1.27 2000/01/26 05:56:04 momjian Exp $ * $Id: xid.c,v 1.28 2000/06/05 07:28:38 tgl Exp $
* *
* OLD COMMENTS * OLD COMMENTS
* XXX WARNING * XXX WARNING
@ -19,33 +19,42 @@
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
#include "postgres.h" #include "postgres.h"
#include "access/xact.h" #include "access/xact.h"
/*
* TransactionId is typedef'd as uint32, so...
*/
#define PG_GETARG_TRANSACTIONID(n) PG_GETARG_UINT32(n)
#define PG_RETURN_TRANSACTIONID(x) PG_RETURN_UINT32(x)
extern TransactionId NullTransactionId; extern TransactionId NullTransactionId;
extern TransactionId DisabledTransactionId; extern TransactionId DisabledTransactionId;
extern TransactionId AmiTransactionId; extern TransactionId AmiTransactionId;
extern TransactionId FirstTransactionId; extern TransactionId FirstTransactionId;
/* XXX name for catalogs */ /* XXX name for catalogs */
TransactionId Datum
xidin(char *representation) xidin(PG_FUNCTION_ARGS)
{ {
return atol(representation); char *representation = PG_GETARG_CSTRING(0);
PG_RETURN_TRANSACTIONID((TransactionId) atol(representation));
} }
/* XXX name for catalogs */ /* XXX name for catalogs */
char * Datum
xidout(TransactionId transactionId) xidout(PG_FUNCTION_ARGS)
{ {
TransactionId transactionId = PG_GETARG_TRANSACTIONID(0);
/* maximum 32 bit unsigned integer representation takes 10 chars */ /* maximum 32 bit unsigned integer representation takes 10 chars */
char *representation = palloc(11); char *representation = palloc(11);
snprintf(representation, 11, "%u", transactionId); snprintf(representation, 11, "%lu", (unsigned long) transactionId);
return representation;
PG_RETURN_CSTRING(representation);
} }
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
@ -57,14 +66,15 @@ xidout(TransactionId transactionId)
* xideq - returns 1, iff xid1 == xid2 * xideq - returns 1, iff xid1 == xid2
* 0 else; * 0 else;
*/ */
bool Datum
xideq(TransactionId xid1, TransactionId xid2) xideq(PG_FUNCTION_ARGS)
{ {
return (bool) (xid1 == xid2); TransactionId xid1 = PG_GETARG_TRANSACTIONID(0);
TransactionId xid2 = PG_GETARG_TRANSACTIONID(1);
PG_RETURN_BOOL(xid1 == xid2);
} }
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
* TransactionIdAdd * TransactionIdAdd
* ---------------------------------------------------------------- * ----------------------------------------------------------------
@ -73,5 +83,4 @@ void
TransactionIdAdd(TransactionId *xid, int value) TransactionIdAdd(TransactionId *xid, int value)
{ {
*xid += value; *xid += value;
return;
} }

View File

@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.84 2000/05/31 00:28:14 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.85 2000/06/05 07:28:40 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -38,7 +38,7 @@
#include "utils/lsyscache.h" #include "utils/lsyscache.h"
#include "utils/portal.h" #include "utils/portal.h"
#define ALLOC(t, c) (t *)calloc((unsigned)(c), sizeof(t)) #define ALLOC(t, c) ((t *) calloc((unsigned)(c), sizeof(t)))
extern void BaseInit(void); extern void BaseInit(void);
extern void StartupXLOG(void); extern void StartupXLOG(void);
@ -112,7 +112,7 @@ static struct typinfo Procid[] = {
{"int4", INT4OID, 0, 4, F_INT4IN, F_INT4OUT}, {"int4", INT4OID, 0, 4, F_INT4IN, F_INT4OUT},
{"regproc", REGPROCOID, 0, 4, F_REGPROCIN, F_REGPROCOUT}, {"regproc", REGPROCOID, 0, 4, F_REGPROCIN, F_REGPROCOUT},
{"text", TEXTOID, 0, -1, F_TEXTIN, F_TEXTOUT}, {"text", TEXTOID, 0, -1, F_TEXTIN, F_TEXTOUT},
{"oid", OIDOID, 0, 4, F_INT4IN, F_INT4OUT}, {"oid", OIDOID, 0, 4, F_OIDIN, F_OIDOUT},
{"tid", TIDOID, 0, 6, F_TIDIN, F_TIDOUT}, {"tid", TIDOID, 0, 6, F_TIDIN, F_TIDOUT},
{"xid", XIDOID, 0, 4, F_XIDIN, F_XIDOUT}, {"xid", XIDOID, 0, 4, F_XIDIN, F_XIDOUT},
{"cid", CIDOID, 0, 4, F_CIDIN, F_CIDOUT}, {"cid", CIDOID, 0, 4, F_CIDIN, F_CIDOUT},

View File

@ -772,7 +772,7 @@ CommentOperator(char *opername, List *arguments, char *comment)
/*** Get the procedure associated with the operator ***/ /*** Get the procedure associated with the operator ***/
data = (Form_pg_operator) GETSTRUCT(optuple); data = (Form_pg_operator) GETSTRUCT(optuple);
oid = regproctooid(data->oprcode); oid = RegprocToOid(data->oprcode);
if (oid == InvalidOid) if (oid == InvalidOid)
elog(ERROR, "operator '%s' does not have an underlying function", opername); elog(ERROR, "operator '%s' does not have an underlying function", opername);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.110 2000/06/02 15:57:18 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.111 2000/06/05 07:28:42 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -473,7 +473,9 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim, char *null_p
if (oids && !binary) if (oids && !binary)
{ {
CopySendString(oidout(tuple->t_data->t_oid), fp); CopySendString(DatumGetCString(DirectFunctionCall1(oidout,
ObjectIdGetDatum(tuple->t_data->t_oid))),
fp);
CopySendChar(delim[0], fp); CopySendChar(delim[0], fp);
} }
@ -782,7 +784,8 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim, char *null
done = 1; done = 1;
else else
{ {
loaded_oid = oidin(string); loaded_oid = DatumGetObjectId(DirectFunctionCall1(oidin,
CStringGetDatum(string)));
if (loaded_oid == InvalidOid) if (loaded_oid == InvalidOid)
elog(ERROR, "COPY TEXT: Invalid Oid"); elog(ERROR, "COPY TEXT: Invalid Oid");
} }

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.79 2000/05/30 00:49:50 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.80 2000/06/05 07:28:43 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -892,7 +892,8 @@ parser_typecast_constant(Value *expr, TypeName *typename)
{ {
case T_Integer: case T_Integer:
string_palloced = true; string_palloced = true;
const_string = int4out(expr->val.ival); const_string = DatumGetCString(DirectFunctionCall1(int4out,
Int32GetDatum(expr->val.ival)));
break; break;
case T_Float: case T_Float:
case T_String: case T_String:

View File

@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.68 2000/05/28 17:56:03 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.69 2000/06/05 07:28:45 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -174,7 +174,8 @@ inv_create(int flags)
if (!RelationIsValid(indr)) if (!RelationIsValid(indr))
{ {
elog(ERROR, "cannot create index for large obj on %s under inversion", elog(ERROR, "cannot create index for large obj on %s under inversion",
smgrout(DEFAULT_SMGR)); DatumGetCString(DirectFunctionCall1(smgrout,
Int16GetDatum(DEFAULT_SMGR))));
} }
retval = (LargeObjectDesc *) palloc(sizeof(LargeObjectDesc)); retval = (LargeObjectDesc *) palloc(sizeof(LargeObjectDesc));

View File

@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.35 2000/04/12 17:15:42 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.36 2000/06/05 07:28:47 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -105,7 +105,9 @@ smgrinit()
if (smgrsw[i].smgr_init) if (smgrsw[i].smgr_init)
{ {
if ((*(smgrsw[i].smgr_init)) () == SM_FAIL) if ((*(smgrsw[i].smgr_init)) () == SM_FAIL)
elog(FATAL, "initialization failed on %s", smgrout(i)); elog(FATAL, "initialization failed on %s",
DatumGetCString(DirectFunctionCall1(smgrout,
Int16GetDatum(i))));
} }
} }
@ -125,7 +127,9 @@ smgrshutdown(int dummy)
if (smgrsw[i].smgr_shutdown) if (smgrsw[i].smgr_shutdown)
{ {
if ((*(smgrsw[i].smgr_shutdown)) () == SM_FAIL) if ((*(smgrsw[i].smgr_shutdown)) () == SM_FAIL)
elog(FATAL, "shutdown failed on %s", smgrout(i)); elog(FATAL, "shutdown failed on %s",
DatumGetCString(DirectFunctionCall1(smgrout,
Int16GetDatum(i))));
} }
} }
} }
@ -445,7 +449,9 @@ smgrcommit()
if (smgrsw[i].smgr_commit) if (smgrsw[i].smgr_commit)
{ {
if ((*(smgrsw[i].smgr_commit)) () == SM_FAIL) if ((*(smgrsw[i].smgr_commit)) () == SM_FAIL)
elog(FATAL, "transaction commit failed on %s", smgrout(i)); elog(FATAL, "transaction commit failed on %s",
DatumGetCString(DirectFunctionCall1(smgrout,
Int16GetDatum(i))));
} }
} }
@ -462,7 +468,9 @@ smgrabort()
if (smgrsw[i].smgr_abort) if (smgrsw[i].smgr_abort)
{ {
if ((*(smgrsw[i].smgr_abort)) () == SM_FAIL) if ((*(smgrsw[i].smgr_abort)) () == SM_FAIL)
elog(FATAL, "transaction abort failed on %s", smgrout(i)); elog(FATAL, "transaction abort failed on %s",
DatumGetCString(DirectFunctionCall1(smgrout,
Int16GetDatum(i))));
} }
} }

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgrtype.c,v 1.16 2000/01/26 05:57:05 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgrtype.c,v 1.17 2000/06/05 07:28:47 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -37,45 +37,48 @@ static smgrid StorageManager[] = {
static int NStorageManagers = lengthof(StorageManager); static int NStorageManagers = lengthof(StorageManager);
int2 Datum
smgrin(char *s) smgrin(PG_FUNCTION_ARGS)
{ {
int i; char *s = PG_GETARG_CSTRING(0);
int16 i;
for (i = 0; i < NStorageManagers; i++) for (i = 0; i < NStorageManagers; i++)
{ {
if (strcmp(s, StorageManager[i].smgr_name) == 0) if (strcmp(s, StorageManager[i].smgr_name) == 0)
return (int2) i; PG_RETURN_INT16(i);
} }
elog(ERROR, "smgrin: illegal storage manager name %s", s); elog(ERROR, "smgrin: unknown storage manager name '%s'", s);
return 0; PG_RETURN_INT16(0);
} }
char * Datum
smgrout(int2 i) smgrout(PG_FUNCTION_ARGS)
{ {
int16 i = PG_GETARG_INT16(0);
char *s; char *s;
if (i >= NStorageManagers || i < 0) if (i >= NStorageManagers || i < 0)
elog(ERROR, "Illegal storage manager id %d", i); elog(ERROR, "Illegal storage manager id %d", i);
s = (char *) palloc(strlen(StorageManager[i].smgr_name) + 1); s = pstrdup(StorageManager[i].smgr_name);
strcpy(s, StorageManager[i].smgr_name); PG_RETURN_CSTRING(s);
return s;
} }
bool Datum
smgreq(int2 a, int2 b) smgreq(PG_FUNCTION_ARGS)
{ {
if (a == b) int16 a = PG_GETARG_INT16(0);
return true; int16 b = PG_GETARG_INT16(1);
return false;
PG_RETURN_BOOL(a == b);
} }
bool Datum
smgrne(int2 a, int2 b) smgrne(PG_FUNCTION_ARGS)
{ {
if (a == b) int16 a = PG_GETARG_INT16(0);
return false; int16 b = PG_GETARG_INT16(1);
return true;
PG_RETURN_BOOL(a != b);
} }

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.40 2000/05/30 07:09:23 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.41 2000/06/05 07:28:49 tgl Exp $
* *
* NOTES * NOTES
* This cruft is the server side of PQfn. * This cruft is the server side of PQfn.
@ -164,7 +164,7 @@ valid_fp_info(Oid func_id, struct fp_info * fip)
Assert(fip != (struct fp_info *) NULL); Assert(fip != (struct fp_info *) NULL);
return (OidIsValid(fip->funcid) && return (OidIsValid(fip->funcid) &&
oideq(func_id, fip->funcid) && func_id == fip->funcid &&
TransactionIdIsCurrentTransactionId(fip->xid) && TransactionIdIsCurrentTransactionId(fip->xid) &&
CommandIdIsCurrentCommandId(fip->cid)); CommandIdIsCurrentCommandId(fip->cid));
} }

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.45 2000/04/12 17:15:47 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.46 2000/06/05 07:28:51 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -21,6 +21,7 @@
#include "catalog/pg_type.h" #include "catalog/pg_type.h"
#include "lib/stringinfo.h" #include "lib/stringinfo.h"
#include "utils/acl.h" #include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/memutils.h" #include "utils/memutils.h"
#include "utils/syscache.h" #include "utils/syscache.h"
@ -268,7 +269,6 @@ aclitemout(AclItem *aip)
static AclItem default_aclitem = {ACL_ID_WORLD, static AclItem default_aclitem = {ACL_ID_WORLD,
ACL_IDTYPE_WORLD, ACL_IDTYPE_WORLD,
ACL_WORLD_DEFAULT}; ACL_WORLD_DEFAULT};
extern char *int2out();
char *tmpname; char *tmpname;
if (!aip) if (!aip)
@ -287,20 +287,11 @@ aclitemout(AclItem *aip)
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(htup)) if (!HeapTupleIsValid(htup))
{ {
char *tmp = int2out(aip->ai_id); /* Generate numeric UID if we don't find an entry */
char *tmp;
#ifdef NOT_USED
When this elog(NOTICE) goes to the libpq client,
it crashes the
client because the NOTICE protocol is coming right in the middle
of a request for a field value.We skip the NOTICE for now.
elog(NOTICE, "aclitemout: usesysid %d not found",
aip->ai_id);
#endif
tmp = DatumGetCString(DirectFunctionCall1(int4out,
Int32GetDatum((int32) aip->ai_id)));
strcat(p, tmp); strcat(p, tmp);
pfree(tmp); pfree(tmp);
} }

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/bool.c,v 1.22 2000/02/10 19:51:39 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/bool.c,v 1.23 2000/06/05 07:28:51 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -29,43 +29,45 @@
* *
* In the switch statement, check the most-used possibilities first. * In the switch statement, check the most-used possibilities first.
*/ */
bool Datum
boolin(char *b) boolin(PG_FUNCTION_ARGS)
{ {
char *b = PG_GETARG_CSTRING(0);
switch (*b) switch (*b)
{ {
case 't': case 't':
case 'T': case 'T':
if (strncasecmp(b, "true", strlen(b)) == 0) if (strncasecmp(b, "true", strlen(b)) == 0)
return TRUE; PG_RETURN_BOOL(true);
break; break;
case 'f': case 'f':
case 'F': case 'F':
if (strncasecmp(b, "false", strlen(b)) == 0) if (strncasecmp(b, "false", strlen(b)) == 0)
return FALSE; PG_RETURN_BOOL(false);
break; break;
case 'y': case 'y':
case 'Y': case 'Y':
if (strncasecmp(b, "yes", strlen(b)) == 0) if (strncasecmp(b, "yes", strlen(b)) == 0)
return TRUE; PG_RETURN_BOOL(true);
break; break;
case '1': case '1':
if (strncasecmp(b, "1", strlen(b)) == 0) if (strncasecmp(b, "1", strlen(b)) == 0)
return TRUE; PG_RETURN_BOOL(true);
break; break;
case 'n': case 'n':
case 'N': case 'N':
if (strncasecmp(b, "no", strlen(b)) == 0) if (strncasecmp(b, "no", strlen(b)) == 0)
return FALSE; PG_RETURN_BOOL(false);
break; break;
case '0': case '0':
if (strncasecmp(b, "0", strlen(b)) == 0) if (strncasecmp(b, "0", strlen(b)) == 0)
return FALSE; PG_RETURN_BOOL(false);
break; break;
default: default:
@ -73,72 +75,143 @@ boolin(char *b)
} }
elog(ERROR, "Bad boolean external representation '%s'", b); elog(ERROR, "Bad boolean external representation '%s'", b);
/* not reached */ /* not reached */
return FALSE; PG_RETURN_BOOL(false);
} /* boolin() */ }
/* /*
* boolout - converts 1 or 0 to "t" or "f" * boolout - converts 1 or 0 to "t" or "f"
*/ */
char * Datum
boolout(bool b) boolout(PG_FUNCTION_ARGS)
{ {
bool b = PG_GETARG_BOOL(0);
char *result = (char *) palloc(2); char *result = (char *) palloc(2);
*result = (b) ? 't' : 'f'; result[0] = (b) ? 't' : 'f';
result[1] = '\0'; result[1] = '\0';
return result; PG_RETURN_CSTRING(result);
} /* boolout() */ }
/***************************************************************************** /*****************************************************************************
* PUBLIC ROUTINES * * PUBLIC ROUTINES *
*****************************************************************************/ *****************************************************************************/
bool Datum
booleq(bool arg1, bool arg2) booleq(PG_FUNCTION_ARGS)
{ {
return arg1 == arg2; bool arg1 = PG_GETARG_BOOL(0);
bool arg2 = PG_GETARG_BOOL(1);
PG_RETURN_BOOL(arg1 == arg2);
} }
bool Datum
boolne(bool arg1, bool arg2) boolne(PG_FUNCTION_ARGS)
{ {
return arg1 != arg2; bool arg1 = PG_GETARG_BOOL(0);
bool arg2 = PG_GETARG_BOOL(1);
PG_RETURN_BOOL(arg1 != arg2);
} }
bool Datum
boollt(bool arg1, bool arg2) boollt(PG_FUNCTION_ARGS)
{ {
return arg1 < arg2; bool arg1 = PG_GETARG_BOOL(0);
bool arg2 = PG_GETARG_BOOL(1);
PG_RETURN_BOOL(arg1 < arg2);
} }
bool Datum
boolgt(bool arg1, bool arg2) boolgt(PG_FUNCTION_ARGS)
{ {
return arg1 > arg2; bool arg1 = PG_GETARG_BOOL(0);
bool arg2 = PG_GETARG_BOOL(1);
PG_RETURN_BOOL(arg1 > arg2);
} }
bool Datum
boolle(bool arg1, bool arg2) boolle(PG_FUNCTION_ARGS)
{ {
return arg1 <= arg2; bool arg1 = PG_GETARG_BOOL(0);
bool arg2 = PG_GETARG_BOOL(1);
PG_RETURN_BOOL(arg1 <= arg2);
} }
bool Datum
boolge(bool arg1, bool arg2) boolge(PG_FUNCTION_ARGS)
{ {
return arg1 >= arg2; bool arg1 = PG_GETARG_BOOL(0);
bool arg2 = PG_GETARG_BOOL(1);
PG_RETURN_BOOL(arg1 >= arg2);
} }
bool /*
istrue(bool arg1) * Per SQL92, istrue() and isfalse() should return false, not NULL,
{ * when presented a NULL input (since NULL is our implementation of
return arg1 == TRUE; * UNKNOWN). Conversely isnottrue() and isnotfalse() should return true.
} /* istrue() */ * Therefore, these routines are all declared not-strict in pg_proc
* and must do their own checking for null inputs.
*
* Note we don't need isunknown() and isnotunknown() functions, since
* nullvalue() and nonnullvalue() will serve.
*/
bool Datum
isfalse(bool arg1) istrue(PG_FUNCTION_ARGS)
{ {
return arg1 != TRUE; bool b;
} /* isfalse() */
if (PG_ARGISNULL(0))
PG_RETURN_BOOL(false);
b = PG_GETARG_BOOL(0);
PG_RETURN_BOOL(b);
}
Datum
isfalse(PG_FUNCTION_ARGS)
{
bool b;
if (PG_ARGISNULL(0))
PG_RETURN_BOOL(false);
b = PG_GETARG_BOOL(0);
PG_RETURN_BOOL(! b);
}
Datum
isnottrue(PG_FUNCTION_ARGS)
{
bool b;
if (PG_ARGISNULL(0))
PG_RETURN_BOOL(true);
b = PG_GETARG_BOOL(0);
PG_RETURN_BOOL(! b);
}
Datum
isnotfalse(PG_FUNCTION_ARGS)
{
bool b;
if (PG_ARGISNULL(0))
PG_RETURN_BOOL(true);
b = PG_GETARG_BOOL(0);
PG_RETURN_BOOL(b);
}

View File

@ -9,7 +9,7 @@
* workings can be found in the book "Software Solutions in C" by * workings can be found in the book "Software Solutions in C" by
* Dale Schumacher, Academic Press, ISBN: 0-12-632360-7. * Dale Schumacher, Academic Press, ISBN: 0-12-632360-7.
* *
* $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.36 2000/05/16 20:48:49 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.37 2000/06/05 07:28:51 tgl Exp $
*/ */
#include <limits.h> #include <limits.h>
@ -35,6 +35,24 @@ static struct lconv *lconvert = NULL;
#endif #endif
/*
* Cash is a pass-by-ref SQL type, so we must pass and return pointers.
* These macros and support routine hide the pass-by-refness.
*/
#define PG_GETARG_CASH(n) (* ((Cash *) DatumGetPointer(fcinfo->arg[n])))
#define PG_RETURN_CASH(x) return CashGetDatum(x)
static Datum
CashGetDatum(Cash value)
{
Cash *result = (Cash *) palloc(sizeof(Cash));
*result = value;
return PointerGetDatum(result);
}
/* cash_in() /* cash_in()
* Convert a string to a cash data type. * Convert a string to a cash data type.
* Format is [$]###[,]###[.##] * Format is [$]###[,]###[.##]
@ -573,32 +591,30 @@ cash_div_int4(Cash *c, int4 i)
/* cash_mul_int2() /* cash_mul_int2()
* Multiply cash by int2. * Multiply cash by int2.
*/ */
Cash * Datum
cash_mul_int2(Cash *c, int2 s) cash_mul_int2(PG_FUNCTION_ARGS)
{ {
Cash *result; Cash c = PG_GETARG_CASH(0);
int16 s = PG_GETARG_INT16(1);
if (!PointerIsValid(c)) Cash result;
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
elog(ERROR, "Memory allocation failed, can't multiply cash");
*result = ((s) * (*c));
return result;
} /* cash_mul_int2() */
result = c * s;
PG_RETURN_CASH(result);
}
/* int2_mul_cash() /* int2_mul_cash()
* Multiply int2 by cash. * Multiply int2 by cash.
*/ */
Cash * Datum
int2_mul_cash(int2 s, Cash *c) int2_mul_cash(PG_FUNCTION_ARGS)
{ {
return cash_mul_int2(c, s); int16 s = PG_GETARG_INT16(0);
} /* int2_mul_cash() */ Cash c = PG_GETARG_CASH(1);
Cash result;
result = s * c;
PG_RETURN_CASH(result);
}
/* cash_div_int2() /* cash_div_int2()
* Divide cash by int2. * Divide cash by int2.
@ -606,25 +622,19 @@ int2_mul_cash(int2 s, Cash *c)
* XXX Don't know if rounding or truncating is correct behavior. * XXX Don't know if rounding or truncating is correct behavior.
* Round for now. - tgl 97/04/15 * Round for now. - tgl 97/04/15
*/ */
Cash * Datum
cash_div_int2(Cash *c, int2 s) cash_div_int2(PG_FUNCTION_ARGS)
{ {
Cash *result; Cash c = PG_GETARG_CASH(0);
int16 s = PG_GETARG_INT16(1);
if (!PointerIsValid(c)) Cash result;
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
elog(ERROR, "Memory allocation failed, can't divide cash");
if (s == 0) if (s == 0)
elog(ERROR, "cash_div: divide by 0 error"); elog(ERROR, "cash_div: divide by 0 error");
*result = rint(*c / s); result = rint(c / s);
PG_RETURN_CASH(result);
return result; }
} /* cash_div_int2() */
/* cashlarger() /* cashlarger()
* Return larger of two cash values. * Return larger of two cash values.

View File

@ -2,18 +2,19 @@
* *
* char.c * char.c
* Functions for the built-in type "char". * Functions for the built-in type "char".
* Functions for the built-in type "cid". * Functions for the built-in type "cid" (what's that doing here?)
* *
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/char.c,v 1.27 2000/01/26 05:57:13 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/char.c,v 1.28 2000/06/05 07:28:51 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
#include "postgres.h" #include "postgres.h"
#include "utils/builtins.h" #include "utils/builtins.h"
/***************************************************************************** /*****************************************************************************
@ -23,149 +24,194 @@
/* /*
* charin - converts "x" to 'x' * charin - converts "x" to 'x'
*/ */
int32 Datum
charin(char *ch) charin(PG_FUNCTION_ARGS)
{ {
if (ch == NULL) char *ch = PG_GETARG_CSTRING(0);
return (int32) '\0';
return (int32) *ch; PG_RETURN_CHAR(ch[0]);
} }
/* /*
* charout - converts 'x' to "x" * charout - converts 'x' to "x"
*/ */
char * Datum
charout(int32 ch) charout(PG_FUNCTION_ARGS)
{ {
char ch = PG_GETARG_CHAR(0);
char *result = (char *) palloc(2); char *result = (char *) palloc(2);
result[0] = (char) ch; result[0] = ch;
result[1] = '\0'; result[1] = '\0';
return result; PG_RETURN_CSTRING(result);
} }
/*
* cidin - converts "..." to internal representation.
*
* NOTE: we must not use 'charin' because cid might be a non
* printable character...
*/
int32
cidin(char *s)
{
CommandId c;
if (s == NULL)
c = 0;
else
c = atoi(s);
return (int32) c;
}
/*
* cidout - converts a cid to "..."
*
* NOTE: we must no use 'charout' because cid might be a non
* printable character...
*/
char *
cidout(int32 c)
{
char *result;
CommandId c2;
result = palloc(12);
c2 = (CommandId) c;
sprintf(result, "%u", (unsigned) (c2));
return result;
}
/***************************************************************************** /*****************************************************************************
* PUBLIC ROUTINES * * PUBLIC ROUTINES *
*****************************************************************************/ *****************************************************************************/
bool /*
chareq(int8 arg1, int8 arg2) * NOTE: comparisons are done as though char is unsigned (uint8).
* Arithmetic is done as though char is signed (int8).
*
* You wanted consistency?
*/
Datum
chareq(PG_FUNCTION_ARGS)
{ {
return arg1 == arg2; char arg1 = PG_GETARG_CHAR(0);
char arg2 = PG_GETARG_CHAR(1);
PG_RETURN_BOOL(arg1 == arg2);
} }
bool Datum
charne(int8 arg1, int8 arg2) charne(PG_FUNCTION_ARGS)
{ {
return arg1 != arg2; char arg1 = PG_GETARG_CHAR(0);
char arg2 = PG_GETARG_CHAR(1);
PG_RETURN_BOOL(arg1 != arg2);
} }
bool Datum
charlt(int8 arg1, int8 arg2) charlt(PG_FUNCTION_ARGS)
{ {
return (uint8) arg1 < (uint8) arg2; char arg1 = PG_GETARG_CHAR(0);
char arg2 = PG_GETARG_CHAR(1);
PG_RETURN_BOOL((uint8) arg1 < (uint8) arg2);
} }
bool Datum
charle(int8 arg1, int8 arg2) charle(PG_FUNCTION_ARGS)
{ {
return (uint8) arg1 <= (uint8) arg2; char arg1 = PG_GETARG_CHAR(0);
char arg2 = PG_GETARG_CHAR(1);
PG_RETURN_BOOL((uint8) arg1 <= (uint8) arg2);
} }
bool Datum
chargt(int8 arg1, int8 arg2) chargt(PG_FUNCTION_ARGS)
{ {
return (uint8) arg1 > (uint8) arg2; char arg1 = PG_GETARG_CHAR(0);
char arg2 = PG_GETARG_CHAR(1);
PG_RETURN_BOOL((uint8) arg1 > (uint8) arg2);
} }
bool Datum
charge(int8 arg1, int8 arg2) charge(PG_FUNCTION_ARGS)
{ {
return (uint8) arg1 >= (uint8) arg2; char arg1 = PG_GETARG_CHAR(0);
char arg2 = PG_GETARG_CHAR(1);
PG_RETURN_BOOL((uint8) arg1 >= (uint8) arg2);
} }
int8 Datum
charpl(int8 arg1, int8 arg2) charpl(PG_FUNCTION_ARGS)
{ {
return arg1 + arg2; char arg1 = PG_GETARG_CHAR(0);
char arg2 = PG_GETARG_CHAR(1);
PG_RETURN_CHAR((int8) arg1 + (int8) arg2);
} }
int8 Datum
charmi(int8 arg1, int8 arg2) charmi(PG_FUNCTION_ARGS)
{ {
return arg1 - arg2; char arg1 = PG_GETARG_CHAR(0);
char arg2 = PG_GETARG_CHAR(1);
PG_RETURN_CHAR((int8) arg1 - (int8) arg2);
} }
int8 Datum
charmul(int8 arg1, int8 arg2) charmul(PG_FUNCTION_ARGS)
{ {
return arg1 * arg2; char arg1 = PG_GETARG_CHAR(0);
char arg2 = PG_GETARG_CHAR(1);
PG_RETURN_CHAR((int8) arg1 * (int8) arg2);
} }
int8 Datum
chardiv(int8 arg1, int8 arg2) chardiv(PG_FUNCTION_ARGS)
{ {
return arg1 / arg2; char arg1 = PG_GETARG_CHAR(0);
char arg2 = PG_GETARG_CHAR(1);
PG_RETURN_CHAR((int8) arg1 / (int8) arg2);
} }
bool Datum
cideq(int8 arg1, int8 arg2) text_char(PG_FUNCTION_ARGS)
{ {
return arg1 == arg2; text *arg1 = PG_GETARG_TEXT_P(0);
/* XXX what if arg1 has length zero? */
PG_RETURN_CHAR(*(VARDATA(arg1)));
} }
int8 Datum
text_char(text *arg1) char_text(PG_FUNCTION_ARGS)
{ {
return ((int8) *(VARDATA(arg1))); char arg1 = PG_GETARG_CHAR(0);
} text *result = palloc(VARHDRSZ + 1);
text *
char_text(int8 arg1)
{
text *result;
result = palloc(VARHDRSZ + 1);
VARSIZE(result) = VARHDRSZ + 1; VARSIZE(result) = VARHDRSZ + 1;
*(VARDATA(result)) = arg1; *(VARDATA(result)) = arg1;
return result; PG_RETURN_TEXT_P(result);
}
/*****************************************************************************
* USER I/O ROUTINES *
*****************************************************************************/
/*
* cidin - converts CommandId to internal representation.
*/
Datum
cidin(PG_FUNCTION_ARGS)
{
char *s = PG_GETARG_CSTRING(0);
CommandId c;
c = atoi(s);
/* XXX assume that CommandId is 32 bits... */
PG_RETURN_INT32((int32) c);
}
/*
* cidout - converts a cid to external representation.
*/
Datum
cidout(PG_FUNCTION_ARGS)
{
/* XXX assume that CommandId is 32 bits... */
CommandId c = PG_GETARG_INT32(0);
char *result = (char *) palloc(16);
sprintf(result, "%u", (unsigned int) c);
PG_RETURN_CSTRING(result);
}
/*****************************************************************************
* PUBLIC ROUTINES *
*****************************************************************************/
Datum
cideq(PG_FUNCTION_ARGS)
{
/* XXX assume that CommandId is 32 bits... */
CommandId arg1 = PG_GETARG_INT32(0);
CommandId arg2 = PG_GETARG_INT32(1);
PG_RETURN_BOOL(arg1 == arg2);
} }

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.57 2000/04/12 17:15:49 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.58 2000/06/05 07:28:51 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -122,25 +122,6 @@ extern double rint(double x);
#define FLOAT8_MAX DBL_MAX #define FLOAT8_MAX DBL_MAX
#define FLOAT8_MIN DBL_MIN #define FLOAT8_MIN DBL_MIN
/*
* if FLOAT8_MIN and FLOAT8_MAX are the limits of the range a
* double can store, then how are we ever going to wind up
* with something stored in a double that is outside those
* limits? (and similarly for FLOAT4_{MIN,MAX}/float.)
* doesn't make sense to me, and it causes a
* floating point exception on linuxalpha, so UNSAFE_FLOATS
* it is.
* (maybe someone wanted to allow for values other than DBL_MIN/
* DBL_MAX for FLOAT8_MIN/FLOAT8_MAX?)
* --djm 12/12/96
* according to Richard Henderson this is a known bug in gcc on
* the Alpha. might as well leave the workaround in
* until the distributions are updated.
* --djm 12/16/96
*/
#if ( defined(linux) && defined(__alpha__) ) && !defined(UNSAFE_FLOATS)
#define UNSAFE_FLOATS
#endif
/* /*
check to see if a float4 val is outside of check to see if a float4 val is outside of
@ -844,19 +825,17 @@ dtoi4(float64 num)
/* /*
* dtoi2 - converts a float8 number to an int2 number * dtoi2 - converts a float8 number to an int2 number
*/ */
int16 Datum
dtoi2(float64 num) dtoi2(PG_FUNCTION_ARGS)
{ {
float8 num = PG_GETARG_FLOAT8(0);
int16 result; int16 result;
if (!num) if ((num < SHRT_MIN) || (num > SHRT_MAX))
return 0; /* fmgr will return NULL anyway */
if ((*num < SHRT_MIN) || (*num > SHRT_MAX))
elog(ERROR, "dtoi2: integer out of range"); elog(ERROR, "dtoi2: integer out of range");
result = rint(*num); result = (int16) rint(num);
return result; PG_RETURN_INT16(result);
} }
@ -878,15 +857,14 @@ i4tod(int32 num)
/* /*
* i2tod - converts an int2 number to a float8 number * i2tod - converts an int2 number to a float8 number
*/ */
float64 Datum
i2tod(int16 num) i2tod(PG_FUNCTION_ARGS)
{ {
float64 result; int16 num = PG_GETARG_INT16(0);
float8 result;
result = (float64) palloc(sizeof(float64data)); result = num;
PG_RETURN_FLOAT8(result);
*result = num;
return result;
} }
@ -910,21 +888,19 @@ ftoi4(float32 num)
/* /*
* ftoi2 - converts a float8 number to an int2 number * ftoi2 - converts a float4 number to an int2 number
*/ */
int16 Datum
ftoi2(float32 num) ftoi2(PG_FUNCTION_ARGS)
{ {
float4 num = PG_GETARG_FLOAT4(0);
int16 result; int16 result;
if (!num) if ((num < SHRT_MIN) || (num > SHRT_MAX))
return 0; /* fmgr will return NULL anyway */
if ((*num < SHRT_MIN) || (*num > SHRT_MAX))
elog(ERROR, "ftoi2: integer out of range"); elog(ERROR, "ftoi2: integer out of range");
result = rint(*num); result = (int16) rint(num);
return result; PG_RETURN_INT16(result);
} }
@ -944,17 +920,16 @@ i4tof(int32 num)
/* /*
* i2tof - converts an int2 number to a float8 number * i2tof - converts an int2 number to a float4 number
*/ */
float32 Datum
i2tof(int16 num) i2tof(PG_FUNCTION_ARGS)
{ {
float32 result; int16 num = PG_GETARG_INT16(0);
float4 result;
result = (float32) palloc(sizeof(float32data)); result = num;
PG_RETURN_FLOAT4(result);
*result = num;
return result;
} }

View File

@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
* formatting.c * formatting.c
* *
* $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.8 2000/04/12 17:15:49 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.9 2000/06/05 07:28:51 tgl Exp $
* *
* *
* Portions Copyright (c) 1999-2000, PostgreSQL, Inc * Portions Copyright (c) 1999-2000, PostgreSQL, Inc
@ -4048,11 +4048,15 @@ int4_to_char(int32 value, text *fmt)
{ {
if (IS_MULTI(&Num)) if (IS_MULTI(&Num))
{ {
orgnum = int4out(int4mul(value, (int32) pow((double) 10, (double) Num.multi))); orgnum = DatumGetCString(DirectFunctionCall1(int4out,
Int32GetDatum(value * ((int32) pow((double) 10, (double) Num.multi)))));
Num.pre += Num.multi; Num.pre += Num.multi;
} }
else else
orgnum = int4out(value); {
orgnum = DatumGetCString(DirectFunctionCall1(int4out,
Int32GetDatum(value)));
}
len = strlen(orgnum); len = strlen(orgnum);
if (*orgnum == '-') if (*orgnum == '-')

View File

@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_selfuncs.c,v 1.15 2000/05/13 06:04:46 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_selfuncs.c,v 1.16 2000/06/05 07:28:52 tgl Exp $
* *
* XXX These are totally bogus. Perhaps someone will make them do * XXX These are totally bogus. Perhaps someone will make them do
* something reasonable, someday. * something reasonable, someday.
@ -44,32 +44,16 @@
* Selectivity for operators that depend on area, such as "overlap". * Selectivity for operators that depend on area, such as "overlap".
*/ */
float64 Datum
areasel(Oid opid, areasel(PG_FUNCTION_ARGS)
Oid relid,
AttrNumber attno,
Datum value,
int32 flag)
{ {
float64 result; PG_RETURN_FLOAT8(0.02);
result = (float64) palloc(sizeof(float64data));
*result = 0.02;
return result;
} }
float64 Datum
areajoinsel(Oid opid, areajoinsel(PG_FUNCTION_ARGS)
Oid relid1,
AttrNumber attno1,
Oid relid2,
AttrNumber attno2)
{ {
float64 result; PG_RETURN_FLOAT8(0.02);
result = (float64) palloc(sizeof(float64data));
*result = 0.02;
return result;
} }
/* /*
@ -79,32 +63,16 @@ areajoinsel(Oid opid,
* a given box? * a given box?
*/ */
float64 Datum
positionsel(Oid opid, positionsel(PG_FUNCTION_ARGS)
Oid relid,
AttrNumber attno,
Datum value,
int32 flag)
{ {
float64 result; PG_RETURN_FLOAT8(0.1);
result = (float64) palloc(sizeof(float64data));
*result = 0.1;
return result;
} }
float64 Datum
positionjoinsel(Oid opid, positionjoinsel(PG_FUNCTION_ARGS)
Oid relid1,
AttrNumber attno1,
Oid relid2,
AttrNumber attno2)
{ {
float64 result; PG_RETURN_FLOAT8(0.1);
result = (float64) palloc(sizeof(float64data));
*result = 0.1;
return result;
} }
/* /*
@ -114,30 +82,14 @@ positionjoinsel(Oid opid,
* estimate than areasel does. * estimate than areasel does.
*/ */
float64 Datum
contsel(Oid opid, contsel(PG_FUNCTION_ARGS)
Oid relid,
AttrNumber attno,
Datum value,
int32 flag)
{ {
float64 result; PG_RETURN_FLOAT8(0.01);
result = (float64) palloc(sizeof(float64data));
*result = 0.01;
return result;
} }
float64 Datum
contjoinsel(Oid opid, contjoinsel(PG_FUNCTION_ARGS)
Oid relid1,
AttrNumber attno1,
Oid relid2,
AttrNumber attno2)
{ {
float64 result; PG_RETURN_FLOAT8(0.01);
result = (float64) palloc(sizeof(float64data));
*result = 0.01;
return result;
} }

File diff suppressed because it is too large Load Diff

View File

@ -8,44 +8,39 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/misc.c,v 1.18 2000/01/26 05:57:14 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/misc.c,v 1.19 2000/06/05 07:28:52 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
#include <sys/types.h> #include <sys/types.h>
#include <sys/file.h> #include <sys/file.h>
#include <time.h> #include <time.h>
#include "postgres.h" #include "postgres.h"
#include "utils/builtins.h" #include "utils/builtins.h"
/*-------------------------------------------------------------------------
/*
* Check if data is Null * Check if data is Null
*/ */
bool Datum
nullvalue(Datum value, bool *isNull) nullvalue(PG_FUNCTION_ARGS)
{ {
if (*isNull) if (PG_ARGISNULL(0))
{ PG_RETURN_BOOL(true);
*isNull = false; PG_RETURN_BOOL(false);
return true;
}
return false;
} }
/*----------------------------------------------------------------------* /*
* check if data is not Null * * Check if data is not Null
*--------------------------------------------------------------------- */ */
bool Datum
nonnullvalue(Datum value, bool *isNull) nonnullvalue(PG_FUNCTION_ARGS)
{ {
if (*isNull) if (PG_ARGISNULL(0))
{ PG_RETURN_BOOL(false);
*isNull = false; PG_RETURN_BOOL(true);
return false;
}
return true;
} }
/* /*
@ -63,13 +58,18 @@ nonnullvalue(Datum value, bool *isNull)
static bool random_initialized = false; static bool random_initialized = false;
bool Datum
oidrand(Oid o, int32 X) oidrand(PG_FUNCTION_ARGS)
{ {
/* XXX seems like we ought to be using the oid for something? */
#ifdef NOT_USED
Oid o = PG_GETARG_OID(0);
#endif
int32 X = PG_GETARG_INT32(1);
bool result; bool result;
if (X == 0) if (X == 0)
return true; PG_RETURN_BOOL(true);
/* /*
* We do this because the cancel key is actually a random, so we don't * We do this because the cancel key is actually a random, so we don't
@ -83,26 +83,29 @@ oidrand(Oid o, int32 X)
} }
result = (random() % X == 0); result = (random() % X == 0);
return result; PG_RETURN_BOOL(result);
} }
/* /*
oidsrand(int32 X) - oidsrand(int32 X) -
seeds the random number generator seeds the random number generator
always return true always returns true
*/ */
bool Datum
oidsrand(int32 X) oidsrand(PG_FUNCTION_ARGS)
{ {
int32 X = PG_GETARG_INT32(0);
srand(X); srand(X);
random_initialized = true; random_initialized = true;
return true; PG_RETURN_BOOL(true);
} }
Datum
int32 userfntest(PG_FUNCTION_ARGS)
userfntest(int i)
{ {
return i; int32 i = PG_GETARG_INT32(0);
PG_RETURN_INT32(i);
} }

View File

@ -5,7 +5,7 @@
* *
* 1998 Jan Wieck * 1998 Jan Wieck
* *
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.27 2000/04/12 17:15:50 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.28 2000/06/05 07:28:52 tgl Exp $
* *
* ---------- * ----------
*/ */
@ -33,6 +33,9 @@
* Local definitions * Local definitions
* ---------- * ----------
*/ */
#define PG_GETARG_NUMERIC(n) ((Numeric) DatumGetPointer(fcinfo->arg[n]))
#define PG_RETURN_NUMERIC(x) return PointerGetDatum(x)
#ifndef MIN #ifndef MIN
#define MIN(a,b) (((a)<(b)) ? (a) : (b)) #define MIN(a,b) (((a)<(b)) ? (a) : (b))
#endif #endif
@ -1714,7 +1717,8 @@ int4_numeric(int32 val)
init_var(&result); init_var(&result);
tmp = int4out(val); tmp = DatumGetCString(DirectFunctionCall1(int4out,
Int32GetDatum(val)));
set_var_from_str(tmp, &result); set_var_from_str(tmp, &result);
res = make_result(&result); res = make_result(&result);
@ -1730,7 +1734,7 @@ numeric_int4(Numeric num)
{ {
NumericVar x; NumericVar x;
char *str; char *str;
int32 result; Datum result;
if (num == NULL) if (num == NULL)
return 0; return 0;
@ -1749,7 +1753,7 @@ numeric_int4(Numeric num)
free_var(&x); free_var(&x);
result = int4in(str); result = DirectFunctionCall1(int4in, CStringGetDatum(str));
pfree(str); pfree(str);
return result; return result;
@ -1807,35 +1811,35 @@ numeric_int8(Numeric num)
} }
Numeric Datum
int2_numeric(int16 val) int2_numeric(PG_FUNCTION_ARGS)
{ {
int16 val = PG_GETARG_INT16(0);
Numeric res; Numeric res;
NumericVar result; NumericVar result;
char *tmp; char *tmp;
init_var(&result); init_var(&result);
tmp = int2out(val); tmp = DatumGetCString(DirectFunctionCall1(int2out,
Int16GetDatum(val)));
set_var_from_str(tmp, &result); set_var_from_str(tmp, &result);
res = make_result(&result); res = make_result(&result);
free_var(&result); free_var(&result);
pfree(tmp); pfree(tmp);
return res; PG_RETURN_NUMERIC(res);
} }
int16 Datum
numeric_int2(Numeric num) numeric_int2(PG_FUNCTION_ARGS)
{ {
Numeric num = PG_GETARG_NUMERIC(0);
NumericVar x; NumericVar x;
char *str; char *str;
int16 result; Datum result;
if (num == NULL)
return 0;
if (NUMERIC_IS_NAN(num)) if (NUMERIC_IS_NAN(num))
elog(ERROR, "Cannot convert NaN to int2"); elog(ERROR, "Cannot convert NaN to int2");
@ -1851,7 +1855,7 @@ numeric_int2(Numeric num)
free_var(&x); free_var(&x);
result = int2in(str); result = DirectFunctionCall1(int2in, CStringGetDatum(str));
pfree(str); pfree(str);
return result; return result;

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.34 2000/04/12 17:15:51 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.35 2000/06/05 07:28:52 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -26,17 +26,15 @@
* oidvectorin - converts "num num ..." to internal form * oidvectorin - converts "num num ..." to internal form
* *
* Note: * Note:
* Fills any nonexistent digits with NULL oids. * Fills any unsupplied positions with InvalidOid.
*/ */
Oid * Datum
oidvectorin(char *oidString) oidvectorin(PG_FUNCTION_ARGS)
{ {
char *oidString = PG_GETARG_CSTRING(0);
Oid *result; Oid *result;
int slot; int slot;
if (oidString == NULL)
return NULL;
result = (Oid *) palloc(sizeof(Oid[INDEX_MAX_KEYS])); result = (Oid *) palloc(sizeof(Oid[INDEX_MAX_KEYS]));
for (slot = 0; *oidString && slot < INDEX_MAX_KEYS; slot++) for (slot = 0; *oidString && slot < INDEX_MAX_KEYS; slot++)
@ -53,30 +51,23 @@ oidvectorin(char *oidString)
if (*oidString) if (*oidString)
elog(ERROR, "oidvector value has too many values"); elog(ERROR, "oidvector value has too many values");
while (slot < INDEX_MAX_KEYS) while (slot < INDEX_MAX_KEYS)
result[slot++] = 0; result[slot++] = InvalidOid;
return result; PG_RETURN_POINTER(result);
} }
/* /*
* oidvectorout - converts internal form to "num num ..." * oidvectorout - converts internal form to "num num ..."
*/ */
char * Datum
oidvectorout(Oid *oidArray) oidvectorout(PG_FUNCTION_ARGS)
{ {
Oid *oidArray = (Oid *) PG_GETARG_POINTER(0);
int num, int num,
maxnum; maxnum;
char *rp; char *rp;
char *result; char *result;
if (oidArray == NULL)
{
result = (char *) palloc(2);
result[0] = '-';
result[1] = '\0';
return result;
}
/* find last non-zero value in vector */ /* find last non-zero value in vector */
for (maxnum = INDEX_MAX_KEYS - 1; maxnum >= 0; maxnum--) for (maxnum = INDEX_MAX_KEYS - 1; maxnum >= 0; maxnum--)
if (oidArray[maxnum] != 0) if (oidArray[maxnum] != 0)
@ -93,147 +84,177 @@ oidvectorout(Oid *oidArray)
; ;
} }
*rp = '\0'; *rp = '\0';
return result; PG_RETURN_CSTRING(result);
} }
Oid Datum
oidin(char *s) oidin(PG_FUNCTION_ARGS)
{ {
return int4in(s); char *s = PG_GETARG_CSTRING(0);
/* XXX should use an unsigned-int conversion here */
return DirectFunctionCall1(int4in, CStringGetDatum(s));
} }
char * Datum
oidout(Oid o) oidout(PG_FUNCTION_ARGS)
{ {
return int4out(o); Oid o = PG_GETARG_OID(0);
/* XXX should use an unsigned-int conversion here */
return DirectFunctionCall1(int4out, ObjectIdGetDatum(o));
} }
/***************************************************************************** /*****************************************************************************
* PUBLIC ROUTINES * * PUBLIC ROUTINES *
*****************************************************************************/ *****************************************************************************/
/* Datum
* If you change this function, change heap_keytest() oideq(PG_FUNCTION_ARGS)
* because we have hardcoded this in there as an optimization
*/
bool
oideq(Oid arg1, Oid arg2)
{ {
return arg1 == arg2; Oid arg1 = PG_GETARG_OID(0);
Oid arg2 = PG_GETARG_OID(1);
PG_RETURN_BOOL(arg1 == arg2);
} }
bool Datum
oidne(Oid arg1, Oid arg2) oidne(PG_FUNCTION_ARGS)
{ {
return arg1 != arg2; Oid arg1 = PG_GETARG_OID(0);
Oid arg2 = PG_GETARG_OID(1);
PG_RETURN_BOOL(arg1 != arg2);
} }
bool Datum
oidvectoreq(Oid *arg1, Oid *arg2) oidvectoreq(PG_FUNCTION_ARGS)
{ {
return (bool) (memcmp(arg1, arg2, INDEX_MAX_KEYS * sizeof(Oid)) == 0); Oid *arg1 = (Oid *) PG_GETARG_POINTER(0);
Oid *arg2 = (Oid *) PG_GETARG_POINTER(1);
PG_RETURN_BOOL(memcmp(arg1, arg2, INDEX_MAX_KEYS * sizeof(Oid)) == 0);
} }
bool Datum
oidvectorne(Oid *arg1, Oid *arg2) oidvectorne(PG_FUNCTION_ARGS)
{ {
return (bool) (memcmp(arg1, arg2, INDEX_MAX_KEYS * sizeof(Oid)) != 0); Oid *arg1 = (Oid *) PG_GETARG_POINTER(0);
Oid *arg2 = (Oid *) PG_GETARG_POINTER(1);
PG_RETURN_BOOL(memcmp(arg1, arg2, INDEX_MAX_KEYS * sizeof(Oid)) != 0);
} }
bool Datum
oidvectorlt(Oid *arg1, Oid *arg2) oidvectorlt(PG_FUNCTION_ARGS)
{ {
Oid *arg1 = (Oid *) PG_GETARG_POINTER(0);
Oid *arg2 = (Oid *) PG_GETARG_POINTER(1);
int i; int i;
for (i = 0; i < INDEX_MAX_KEYS; i++) for (i = 0; i < INDEX_MAX_KEYS; i++)
if (!int4eq(arg1[i], arg2[i])) if (arg1[i] != arg2[i])
return int4lt(arg1[i], arg2[i]); PG_RETURN_BOOL(arg1[i] < arg2[i]);
return false; PG_RETURN_BOOL(false);
} }
bool Datum
oidvectorle(Oid *arg1, Oid *arg2) oidvectorle(PG_FUNCTION_ARGS)
{ {
Oid *arg1 = (Oid *) PG_GETARG_POINTER(0);
Oid *arg2 = (Oid *) PG_GETARG_POINTER(1);
int i; int i;
for (i = 0; i < INDEX_MAX_KEYS; i++) for (i = 0; i < INDEX_MAX_KEYS; i++)
if (!int4eq(arg1[i], arg2[i])) if (arg1[i] != arg2[i])
return int4le(arg1[i], arg2[i]); PG_RETURN_BOOL(arg1[i] <= arg2[i]);
return true; PG_RETURN_BOOL(true);
} }
bool Datum
oidvectorge(Oid *arg1, Oid *arg2) oidvectorge(PG_FUNCTION_ARGS)
{ {
Oid *arg1 = (Oid *) PG_GETARG_POINTER(0);
Oid *arg2 = (Oid *) PG_GETARG_POINTER(1);
int i; int i;
for (i = 0; i < INDEX_MAX_KEYS; i++) for (i = 0; i < INDEX_MAX_KEYS; i++)
if (!int4eq(arg1[i], arg2[i])) if (arg1[i] != arg2[i])
return int4ge(arg1[i], arg2[i]); PG_RETURN_BOOL(arg1[i] >= arg2[i]);
return true; PG_RETURN_BOOL(true);
} }
bool Datum
oidvectorgt(Oid *arg1, Oid *arg2) oidvectorgt(PG_FUNCTION_ARGS)
{ {
Oid *arg1 = (Oid *) PG_GETARG_POINTER(0);
Oid *arg2 = (Oid *) PG_GETARG_POINTER(1);
int i; int i;
for (i = 0; i < INDEX_MAX_KEYS; i++) for (i = 0; i < INDEX_MAX_KEYS; i++)
if (!int4eq(arg1[i], arg2[i])) if (arg1[i] != arg2[i])
return int4gt(arg1[i], arg2[i]); PG_RETURN_BOOL(arg1[i] > arg2[i]);
return false; PG_RETURN_BOOL(false);
} }
bool Datum
oideqint4(Oid arg1, int32 arg2) oideqint4(PG_FUNCTION_ARGS)
{ {
/* oid is unsigned, but int4 is signed */ Oid arg1 = PG_GETARG_OID(0);
return arg2 >= 0 && arg1 == arg2; int32 arg2 = PG_GETARG_INT32(1);
/* oid is unsigned, but int4 is signed */
PG_RETURN_BOOL(arg2 >= 0 && arg1 == arg2);
} }
bool Datum
int4eqoid(int32 arg1, Oid arg2) int4eqoid(PG_FUNCTION_ARGS)
{ {
/* oid is unsigned, but int4 is signed */ int32 arg1 = PG_GETARG_INT32(0);
return arg1 >= 0 && arg1 == arg2; Oid arg2 = PG_GETARG_OID(1);
/* oid is unsigned, but int4 is signed */
PG_RETURN_BOOL(arg1 >= 0 && arg1 == arg2);
} }
text * Datum
oid_text(Oid oid) oid_text(PG_FUNCTION_ARGS)
{ {
Oid oid = PG_GETARG_OID(0);
text *result; text *result;
int len; int len;
char *str; char *str;
str = oidout(oid); str = DatumGetCString(DirectFunctionCall1(oidout,
len = (strlen(str) + VARHDRSZ); ObjectIdGetDatum(oid)));
len = strlen(str) + VARHDRSZ;
result = palloc(len); result = (text *) palloc(len);
VARSIZE(result) = len; VARSIZE(result) = len;
memmove(VARDATA(result), str, (len - VARHDRSZ)); memcpy(VARDATA(result), str, (len - VARHDRSZ));
pfree(str); pfree(str);
return result; PG_RETURN_TEXT_P(result);
} /* oid_text() */ }
Oid Datum
text_oid(text *string) text_oid(PG_FUNCTION_ARGS)
{ {
text *string = PG_GETARG_TEXT_P(0);
Oid result; Oid result;
int len; int len;
char *str; char *str;
len = (VARSIZE(string) - VARHDRSZ); len = (VARSIZE(string) - VARHDRSZ);
str = palloc(len + 1); str = palloc(len + 1);
memmove(str, VARDATA(string), len); memcpy(str, VARDATA(string), len);
*(str + len) = '\0'; *(str + len) = '\0';
result = oidin(str); result = DatumGetObjectId(DirectFunctionCall1(oidin,
CStringGetDatum(str)));
pfree(str); pfree(str);
return result; PG_RETURN_OID(result);
} /* oid_text() */ }

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.55 2000/05/28 17:56:05 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.56 2000/06/05 07:28:52 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -34,17 +34,16 @@
* *
* proid of '-' signifies unknown, for consistency with regprocout * proid of '-' signifies unknown, for consistency with regprocout
*/ */
int32 Datum
regprocin(char *pro_name_or_oid) regprocin(PG_FUNCTION_ARGS)
{ {
HeapTuple proctup = NULL; char *pro_name_or_oid = PG_GETARG_CSTRING(0);
HeapTuple proctup;
HeapTupleData tuple; HeapTupleData tuple;
RegProcedure result = InvalidOid; RegProcedure result = InvalidOid;
if (pro_name_or_oid == NULL)
return InvalidOid;
if (pro_name_or_oid[0] == '-' && pro_name_or_oid[1] == '\0') if (pro_name_or_oid[0] == '-' && pro_name_or_oid[1] == '\0')
return InvalidOid; PG_RETURN_OID(InvalidOid);
if (!IsIgnoringSystemIndexes()) if (!IsIgnoringSystemIndexes())
{ {
@ -57,7 +56,8 @@ regprocin(char *pro_name_or_oid)
pro_name_or_oid[0] <= '9') pro_name_or_oid[0] <= '9')
{ {
proctup = SearchSysCacheTuple(PROCOID, proctup = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(oidin(pro_name_or_oid)), DirectFunctionCall1(oidin,
CStringGetDatum(pro_name_or_oid)),
0, 0, 0); 0, 0, 0);
if (HeapTupleIsValid(proctup)) if (HeapTupleIsValid(proctup))
result = (RegProcedure) proctup->t_data->t_oid; result = (RegProcedure) proctup->t_data->t_oid;
@ -78,7 +78,7 @@ regprocin(char *pro_name_or_oid)
(bits16) 0x0, (bits16) 0x0,
(AttrNumber) 1, (AttrNumber) 1,
(RegProcedure) F_NAMEEQ, (RegProcedure) F_NAMEEQ,
PointerGetDatum(pro_name_or_oid)); CStringGetDatum(pro_name_or_oid));
hdesc = heap_openr(ProcedureRelationName, AccessShareLock); hdesc = heap_openr(ProcedureRelationName, AccessShareLock);
idesc = index_openr(ProcedureNameIndex); idesc = index_openr(ProcedureNameIndex);
@ -125,7 +125,7 @@ regprocin(char *pro_name_or_oid)
(bits16) 0, (bits16) 0,
(AttrNumber) 1, (AttrNumber) 1,
(RegProcedure) F_NAMEEQ, (RegProcedure) F_NAMEEQ,
(Datum) pro_name_or_oid); CStringGetDatum(pro_name_or_oid));
procscan = heap_beginscan(proc, 0, SnapshotNow, 1, &key); procscan = heap_beginscan(proc, 0, SnapshotNow, 1, &key);
if (!HeapScanIsValid(procscan)) if (!HeapScanIsValid(procscan))
@ -133,7 +133,7 @@ regprocin(char *pro_name_or_oid)
heap_close(proc, AccessShareLock); heap_close(proc, AccessShareLock);
elog(ERROR, "regprocin: could not begin scan of %s", elog(ERROR, "regprocin: could not begin scan of %s",
ProcedureRelationName); ProcedureRelationName);
return 0; PG_RETURN_OID(InvalidOid);
} }
proctup = heap_getnext(procscan, 0); proctup = heap_getnext(procscan, 0);
if (HeapTupleIsValid(proctup)) if (HeapTupleIsValid(proctup))
@ -143,24 +143,25 @@ regprocin(char *pro_name_or_oid)
RelationGetDescr(proc), RelationGetDescr(proc),
&isnull); &isnull);
if (isnull) if (isnull)
elog(FATAL, "regprocin: null procedure %s", pro_name_or_oid); elog(ERROR, "regprocin: null procedure %s", pro_name_or_oid);
} }
else else
result = (RegProcedure) 0; elog(ERROR, "No procedure with name %s", pro_name_or_oid);
heap_endscan(procscan); heap_endscan(procscan);
heap_close(proc, AccessShareLock); heap_close(proc, AccessShareLock);
} }
return (int32) result; PG_RETURN_OID(result);
} }
/* /*
* regprocout - converts proid to "pro_name" * regprocout - converts proid to "pro_name"
*/ */
char * Datum
regprocout(RegProcedure proid) regprocout(PG_FUNCTION_ARGS)
{ {
RegProcedure proid = PG_GETARG_OID(0);
HeapTuple proctup; HeapTuple proctup;
char *result; char *result;
@ -170,7 +171,7 @@ regprocout(RegProcedure proid)
{ {
result[0] = '-'; result[0] = '-';
result[1] = '\0'; result[1] = '\0';
return result; PG_RETURN_CSTRING(result);
} }
if (!IsBootstrapProcessingMode()) if (!IsBootstrapProcessingMode())
@ -203,7 +204,7 @@ regprocout(RegProcedure proid)
(bits16) 0, (bits16) 0,
(AttrNumber) ObjectIdAttributeNumber, (AttrNumber) ObjectIdAttributeNumber,
(RegProcedure) F_INT4EQ, (RegProcedure) F_INT4EQ,
(Datum) proid); ObjectIdGetDatum(proid));
procscan = heap_beginscan(proc, 0, SnapshotNow, 1, &key); procscan = heap_beginscan(proc, 0, SnapshotNow, 1, &key);
if (!HeapScanIsValid(procscan)) if (!HeapScanIsValid(procscan))
@ -211,7 +212,6 @@ regprocout(RegProcedure proid)
heap_close(proc, AccessShareLock); heap_close(proc, AccessShareLock);
elog(ERROR, "regprocout: could not begin scan of %s", elog(ERROR, "regprocout: could not begin scan of %s",
ProcedureRelationName); ProcedureRelationName);
return 0;
} }
proctup = heap_getnext(procscan, 0); proctup = heap_getnext(procscan, 0);
if (HeapTupleIsValid(proctup)) if (HeapTupleIsValid(proctup))
@ -224,7 +224,7 @@ regprocout(RegProcedure proid)
if (!isnull) if (!isnull)
StrNCpy(result, s, NAMEDATALEN); StrNCpy(result, s, NAMEDATALEN);
else else
elog(FATAL, "regprocout: null procedure %u", proid); elog(ERROR, "regprocout: null procedure %u", proid);
} }
else else
{ {
@ -235,7 +235,7 @@ regprocout(RegProcedure proid)
heap_close(proc, AccessShareLock); heap_close(proc, AccessShareLock);
} }
return result; PG_RETURN_CSTRING(result);
} }
/* /*
@ -245,21 +245,15 @@ regprocout(RegProcedure proid)
* OIDs are significant in the input vector, so that trailing InvalidOid * OIDs are significant in the input vector, so that trailing InvalidOid
* argument types can be recognized. * argument types can be recognized.
*/ */
text * Datum
oidvectortypes(Oid *oidArray) oidvectortypes(PG_FUNCTION_ARGS)
{ {
Oid *oidArray = (Oid *) PG_GETARG_POINTER(0);
HeapTuple typetup; HeapTuple typetup;
text *result; text *result;
int numargs, int numargs,
num; num;
if (oidArray == NULL)
{
result = (text *) palloc(VARHDRSZ);
VARSIZE(result) = 0;
return result;
}
/* Try to guess how many args there are :-( */ /* Try to guess how many args there are :-( */
numargs = 0; numargs = 0;
for (num = 0; num < FUNC_MAX_ARGS; num++) for (num = 0; num < FUNC_MAX_ARGS; num++)
@ -289,7 +283,7 @@ oidvectortypes(Oid *oidArray)
strcat(VARDATA(result), "- "); strcat(VARDATA(result), "- ");
} }
VARSIZE(result) = strlen(VARDATA(result)) + VARHDRSZ; VARSIZE(result) = strlen(VARDATA(result)) + VARHDRSZ;
return result; PG_RETURN_TEXT_P(result);
} }
@ -302,10 +296,12 @@ oidvectortypes(Oid *oidArray)
* Define RegprocToOid() as a macro in builtins.h. * Define RegprocToOid() as a macro in builtins.h.
* Referenced in pg_proc.h. - tgl 97/04/26 * Referenced in pg_proc.h. - tgl 97/04/26
*/ */
Oid Datum
regproctooid(RegProcedure rp) regproctooid(PG_FUNCTION_ARGS)
{ {
return (Oid) rp; RegProcedure rp = PG_GETARG_OID(0);
PG_RETURN_OID((Oid) rp);
} }
/* (see int.c for comparison/operation routines) */ /* (see int.c for comparison/operation routines) */

View File

@ -15,7 +15,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.68 2000/05/30 04:24:51 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.69 2000/06/05 07:28:52 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -44,9 +44,6 @@
/* N is not a valid var/constant or relation id */ /* N is not a valid var/constant or relation id */
#define NONVALUE(N) ((N) == 0) #define NONVALUE(N) ((N) == 0)
/* are we looking at a functional index selectivity request? */
#define FunctionalSelectivity(nIndKeys,attNum) ((attNum)==InvalidAttrNumber)
/* default selectivity estimate for equalities such as "A = b" */ /* default selectivity estimate for equalities such as "A = b" */
#define DEFAULT_EQ_SEL 0.01 #define DEFAULT_EQ_SEL 0.01
@ -106,18 +103,18 @@ static Datum string_to_datum(const char *str, Oid datatype);
* of the given constant "value" may be different from the type of the * of the given constant "value" may be different from the type of the
* attribute. * attribute.
*/ */
float64 Datum
eqsel(Oid opid, eqsel(PG_FUNCTION_ARGS)
Oid relid,
AttrNumber attno,
Datum value,
int32 flag)
{ {
float64 result; Oid opid = PG_GETARG_OID(0);
Oid relid = PG_GETARG_OID(1);
AttrNumber attno = PG_GETARG_INT16(2);
Datum value = PG_GETARG_DATUM(3);
int32 flag = PG_GETARG_INT32(4);
float8 result;
result = (float64) palloc(sizeof(float64data));
if (NONVALUE(attno) || NONVALUE(relid)) if (NONVALUE(attno) || NONVALUE(relid))
*result = DEFAULT_EQ_SEL; result = DEFAULT_EQ_SEL;
else else
{ {
Oid typid; Oid typid;
@ -239,9 +236,9 @@ eqsel(Oid opid,
selec = get_attdisbursion(relid, attno, 0.01); selec = get_attdisbursion(relid, attno, 0.01);
} }
*result = (float64data) selec; result = (float8) selec;
} }
return result; PG_RETURN_FLOAT8(result);
} }
/* /*
@ -251,18 +248,14 @@ eqsel(Oid opid,
* but have comparable selectivity behavior. See above comments * but have comparable selectivity behavior. See above comments
* for eqsel(). * for eqsel().
*/ */
float64 Datum
neqsel(Oid opid, neqsel(PG_FUNCTION_ARGS)
Oid relid,
AttrNumber attno,
Datum value,
int32 flag)
{ {
float64 result; float8 result;
result = eqsel(opid, relid, attno, value, flag); result = DatumGetFloat8(eqsel(fcinfo));
*result = 1.0 - *result; result = 1.0 - result;
return result; PG_RETURN_FLOAT8(result);
} }
/* /*
@ -272,18 +265,18 @@ neqsel(Oid opid,
* convert_to_scalar(). If it is applied to some other datatype, * convert_to_scalar(). If it is applied to some other datatype,
* it will return a default estimate. * it will return a default estimate.
*/ */
float64 Datum
scalarltsel(Oid opid, scalarltsel(PG_FUNCTION_ARGS)
Oid relid,
AttrNumber attno,
Datum value,
int32 flag)
{ {
float64 result; Oid opid = PG_GETARG_OID(0);
Oid relid = PG_GETARG_OID(1);
AttrNumber attno = PG_GETARG_INT16(2);
Datum value = PG_GETARG_DATUM(3);
int32 flag = PG_GETARG_INT32(4);
float8 result;
result = (float64) palloc(sizeof(float64data));
if (!(flag & SEL_CONSTANT) || NONVALUE(attno) || NONVALUE(relid)) if (!(flag & SEL_CONSTANT) || NONVALUE(attno) || NONVALUE(relid))
*result = DEFAULT_INEQ_SEL; result = DEFAULT_INEQ_SEL;
else else
{ {
HeapTuple oprtuple; HeapTuple oprtuple;
@ -322,8 +315,7 @@ scalarltsel(Oid opid,
&loval, &hival)) &loval, &hival))
{ {
/* no stats available, so default result */ /* no stats available, so default result */
*result = DEFAULT_INEQ_SEL; PG_RETURN_FLOAT8(DEFAULT_INEQ_SEL);
return result;
} }
/* Convert the values to a uniform comparison scale. */ /* Convert the values to a uniform comparison scale. */
@ -344,8 +336,7 @@ scalarltsel(Oid opid,
pfree(DatumGetPointer(hival)); pfree(DatumGetPointer(hival));
pfree(DatumGetPointer(loval)); pfree(DatumGetPointer(loval));
} }
*result = DEFAULT_INEQ_SEL; PG_RETURN_FLOAT8(DEFAULT_INEQ_SEL);
return result;
} }
/* release temp storage if needed */ /* release temp storage if needed */
@ -364,7 +355,7 @@ scalarltsel(Oid opid,
* point the constant is on. But it seems better to assume * point the constant is on. But it seems better to assume
* that the stats are wrong and return a default... * that the stats are wrong and return a default...
*/ */
*result = DEFAULT_INEQ_SEL; result = DEFAULT_INEQ_SEL;
} }
else if (val < low || val > high) else if (val < low || val > high)
{ {
@ -375,9 +366,9 @@ scalarltsel(Oid opid,
* chance the stats are out of date. * chance the stats are out of date.
*/ */
if (flag & SEL_RIGHT) if (flag & SEL_RIGHT)
*result = (val < low) ? 0.001 : 0.999; result = (val < low) ? 0.001 : 0.999;
else else
*result = (val < low) ? 0.999 : 0.001; result = (val < low) ? 0.999 : 0.001;
} }
else else
{ {
@ -386,10 +377,10 @@ scalarltsel(Oid opid,
numerator = val - low; numerator = val - low;
else else
numerator = high - val; numerator = high - val;
*result = numerator / denominator; result = numerator / denominator;
} }
} }
return result; PG_RETURN_FLOAT8(result);
} }
/* /*
@ -397,42 +388,37 @@ scalarltsel(Oid opid,
* *
* See above comments for scalarltsel. * See above comments for scalarltsel.
*/ */
float64 Datum
scalargtsel(Oid opid, scalargtsel(PG_FUNCTION_ARGS)
Oid relid,
AttrNumber attno,
Datum value,
int32 flag)
{ {
float64 result; float8 result;
/* /*
* Compute selectivity of "<", then invert --- but only if we were * Compute selectivity of "<", then invert --- but only if we were
* able to produce a non-default estimate. * able to produce a non-default estimate.
*/ */
result = scalarltsel(opid, relid, attno, value, flag); result = DatumGetFloat8(scalarltsel(fcinfo));
if (*result != DEFAULT_INEQ_SEL) if (result != DEFAULT_INEQ_SEL)
*result = 1.0 - *result; result = 1.0 - result;
return result; PG_RETURN_FLOAT8(result);
} }
/* /*
* patternsel - Generic code for pattern-match selectivity. * patternsel - Generic code for pattern-match selectivity.
*/ */
static float64 static Datum
patternsel(Oid opid, patternsel(PG_FUNCTION_ARGS, Pattern_Type ptype)
Pattern_Type ptype,
Oid relid,
AttrNumber attno,
Datum value,
int32 flag)
{ {
float64 result; Oid opid = PG_GETARG_OID(0);
Oid relid = PG_GETARG_OID(1);
AttrNumber attno = PG_GETARG_INT16(2);
Datum value = PG_GETARG_DATUM(3);
int32 flag = PG_GETARG_INT32(4);
float8 result;
result = (float64) palloc(sizeof(float64data));
/* Must have a constant for the pattern, or cannot learn anything */ /* Must have a constant for the pattern, or cannot learn anything */
if ((flag & (SEL_CONSTANT | SEL_RIGHT)) != (SEL_CONSTANT | SEL_RIGHT)) if ((flag & (SEL_CONSTANT | SEL_RIGHT)) != (SEL_CONSTANT | SEL_RIGHT))
*result = DEFAULT_MATCH_SEL; result = DEFAULT_MATCH_SEL;
else else
{ {
HeapTuple oprtuple; HeapTuple oprtuple;
@ -469,7 +455,12 @@ patternsel(Oid opid,
if (eqopr == InvalidOid) if (eqopr == InvalidOid)
elog(ERROR, "patternsel: no = operator for type %u", ltype); elog(ERROR, "patternsel: no = operator for type %u", ltype);
eqcon = string_to_datum(prefix, ltype); eqcon = string_to_datum(prefix, ltype);
result = eqsel(eqopr, relid, attno, eqcon, SEL_CONSTANT|SEL_RIGHT); result = DatumGetFloat8(DirectFunctionCall5(eqsel,
ObjectIdGetDatum(eqopr),
ObjectIdGetDatum(relid),
Int16GetDatum(attno),
eqcon,
Int32GetDatum(SEL_CONSTANT|SEL_RIGHT)));
pfree(DatumGetPointer(eqcon)); pfree(DatumGetPointer(eqcon));
} }
else else
@ -494,125 +485,103 @@ patternsel(Oid opid,
selec = 0.0; selec = 0.0;
else if (selec > 1.0) else if (selec > 1.0)
selec = 1.0; selec = 1.0;
*result = (float64data) selec; result = (float8) selec;
} }
if (prefix) if (prefix)
pfree(prefix); pfree(prefix);
pfree(patt); pfree(patt);
} }
return result; PG_RETURN_FLOAT8(result);
} }
/* /*
* regexeqsel - Selectivity of regular-expression pattern match. * regexeqsel - Selectivity of regular-expression pattern match.
*/ */
float64 Datum
regexeqsel(Oid opid, regexeqsel(PG_FUNCTION_ARGS)
Oid relid,
AttrNumber attno,
Datum value,
int32 flag)
{ {
return patternsel(opid, Pattern_Type_Regex, relid, attno, value, flag); return patternsel(fcinfo, Pattern_Type_Regex);
} }
/* /*
* icregexeqsel - Selectivity of case-insensitive regex match. * icregexeqsel - Selectivity of case-insensitive regex match.
*/ */
float64 Datum
icregexeqsel(Oid opid, icregexeqsel(PG_FUNCTION_ARGS)
Oid relid,
AttrNumber attno,
Datum value,
int32 flag)
{ {
return patternsel(opid, Pattern_Type_Regex_IC, relid, attno, value, flag); return patternsel(fcinfo, Pattern_Type_Regex_IC);
} }
/* /*
* likesel - Selectivity of LIKE pattern match. * likesel - Selectivity of LIKE pattern match.
*/ */
float64 Datum
likesel(Oid opid, likesel(PG_FUNCTION_ARGS)
Oid relid,
AttrNumber attno,
Datum value,
int32 flag)
{ {
return patternsel(opid, Pattern_Type_Like, relid, attno, value, flag); return patternsel(fcinfo, Pattern_Type_Like);
} }
/* /*
* regexnesel - Selectivity of regular-expression pattern non-match. * regexnesel - Selectivity of regular-expression pattern non-match.
*/ */
float64 Datum
regexnesel(Oid opid, regexnesel(PG_FUNCTION_ARGS)
Oid relid,
AttrNumber attno,
Datum value,
int32 flag)
{ {
float64 result; float8 result;
result = patternsel(opid, Pattern_Type_Regex, relid, attno, value, flag); result = DatumGetFloat8(patternsel(fcinfo, Pattern_Type_Regex));
*result = 1.0 - *result; result = 1.0 - result;
return result; PG_RETURN_FLOAT8(result);
} }
/* /*
* icregexnesel - Selectivity of case-insensitive regex non-match. * icregexnesel - Selectivity of case-insensitive regex non-match.
*/ */
float64 Datum
icregexnesel(Oid opid, icregexnesel(PG_FUNCTION_ARGS)
Oid relid,
AttrNumber attno,
Datum value,
int32 flag)
{ {
float64 result; float8 result;
result = patternsel(opid, Pattern_Type_Regex_IC, relid, attno, value, flag); result = DatumGetFloat8(patternsel(fcinfo, Pattern_Type_Regex_IC));
*result = 1.0 - *result; result = 1.0 - result;
return result; PG_RETURN_FLOAT8(result);
} }
/* /*
* nlikesel - Selectivity of LIKE pattern non-match. * nlikesel - Selectivity of LIKE pattern non-match.
*/ */
float64 Datum
nlikesel(Oid opid, nlikesel(PG_FUNCTION_ARGS)
Oid relid,
AttrNumber attno,
Datum value,
int32 flag)
{ {
float64 result; float8 result;
result = patternsel(opid, Pattern_Type_Like, relid, attno, value, flag); result = DatumGetFloat8(patternsel(fcinfo, Pattern_Type_Like));
*result = 1.0 - *result; result = 1.0 - result;
return result; PG_RETURN_FLOAT8(result);
} }
/* /*
* eqjoinsel - Join selectivity of "=" * eqjoinsel - Join selectivity of "="
*/ */
float64 Datum
eqjoinsel(Oid opid, eqjoinsel(PG_FUNCTION_ARGS)
Oid relid1,
AttrNumber attno1,
Oid relid2,
AttrNumber attno2)
{ {
float64 result; #ifdef NOT_USED
float64data num1, Oid opid = PG_GETARG_OID(0);
#endif
Oid relid1 = PG_GETARG_OID(1);
AttrNumber attno1 = PG_GETARG_INT16(2);
Oid relid2 = PG_GETARG_OID(3);
AttrNumber attno2 = PG_GETARG_INT16(4);
float8 result;
float8 num1,
num2, num2,
min; min;
bool unknown1 = NONVALUE(relid1) || NONVALUE(attno1); bool unknown1 = NONVALUE(relid1) || NONVALUE(attno1);
bool unknown2 = NONVALUE(relid2) || NONVALUE(attno2); bool unknown2 = NONVALUE(relid2) || NONVALUE(attno2);
result = (float64) palloc(sizeof(float64data));
if (unknown1 && unknown2) if (unknown1 && unknown2)
*result = DEFAULT_EQ_SEL; result = DEFAULT_EQ_SEL;
else else
{ {
num1 = unknown1 ? 1.0 : get_attdisbursion(relid1, attno1, 0.01); num1 = unknown1 ? 1.0 : get_attdisbursion(relid1, attno1, 0.01);
@ -637,162 +606,106 @@ eqjoinsel(Oid opid,
* about applying the operator to the most common values? * about applying the operator to the most common values?
*/ */
min = (num1 < num2) ? num1 : num2; min = (num1 < num2) ? num1 : num2;
*result = min; result = min;
} }
return result; PG_RETURN_FLOAT8(result);
} }
/* /*
* neqjoinsel - Join selectivity of "!=" * neqjoinsel - Join selectivity of "!="
*/ */
float64 Datum
neqjoinsel(Oid opid, neqjoinsel(PG_FUNCTION_ARGS)
Oid relid1,
AttrNumber attno1,
Oid relid2,
AttrNumber attno2)
{ {
float64 result; float8 result;
result = eqjoinsel(opid, relid1, attno1, relid2, attno2); result = DatumGetFloat8(eqjoinsel(fcinfo));
*result = 1.0 - *result; result = 1.0 - result;
return result; PG_RETURN_FLOAT8(result);
} }
/* /*
* scalarltjoinsel - Join selectivity of "<" and "<=" for scalars * scalarltjoinsel - Join selectivity of "<" and "<=" for scalars
*/ */
float64 Datum
scalarltjoinsel(Oid opid, scalarltjoinsel(PG_FUNCTION_ARGS)
Oid relid1,
AttrNumber attno1,
Oid relid2,
AttrNumber attno2)
{ {
float64 result; PG_RETURN_FLOAT8(DEFAULT_INEQ_SEL);
result = (float64) palloc(sizeof(float64data));
*result = DEFAULT_INEQ_SEL;
return result;
} }
/* /*
* scalargtjoinsel - Join selectivity of ">" and ">=" for scalars * scalargtjoinsel - Join selectivity of ">" and ">=" for scalars
*/ */
float64 Datum
scalargtjoinsel(Oid opid, scalargtjoinsel(PG_FUNCTION_ARGS)
Oid relid1,
AttrNumber attno1,
Oid relid2,
AttrNumber attno2)
{ {
float64 result; PG_RETURN_FLOAT8(DEFAULT_INEQ_SEL);
result = (float64) palloc(sizeof(float64data));
*result = DEFAULT_INEQ_SEL;
return result;
} }
/* /*
* regexeqjoinsel - Join selectivity of regular-expression pattern match. * regexeqjoinsel - Join selectivity of regular-expression pattern match.
*/ */
float64 Datum
regexeqjoinsel(Oid opid, regexeqjoinsel(PG_FUNCTION_ARGS)
Oid relid1,
AttrNumber attno1,
Oid relid2,
AttrNumber attno2)
{ {
float64 result; PG_RETURN_FLOAT8(DEFAULT_MATCH_SEL);
result = (float64) palloc(sizeof(float64data));
*result = DEFAULT_MATCH_SEL;
return result;
} }
/* /*
* icregexeqjoinsel - Join selectivity of case-insensitive regex match. * icregexeqjoinsel - Join selectivity of case-insensitive regex match.
*/ */
float64 Datum
icregexeqjoinsel(Oid opid, icregexeqjoinsel(PG_FUNCTION_ARGS)
Oid relid1,
AttrNumber attno1,
Oid relid2,
AttrNumber attno2)
{ {
float64 result; PG_RETURN_FLOAT8(DEFAULT_MATCH_SEL);
result = (float64) palloc(sizeof(float64data));
*result = DEFAULT_MATCH_SEL;
return result;
} }
/* /*
* likejoinsel - Join selectivity of LIKE pattern match. * likejoinsel - Join selectivity of LIKE pattern match.
*/ */
float64 Datum
likejoinsel(Oid opid, likejoinsel(PG_FUNCTION_ARGS)
Oid relid1,
AttrNumber attno1,
Oid relid2,
AttrNumber attno2)
{ {
float64 result; PG_RETURN_FLOAT8(DEFAULT_MATCH_SEL);
result = (float64) palloc(sizeof(float64data));
*result = DEFAULT_MATCH_SEL;
return result;
} }
/* /*
* regexnejoinsel - Join selectivity of regex non-match. * regexnejoinsel - Join selectivity of regex non-match.
*/ */
float64 Datum
regexnejoinsel(Oid opid, regexnejoinsel(PG_FUNCTION_ARGS)
Oid relid1,
AttrNumber attno1,
Oid relid2,
AttrNumber attno2)
{ {
float64 result; float8 result;
result = regexeqjoinsel(opid, relid1, attno1, relid2, attno2); result = DatumGetFloat8(regexeqjoinsel(fcinfo));
*result = 1.0 - *result; result = 1.0 - result;
return result; PG_RETURN_FLOAT8(result);
} }
/* /*
* icregexnejoinsel - Join selectivity of case-insensitive regex non-match. * icregexnejoinsel - Join selectivity of case-insensitive regex non-match.
*/ */
float64 Datum
icregexnejoinsel(Oid opid, icregexnejoinsel(PG_FUNCTION_ARGS)
Oid relid1,
AttrNumber attno1,
Oid relid2,
AttrNumber attno2)
{ {
float64 result; float8 result;
result = icregexeqjoinsel(opid, relid1, attno1, relid2, attno2); result = DatumGetFloat8(icregexeqjoinsel(fcinfo));
*result = 1.0 - *result; result = 1.0 - result;
return result; PG_RETURN_FLOAT8(result);
} }
/* /*
* nlikejoinsel - Join selectivity of LIKE pattern non-match. * nlikejoinsel - Join selectivity of LIKE pattern non-match.
*/ */
float64 Datum
nlikejoinsel(Oid opid, nlikejoinsel(PG_FUNCTION_ARGS)
Oid relid1,
AttrNumber attno1,
Oid relid2,
AttrNumber attno2)
{ {
float64 result; float8 result;
result = likejoinsel(opid, relid1, attno1, relid2, attno2); result = DatumGetFloat8(likejoinsel(fcinfo));
*result = 1.0 - *result; result = 1.0 - result;
return result; PG_RETURN_FLOAT8(result);
} }
@ -1563,8 +1476,12 @@ prefix_selectivity(char *prefix,
datatype); datatype);
prefixcon = string_to_datum(prefix, datatype); prefixcon = string_to_datum(prefix, datatype);
/* Assume scalargtsel is appropriate for all supported types */ /* Assume scalargtsel is appropriate for all supported types */
prefixsel = * scalargtsel(cmpopr, relid, attno, prefixsel = DatumGetFloat8(DirectFunctionCall5(scalargtsel,
prefixcon, SEL_CONSTANT|SEL_RIGHT); ObjectIdGetDatum(cmpopr),
ObjectIdGetDatum(relid),
Int16GetDatum(attno),
prefixcon,
Int32GetDatum(SEL_CONSTANT|SEL_RIGHT)));
pfree(DatumGetPointer(prefixcon)); pfree(DatumGetPointer(prefixcon));
/* /*
@ -1582,8 +1499,12 @@ prefix_selectivity(char *prefix,
datatype); datatype);
prefixcon = string_to_datum(greaterstr, datatype); prefixcon = string_to_datum(greaterstr, datatype);
/* Assume scalarltsel is appropriate for all supported types */ /* Assume scalarltsel is appropriate for all supported types */
topsel = * scalarltsel(cmpopr, relid, attno, topsel = DatumGetFloat8(DirectFunctionCall5(scalarltsel,
prefixcon, SEL_CONSTANT|SEL_RIGHT); ObjectIdGetDatum(cmpopr),
ObjectIdGetDatum(relid),
Int16GetDatum(attno),
prefixcon,
Int32GetDatum(SEL_CONSTANT|SEL_RIGHT)));
pfree(DatumGetPointer(prefixcon)); pfree(DatumGetPointer(prefixcon));
pfree(greaterstr); pfree(greaterstr);
@ -1966,13 +1887,16 @@ string_to_datum(const char *str, Oid datatype)
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
static void static Datum
genericcostestimate(Query *root, RelOptInfo *rel, genericcostestimate(PG_FUNCTION_ARGS)
IndexOptInfo *index, List *indexQuals,
Cost *indexStartupCost,
Cost *indexTotalCost,
Selectivity *indexSelectivity)
{ {
Query *root = (Query *) PG_GETARG_POINTER(0);
RelOptInfo *rel = (RelOptInfo *) PG_GETARG_POINTER(1);
IndexOptInfo *index = (IndexOptInfo *) PG_GETARG_POINTER(2);
List *indexQuals = (List *) PG_GETARG_POINTER(3);
Cost *indexStartupCost = (Cost *) PG_GETARG_POINTER(4);
Cost *indexTotalCost = (Cost *) PG_GETARG_POINTER(5);
Selectivity *indexSelectivity = (Selectivity *) PG_GETARG_POINTER(6);
double numIndexTuples; double numIndexTuples;
double numIndexPages; double numIndexPages;
@ -2007,52 +1931,35 @@ genericcostestimate(Query *root, RelOptInfo *rel,
*indexStartupCost = 0; *indexStartupCost = 0;
*indexTotalCost = numIndexPages + *indexTotalCost = numIndexPages +
(cpu_index_tuple_cost + cost_qual_eval(indexQuals)) * numIndexTuples; (cpu_index_tuple_cost + cost_qual_eval(indexQuals)) * numIndexTuples;
/* No real return value ... */
PG_RETURN_POINTER(NULL);
} }
/* /*
* For first cut, just use generic function for all index types. * For first cut, just use generic function for all index types.
*/ */
void Datum
btcostestimate(Query *root, RelOptInfo *rel, btcostestimate(PG_FUNCTION_ARGS)
IndexOptInfo *index, List *indexQuals,
Cost *indexStartupCost,
Cost *indexTotalCost,
Selectivity *indexSelectivity)
{ {
genericcostestimate(root, rel, index, indexQuals, return genericcostestimate(fcinfo);
indexStartupCost, indexTotalCost, indexSelectivity);
} }
void Datum
rtcostestimate(Query *root, RelOptInfo *rel, rtcostestimate(PG_FUNCTION_ARGS)
IndexOptInfo *index, List *indexQuals,
Cost *indexStartupCost,
Cost *indexTotalCost,
Selectivity *indexSelectivity)
{ {
genericcostestimate(root, rel, index, indexQuals, return genericcostestimate(fcinfo);
indexStartupCost, indexTotalCost, indexSelectivity);
} }
void Datum
hashcostestimate(Query *root, RelOptInfo *rel, hashcostestimate(PG_FUNCTION_ARGS)
IndexOptInfo *index, List *indexQuals,
Cost *indexStartupCost,
Cost *indexTotalCost,
Selectivity *indexSelectivity)
{ {
genericcostestimate(root, rel, index, indexQuals, return genericcostestimate(fcinfo);
indexStartupCost, indexTotalCost, indexSelectivity);
} }
void Datum
gistcostestimate(Query *root, RelOptInfo *rel, gistcostestimate(PG_FUNCTION_ARGS)
IndexOptInfo *index, List *indexQuals,
Cost *indexStartupCost,
Cost *indexTotalCost,
Selectivity *indexSelectivity)
{ {
genericcostestimate(root, rel, index, indexQuals, return genericcostestimate(fcinfo);
indexStartupCost, indexTotalCost, indexSelectivity);
} }

View File

@ -1,19 +1,20 @@
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* *
* varchar.c * varchar.c
* Functions for the built-in type char() and varchar(). * Functions for the built-in types char(n) and varchar(n).
* *
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.62 2000/05/30 00:49:53 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.63 2000/06/05 07:28:52 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
#include "postgres.h" #include "postgres.h"
#include "catalog/pg_type.h" #include "catalog/pg_type.h"
#include "utils/builtins.h" #include "utils/builtins.h"
#include "utils/fmgroids.h" #include "utils/fmgroids.h"
@ -22,9 +23,10 @@
#include "mb/pg_wchar.h" #include "mb/pg_wchar.h"
#endif #endif
#ifdef CYR_RECODE
char *convertstr(char *, int, int);
#ifdef CYR_RECODE
/* XXX no points for style --- this is actually in utils/init/miscinit.c */
extern char *convertstr(char *, int, int);
#endif #endif
@ -34,7 +36,7 @@ char *convertstr(char *, int, int);
* VARCHAR is for storing string whose length is at most the length specified * VARCHAR is for storing string whose length is at most the length specified
* at CREATE TABLE time. * at CREATE TABLE time.
* *
* It's hard to implement these types because we cannot figure out what * It's hard to implement these types because we cannot figure out
* the length of the type from the type itself. I change (hopefully all) the * the length of the type from the type itself. I change (hopefully all) the
* fmgr calls that invoke input functions of a data type to supply the * fmgr calls that invoke input functions of a data type to supply the
* length also. (eg. in INSERTs, we have the tupleDescriptor which contains * length also. (eg. in INSERTs, we have the tupleDescriptor which contains
@ -44,8 +46,9 @@ char *convertstr(char *, int, int);
* must be null-terminated. * must be null-terminated.
* *
* We actually implement this as a varlena so that we don't have to pass in * We actually implement this as a varlena so that we don't have to pass in
* the length for the comparison functions. (The difference between "text" * the length for the comparison functions. (The difference between these
* is that we truncate and possibly blank-pad the string at insertion time.) * types and "text" is that we truncate and possibly blank-pad the string
* at insertion time.)
* *
* - ay 6/95 * - ay 6/95
*/ */
@ -231,28 +234,33 @@ _bpchar(ArrayType *v, int32 len)
/* bpchar_char() /* bpchar_char()
* Convert bpchar(1) to char. * Convert bpchar(1) to char.
*
* If input is multiple chars, only the first is returned.
*/ */
int32 Datum
bpchar_char(char *s) bpchar_char(PG_FUNCTION_ARGS)
{ {
return (int32) *VARDATA(s); struct varlena *s = PG_GETARG_BPCHAR_P(0);
} /* bpchar_char() */
PG_RETURN_CHAR(*VARDATA(s));
}
/* char_bpchar() /* char_bpchar()
* Convert char to bpchar(1). * Convert char to bpchar(1).
*/ */
char * Datum
char_bpchar(int32 c) char_bpchar(PG_FUNCTION_ARGS)
{ {
char *result; char c = PG_GETARG_CHAR(0);
struct varlena *result;
result = palloc(VARHDRSZ + 1); result = (struct varlena *) palloc(VARHDRSZ + 1);
VARSIZE(result) = VARHDRSZ + 1; VARSIZE(result) = VARHDRSZ + 1;
*(VARDATA(result)) = (char) c; *(VARDATA(result)) = c;
return result; PG_RETURN_BPCHAR_P(result);
} /* char_bpchar() */ }
/* bpchar_name() /* bpchar_name()

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.64 2000/05/28 17:56:06 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.65 2000/06/05 07:28:53 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -35,7 +35,7 @@ static Index CatalogCacheComputeTupleHashIndex(struct catcache * cacheInOutP,
HeapTuple tuple); HeapTuple tuple);
static void CatalogCacheInitializeCache(struct catcache * cache, static void CatalogCacheInitializeCache(struct catcache * cache,
Relation relation); Relation relation);
static uint32 cc_hashname(NameData *n); static Datum cc_hashname(PG_FUNCTION_ARGS);
/* ---------------- /* ----------------
* variables, macros and other stuff * variables, macros and other stuff
@ -87,38 +87,38 @@ static const Oid eqproc[] = {
* ---------------------------------------------------------------- * ----------------------------------------------------------------
*/ */
static CCHashFunc static PGFunction
GetCCHashFunc(Oid keytype) GetCCHashFunc(Oid keytype)
{ {
switch (keytype) switch (keytype)
{ {
case BOOLOID: case BOOLOID:
case CHAROID: case CHAROID:
return (CCHashFunc) hashchar; return hashchar;
case NAMEOID: case NAMEOID:
return (CCHashFunc) cc_hashname; return cc_hashname;
case INT2OID: case INT2OID:
return (CCHashFunc) hashint2; return hashint2;
case INT2VECTOROID: case INT2VECTOROID:
return (CCHashFunc) hashint2vector; return hashint2vector;
case INT4OID: case INT4OID:
return (CCHashFunc) hashint4; return hashint4;
case TEXTOID: case TEXTOID:
return (CCHashFunc) hashtext; return hashtext;
case REGPROCOID: case REGPROCOID:
case OIDOID: case OIDOID:
return (CCHashFunc) hashoid; return hashoid;
case OIDVECTOROID: case OIDVECTOROID:
return (CCHashFunc) hashoidvector; return hashoidvector;
default: default:
elog(FATAL, "GetCCHashFunc: type %u unsupported as catcache key", elog(FATAL, "GetCCHashFunc: type %u unsupported as catcache key",
keytype); keytype);
return NULL; return (PGFunction) NULL;
} }
} }
static uint32 static Datum
cc_hashname(NameData *n) cc_hashname(PG_FUNCTION_ARGS)
{ {
/* /*
@ -129,9 +129,9 @@ cc_hashname(NameData *n)
*/ */
NameData my_n; NameData my_n;
namestrcpy(&my_n, NameStr(*n)); namestrcpy(&my_n, NameStr(* PG_GETARG_NAME(0)));
return hashname(&my_n); return DirectFunctionCall1(hashname, NameGetDatum(&my_n));
} }
@ -320,19 +320,23 @@ CatalogCacheComputeHashIndex(struct catcache * cacheInP)
{ {
case 4: case 4:
hashIndex ^= hashIndex ^=
(*cacheInP->cc_hashfunc[3]) (cacheInP->cc_skey[3].sk_argument) << 9; DatumGetUInt32(DirectFunctionCall1(cacheInP->cc_hashfunc[3],
cacheInP->cc_skey[3].sk_argument)) << 9;
/* FALLTHROUGH */ /* FALLTHROUGH */
case 3: case 3:
hashIndex ^= hashIndex ^=
(*cacheInP->cc_hashfunc[2]) (cacheInP->cc_skey[2].sk_argument) << 6; DatumGetUInt32(DirectFunctionCall1(cacheInP->cc_hashfunc[2],
cacheInP->cc_skey[2].sk_argument)) << 6;
/* FALLTHROUGH */ /* FALLTHROUGH */
case 2: case 2:
hashIndex ^= hashIndex ^=
(*cacheInP->cc_hashfunc[1]) (cacheInP->cc_skey[1].sk_argument) << 3; DatumGetUInt32(DirectFunctionCall1(cacheInP->cc_hashfunc[1],
cacheInP->cc_skey[1].sk_argument)) << 3;
/* FALLTHROUGH */ /* FALLTHROUGH */
case 1: case 1:
hashIndex ^= hashIndex ^=
(*cacheInP->cc_hashfunc[0]) (cacheInP->cc_skey[0].sk_argument); DatumGetUInt32(DirectFunctionCall1(cacheInP->cc_hashfunc[0],
cacheInP->cc_skey[0].sk_argument));
break; break;
default: default:
elog(FATAL, "CCComputeHashIndex: %d cc_nkeys", cacheInP->cc_nkeys); elog(FATAL, "CCComputeHashIndex: %d cc_nkeys", cacheInP->cc_nkeys);

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.42 2000/05/30 04:24:53 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.43 2000/06/05 07:28:55 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -21,6 +21,27 @@
#include "utils/fmgrtab.h" #include "utils/fmgrtab.h"
#include "utils/syscache.h" #include "utils/syscache.h"
/*
* Declaration for old-style function pointer type. This is now used only
* in fmgr_oldstyle() and is no longer exported.
*
* The m68k SVR4 ABI defines that pointers are returned in %a0 instead of
* %d0. So if a function pointer is declared to return a pointer, the
* compiler may look only into %a0, but if the called function was declared
* to return an integer type, it puts its value only into %d0. So the
* caller doesn't pink up the correct return value. The solution is to
* declare the function pointer to return int, so the compiler picks up the
* return value from %d0. (Functions returning pointers put their value
* *additionally* into %d0 for compatibility.) The price is that there are
* some warnings about int->pointer conversions...
*/
#if defined(__mc68000__) && defined(__ELF__)
typedef int32 ((*func_ptr) ());
#else
typedef char *((*func_ptr) ());
#endif
static Datum fmgr_oldstyle(PG_FUNCTION_ARGS); static Datum fmgr_oldstyle(PG_FUNCTION_ARGS);
static Datum fmgr_untrusted(PG_FUNCTION_ARGS); static Datum fmgr_untrusted(PG_FUNCTION_ARGS);
static Datum fmgr_sql(PG_FUNCTION_ARGS); static Datum fmgr_sql(PG_FUNCTION_ARGS);
@ -377,7 +398,7 @@ fmgr_oldstyle(PG_FUNCTION_ARGS)
default: default:
/* /*
* Increasing FUNC_MAX_ARGS doesn't automatically add cases * Increasing FUNC_MAX_ARGS doesn't automatically add cases
* to the above code, so give the actual value in this error * to the above code, so mention the actual value in this error
* not FUNC_MAX_ARGS. You could add cases to the above if you * not FUNC_MAX_ARGS. You could add cases to the above if you
* needed to support old-style functions with many arguments, * needed to support old-style functions with many arguments,
* but making 'em be new-style is probably a better idea. * but making 'em be new-style is probably a better idea.
@ -420,100 +441,6 @@ fmgr_sql(PG_FUNCTION_ARGS)
return 0; /* keep compiler happy */ return 0; /* keep compiler happy */
} }
#if 0
/*
* Interface routine for functions using fmgr_faddr
*/
FmgrInfo *fmgr_pl_finfo; /* should GO AWAY */
char *
fmgr_faddr_link(char *arg0, ...)
{
FunctionCallInfoData fcinfo;
int n_arguments;
Datum result;
MemSet(&fcinfo, 0, sizeof(fcinfo));
/* We rely on fmgr_faddr macro to have set back-link to FmgrInfo (ugh) */
fcinfo.flinfo = fmgr_pl_finfo;
fcinfo.nargs = fcinfo.flinfo->fn_nargs;
n_arguments = fcinfo.nargs;
if (n_arguments > 0)
{
fcinfo.arg[0] = (Datum) arg0;
if (n_arguments > 1)
{
va_list pvar;
int i;
if (n_arguments > FUNC_MAX_ARGS)
elog(ERROR, "fmgr_faddr_link: function %u: too many arguments (%d > %d)",
fcinfo.flinfo->fn_oid, n_arguments, FUNC_MAX_ARGS);
va_start(pvar, arg0);
for (i = 1; i < n_arguments; i++)
fcinfo.arg[i] = (Datum) va_arg(pvar, char *);
va_end(pvar);
}
}
result = FunctionCallInvoke(&fcinfo);
/* Check for null result, since caller is clearly not expecting one */
if (fcinfo.isnull)
elog(ERROR, "fmgr_faddr_link: function %u returned NULL",
fcinfo.flinfo->fn_oid);
return (char *) result;
}
/*
* fmgr - return the value of a function call
*
* This is essentially fmgr_info plus call the function.
*/
char *
fmgr(Oid procedureId,...)
{
FmgrInfo flinfo;
FunctionCallInfoData fcinfo;
int n_arguments;
Datum result;
fmgr_info(procedureId, &flinfo);
MemSet(&fcinfo, 0, sizeof(fcinfo));
fcinfo.flinfo = &flinfo;
fcinfo.nargs = flinfo.fn_nargs;
n_arguments = fcinfo.nargs;
if (n_arguments > 0)
{
va_list pvar;
int i;
if (n_arguments > FUNC_MAX_ARGS)
elog(ERROR, "fmgr: function %u: too many arguments (%d > %d)",
flinfo.fn_oid, n_arguments, FUNC_MAX_ARGS);
va_start(pvar, procedureId);
for (i = 0; i < n_arguments; i++)
fcinfo.arg[i] = (Datum) va_arg(pvar, char *);
va_end(pvar);
}
result = FunctionCallInvoke(&fcinfo);
/* Check for null result, since caller is clearly not expecting one */
if (fcinfo.isnull)
elog(ERROR, "fmgr: function %u returned NULL",
flinfo.fn_oid);
return (char *) result;
}
#endif
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* Support routines for callers of fmgr-compatible functions * Support routines for callers of fmgr-compatible functions
@ -1267,6 +1194,57 @@ OidFunctionCall9(Oid functionId, Datum arg1, Datum arg2,
} }
/*
* !!! OLD INTERFACE !!!
*
* fmgr() is the only remaining vestige of the old-style caller support
* functions. It's no longer used anywhere in the Postgres distribution,
* but we should leave it around for a release or two to ease the transition
* for user-supplied C functions. OidFunctionCallN() replaces it for new
* code.
*
* DEPRECATED, DO NOT USE IN NEW CODE
*/
char *
fmgr(Oid procedureId,...)
{
FmgrInfo flinfo;
FunctionCallInfoData fcinfo;
int n_arguments;
Datum result;
fmgr_info(procedureId, &flinfo);
MemSet(&fcinfo, 0, sizeof(fcinfo));
fcinfo.flinfo = &flinfo;
fcinfo.nargs = flinfo.fn_nargs;
n_arguments = fcinfo.nargs;
if (n_arguments > 0)
{
va_list pvar;
int i;
if (n_arguments > FUNC_MAX_ARGS)
elog(ERROR, "fmgr: function %u: too many arguments (%d > %d)",
flinfo.fn_oid, n_arguments, FUNC_MAX_ARGS);
va_start(pvar, procedureId);
for (i = 0; i < n_arguments; i++)
fcinfo.arg[i] = (Datum) va_arg(pvar, char *);
va_end(pvar);
}
result = FunctionCallInvoke(&fcinfo);
/* Check for null result, since caller is clearly not expecting one */
if (fcinfo.isnull)
elog(ERROR, "fmgr: function %u returned NULL",
flinfo.fn_oid);
return (char *) result;
}
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* Support routines for standard pass-by-reference datatypes * Support routines for standard pass-by-reference datatypes
* *

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: hash.h,v 1.31 2000/02/21 03:36:51 tgl Exp $ * $Id: hash.h,v 1.32 2000/06/05 07:28:57 tgl Exp $
* *
* NOTES * NOTES
* modeled after Margo Seltzer's hash implementation for unix. * modeled after Margo Seltzer's hash implementation for unix.
@ -21,7 +21,7 @@
#include "access/itup.h" #include "access/itup.h"
#include "access/relscan.h" #include "access/relscan.h"
#include "access/sdir.h" #include "access/sdir.h"
#include "utils/int8.h" #include "fmgr.h"
/* /*
* An overflow page is a spare page allocated for storing data whose * An overflow page is a spare page allocated for storing data whose
@ -262,18 +262,24 @@ extern void hashmarkpos(IndexScanDesc scan);
extern void hashrestrpos(IndexScanDesc scan); extern void hashrestrpos(IndexScanDesc scan);
extern void hashdelete(Relation rel, ItemPointer tid); extern void hashdelete(Relation rel, ItemPointer tid);
/* hashfunc.c */ /*
extern uint32 hashint2(int16 key); * Datatype-specific hash functions in hashfunc.c.
extern uint32 hashint4(uint32 key); *
extern uint32 hashint8(int64 *key); * NOTE: some of these are also used by catcache operations, without
extern uint32 hashfloat4(float32 keyp); * any direct connection to hash indexes.
extern uint32 hashfloat8(float64 keyp); */
extern uint32 hashoid(Oid key); extern Datum hashint2(PG_FUNCTION_ARGS);
extern uint32 hashoidvector(Oid *key); extern Datum hashint4(PG_FUNCTION_ARGS);
extern uint32 hashint2vector(int16 *key); extern Datum hashint8(PG_FUNCTION_ARGS);
extern uint32 hashchar(char key); extern Datum hashfloat4(PG_FUNCTION_ARGS);
extern uint32 hashtext(struct varlena * key); extern Datum hashfloat8(PG_FUNCTION_ARGS);
extern uint32 hashname(NameData *n); extern Datum hashoid(PG_FUNCTION_ARGS);
extern Datum hashoidvector(PG_FUNCTION_ARGS);
extern Datum hashint2vector(PG_FUNCTION_ARGS);
extern Datum hashchar(PG_FUNCTION_ARGS);
extern Datum hashtext(PG_FUNCTION_ARGS);
extern Datum hashname(PG_FUNCTION_ARGS);
/* private routines */ /* private routines */

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: xact.h,v 1.24 2000/01/26 05:57:51 momjian Exp $ * $Id: xact.h,v 1.25 2000/06/05 07:28:57 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -115,9 +115,9 @@ extern void AbortOutOfAnyTransaction(void);
extern TransactionId DisabledTransactionId; extern TransactionId DisabledTransactionId;
/* defined in xid.c */ /* defined in xid.c */
extern TransactionId xidin(char *representation); extern Datum xidin(PG_FUNCTION_ARGS);
extern char *xidout(TransactionId transactionId); extern Datum xidout(PG_FUNCTION_ARGS);
extern bool xideq(TransactionId xid1, TransactionId xid2); extern Datum xideq(PG_FUNCTION_ARGS);
extern void TransactionIdAdd(TransactionId *xid, int value); extern void TransactionIdAdd(TransactionId *xid, int value);
#endif /* XACT_H */ #endif /* XACT_H */

View File

@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: catversion.h,v 1.23 2000/05/29 01:59:10 tgl Exp $ * $Id: catversion.h,v 1.24 2000/06/05 07:28:58 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -53,6 +53,6 @@
*/ */
/* yyyymmddN */ /* yyyymmddN */
#define CATALOG_VERSION_NO 200005282 #define CATALOG_VERSION_NO 200006021
#endif #endif

View File

@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pg_operator.h,v 1.75 2000/04/12 17:16:29 momjian Exp $ * $Id: pg_operator.h,v 1.76 2000/06/05 07:28:59 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
@ -711,17 +711,17 @@ DATA(insert OID = 1763 ( "@" PGUID 0 l t f 0 1700 1700 0 0 0 0 numeric_ab
/* LZTEXT type */ /* LZTEXT type */
DATA(insert OID = 1657 ( "=" PGUID 0 b t f 1625 1625 16 1657 1658 1659 1659 lztext_eq eqsel eqjoinsel )); DATA(insert OID = 1657 ( "=" PGUID 0 b t f 1625 1625 16 1657 1658 1659 1659 lztext_eq eqsel eqjoinsel ));
DATA(insert OID = 1658 ( "<>" PGUID 0 b t f 1625 1625 16 1658 1657 0 0 lztext_ne neqsel neqjoinsel )); DATA(insert OID = 1658 ( "<>" PGUID 0 b t f 1625 1625 16 1658 1657 0 0 lztext_ne neqsel neqjoinsel ));
DATA(insert OID = 1659 ( "<" PGUID 0 b t f 1625 1625 16 1661 1662 0 0 lztext_lt intltsel intltjoinsel )); DATA(insert OID = 1659 ( "<" PGUID 0 b t f 1625 1625 16 1661 1662 0 0 lztext_lt scalarltsel scalarltjoinsel ));
DATA(insert OID = 1660 ( "<=" PGUID 0 b t f 1625 1625 16 1662 1661 0 0 lztext_le intltsel intltjoinsel )); DATA(insert OID = 1660 ( "<=" PGUID 0 b t f 1625 1625 16 1662 1661 0 0 lztext_le scalarltsel scalarltjoinsel ));
DATA(insert OID = 1661 ( ">" PGUID 0 b t f 1625 1625 16 1659 1660 0 0 lztext_gt intgtsel intgtjoinsel )); DATA(insert OID = 1661 ( ">" PGUID 0 b t f 1625 1625 16 1659 1660 0 0 lztext_gt scalargtsel scalargtjoinsel ));
DATA(insert OID = 1662 ( ">=" PGUID 0 b t f 1625 1625 16 1660 1659 0 0 lztext_ge intgtsel intgtjoinsel )); DATA(insert OID = 1662 ( ">=" PGUID 0 b t f 1625 1625 16 1660 1659 0 0 lztext_ge scalargtsel scalargtjoinsel ));
DATA(insert OID = 1784 ( "=" PGUID 0 b t f 1560 1560 16 1784 1785 1786 1786 biteq eqsel eqjoinsel )); DATA(insert OID = 1784 ( "=" PGUID 0 b t f 1560 1560 16 1784 1785 1786 1786 biteq eqsel eqjoinsel ));
DATA(insert OID = 1785 ( "<>" PGUID 0 b t f 1560 1560 16 1785 1784 0 0 bitne neqsel neqjoinsel )); DATA(insert OID = 1785 ( "<>" PGUID 0 b t f 1560 1560 16 1785 1784 0 0 bitne neqsel neqjoinsel ));
DATA(insert OID = 1786 ( "<" PGUID 0 b t f 1560 1560 16 1787 1789 0 0 bitlt intltsel intltjoinsel )); DATA(insert OID = 1786 ( "<" PGUID 0 b t f 1560 1560 16 1787 1789 0 0 bitlt scalarltsel scalarltjoinsel ));
DATA(insert OID = 1787 ( ">" PGUID 0 b t f 1560 1560 16 1786 1788 0 0 bitgt intgtsel intgtjoinsel )); DATA(insert OID = 1787 ( ">" PGUID 0 b t f 1560 1560 16 1786 1788 0 0 bitgt scalargtsel scalargtjoinsel ));
DATA(insert OID = 1788 ( "<=" PGUID 0 b t f 1560 1560 16 1789 1787 0 0 bitle intltsel intltjoinsel )); DATA(insert OID = 1788 ( "<=" PGUID 0 b t f 1560 1560 16 1789 1787 0 0 bitle scalarltsel scalarltjoinsel ));
DATA(insert OID = 1789 ( ">=" PGUID 0 b t f 1560 1560 16 1788 1786 0 0 bitge intgtsel intgtjoinsel )); DATA(insert OID = 1789 ( ">=" PGUID 0 b t f 1560 1560 16 1788 1786 0 0 bitge scalargtsel scalargtjoinsel ));
DATA(insert OID = 1790 ( "<=>" PGUID 0 b t f 1560 1560 23 0 0 0 0 bitcmp - - )); DATA(insert OID = 1790 ( "<=>" PGUID 0 b t f 1560 1560 23 0 0 0 0 bitcmp - - ));
DATA(insert OID = 1791 ( "&" PGUID 0 b t f 1560 1560 1560 0 0 0 0 bitand - - )); DATA(insert OID = 1791 ( "&" PGUID 0 b t f 1560 1560 1560 0 0 0 0 bitand - - ));
DATA(insert OID = 1792 ( "|" PGUID 0 b t f 1560 1560 1560 0 0 0 0 bitor - - )); DATA(insert OID = 1792 ( "|" PGUID 0 b t f 1560 1560 1560 0 0 0 0 bitor - - ));
@ -733,10 +733,10 @@ DATA(insert OID = 1797 ( "||" PGUID 0 b t f 1560 1560 1560 0 0 0 0 bitc
DATA(insert OID = 1804 ( "=" PGUID 0 b t f 1562 1562 16 1804 1805 1806 1806 varbiteq eqsel eqjoinsel )); DATA(insert OID = 1804 ( "=" PGUID 0 b t f 1562 1562 16 1804 1805 1806 1806 varbiteq eqsel eqjoinsel ));
DATA(insert OID = 1805 ( "<>" PGUID 0 b t f 1562 1562 16 1805 1804 0 0 varbitne neqsel neqjoinsel )); DATA(insert OID = 1805 ( "<>" PGUID 0 b t f 1562 1562 16 1805 1804 0 0 varbitne neqsel neqjoinsel ));
DATA(insert OID = 1806 ( "<" PGUID 0 b t f 1562 1562 16 1807 1809 0 0 varbitlt intltsel intltjoinsel )); DATA(insert OID = 1806 ( "<" PGUID 0 b t f 1562 1562 16 1807 1809 0 0 varbitlt scalarltsel scalarltjoinsel ));
DATA(insert OID = 1807 ( ">" PGUID 0 b t f 1562 1562 16 1806 1808 0 0 varbitgt intgtsel intgtjoinsel )); DATA(insert OID = 1807 ( ">" PGUID 0 b t f 1562 1562 16 1806 1808 0 0 varbitgt scalargtsel scalargtjoinsel ));
DATA(insert OID = 1808 ( "<=" PGUID 0 b t f 1562 1562 16 1809 1807 0 0 varbitle intltsel intltjoinsel )); DATA(insert OID = 1808 ( "<=" PGUID 0 b t f 1562 1562 16 1809 1807 0 0 varbitle scalarltsel scalarltjoinsel ));
DATA(insert OID = 1809 ( ">=" PGUID 0 b t f 1562 1562 16 1808 1806 0 0 varbitge intgtsel intgtjoinsel )); DATA(insert OID = 1809 ( ">=" PGUID 0 b t f 1562 1562 16 1808 1806 0 0 varbitge scalargtsel scalargtjoinsel ));
DATA(insert OID = 1810 ( "<=>" PGUID 0 b t f 1562 1562 23 0 0 0 0 varbitcmp - - )); DATA(insert OID = 1810 ( "<=>" PGUID 0 b t f 1562 1562 23 0 0 0 0 varbitcmp - - ));
DATA(insert OID = 1811 ( "&" PGUID 0 b t f 1562 1562 1562 0 0 0 0 varbitand - - )); DATA(insert OID = 1811 ( "&" PGUID 0 b t f 1562 1562 1562 0 0 0 0 varbitand - - ));
DATA(insert OID = 1812 ( "|" PGUID 0 b t f 1562 1562 1562 0 0 0 0 varbitor - - )); DATA(insert OID = 1812 ( "|" PGUID 0 b t f 1562 1562 1562 0 0 0 0 varbitor - - ));

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pg_proc.h,v 1.135 2000/05/29 01:59:10 tgl Exp $ * $Id: pg_proc.h,v 1.136 2000/06/05 07:28:59 tgl Exp $
* *
* NOTES * NOTES
* The script catalog/genbki.sh reads this file and generates .bki * The script catalog/genbki.sh reads this file and generates .bki
@ -97,37 +97,37 @@ typedef FormData_pg_proc *Form_pg_proc;
/* OIDS 1 - 99 */ /* OIDS 1 - 99 */
DATA(insert OID = 1242 ( boolin PGUID 11 f t t t 1 f 16 "0" 100 0 0 100 boolin - )); DATA(insert OID = 1242 ( boolin PGUID 12 f t t t 1 f 16 "0" 100 0 0 100 boolin - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1243 ( boolout PGUID 11 f t t t 1 f 23 "0" 100 0 0 100 boolout - )); DATA(insert OID = 1243 ( boolout PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 boolout - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1244 ( byteain PGUID 11 f t t t 1 f 17 "0" 100 0 0 100 byteain - )); DATA(insert OID = 1244 ( byteain PGUID 11 f t t t 1 f 17 "0" 100 0 0 100 byteain - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 31 ( byteaout PGUID 11 f t t t 1 f 23 "0" 100 0 0 100 byteaout - )); DATA(insert OID = 31 ( byteaout PGUID 11 f t t t 1 f 23 "0" 100 0 0 100 byteaout - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1245 ( charin PGUID 11 f t t t 1 f 18 "0" 100 0 0 100 charin - )); DATA(insert OID = 1245 ( charin PGUID 12 f t t t 1 f 18 "0" 100 0 0 100 charin - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 33 ( charout PGUID 11 f t t t 1 f 23 "0" 100 0 0 100 charout - )); DATA(insert OID = 33 ( charout PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 charout - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 34 ( namein PGUID 11 f t t t 1 f 19 "0" 100 0 0 100 namein - )); DATA(insert OID = 34 ( namein PGUID 11 f t t t 1 f 19 "0" 100 0 0 100 namein - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 35 ( nameout PGUID 11 f t t t 1 f 23 "0" 100 0 0 100 nameout - )); DATA(insert OID = 35 ( nameout PGUID 11 f t t t 1 f 23 "0" 100 0 0 100 nameout - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 38 ( int2in PGUID 11 f t t t 1 f 21 "0" 100 0 0 100 int2in - )); DATA(insert OID = 38 ( int2in PGUID 12 f t t t 1 f 21 "0" 100 0 0 100 int2in - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 39 ( int2out PGUID 11 f t t t 1 f 23 "0" 100 0 0 100 int2out - )); DATA(insert OID = 39 ( int2out PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 int2out - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 40 ( int2vectorin PGUID 11 f t t t 1 f 22 "0" 100 0 0 100 int2vectorin - )); DATA(insert OID = 40 ( int2vectorin PGUID 12 f t t t 1 f 22 "0" 100 0 0 100 int2vectorin - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 41 ( int2vectorout PGUID 11 f t t t 1 f 23 "0" 100 0 0 100 int2vectorout - )); DATA(insert OID = 41 ( int2vectorout PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 int2vectorout - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 42 ( int4in PGUID 11 f t t t 1 f 23 "0" 100 0 0 100 int4in - )); DATA(insert OID = 42 ( int4in PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 int4in - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 43 ( int4out PGUID 11 f t t t 1 f 19 "0" 100 0 0 100 int4out - )); DATA(insert OID = 43 ( int4out PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 int4out - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 44 ( regprocin PGUID 11 f t f t 1 f 24 "0" 100 0 0 100 regprocin - )); DATA(insert OID = 44 ( regprocin PGUID 12 f t f t 1 f 24 "0" 100 0 0 100 regprocin - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 45 ( regprocout PGUID 11 f t f t 1 f 23 "0" 100 0 0 100 regprocout - )); DATA(insert OID = 45 ( regprocout PGUID 12 f t f t 1 f 23 "0" 100 0 0 100 regprocout - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 46 ( textin PGUID 11 f t t t 1 f 25 "0" 100 0 0 100 textin - )); DATA(insert OID = 46 ( textin PGUID 11 f t t t 1 f 25 "0" 100 0 0 100 textin - ));
DESCR("(internal)"); DESCR("(internal)");
@ -137,59 +137,59 @@ DATA(insert OID = 48 ( tidin PGUID 11 f t t t 1 f 27 "0" 100 0 0 100 tid
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 49 ( tidout PGUID 11 f t t t 1 f 23 "0" 100 0 0 100 tidout - )); DATA(insert OID = 49 ( tidout PGUID 11 f t t t 1 f 23 "0" 100 0 0 100 tidout - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 50 ( xidin PGUID 11 f t t t 1 f 28 "0" 100 0 0 100 xidin - )); DATA(insert OID = 50 ( xidin PGUID 12 f t t t 1 f 28 "0" 100 0 0 100 xidin - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 51 ( xidout PGUID 11 f t t t 1 f 23 "0" 100 0 0 100 xidout - )); DATA(insert OID = 51 ( xidout PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 xidout - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 52 ( cidin PGUID 11 f t t t 1 f 29 "0" 100 0 0 100 cidin - )); DATA(insert OID = 52 ( cidin PGUID 12 f t t t 1 f 29 "0" 100 0 0 100 cidin - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 53 ( cidout PGUID 11 f t t t 1 f 23 "0" 100 0 0 100 cidout - )); DATA(insert OID = 53 ( cidout PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 cidout - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 54 ( oidvectorin PGUID 11 f t t t 1 f 30 "0" 100 0 0 100 oidvectorin - )); DATA(insert OID = 54 ( oidvectorin PGUID 12 f t t t 1 f 30 "0" 100 0 0 100 oidvectorin - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 55 ( oidvectorout PGUID 11 f t t t 1 f 23 "0" 100 0 0 100 oidvectorout - )); DATA(insert OID = 55 ( oidvectorout PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 oidvectorout - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 56 ( boollt PGUID 11 f t t t 2 f 16 "16 16" 100 0 0 100 boollt - )); DATA(insert OID = 56 ( boollt PGUID 12 f t t t 2 f 16 "16 16" 100 0 0 100 boollt - ));
DESCR("less-than"); DESCR("less-than");
DATA(insert OID = 57 ( boolgt PGUID 11 f t t t 2 f 16 "16 16" 100 0 0 100 boolgt - )); DATA(insert OID = 57 ( boolgt PGUID 12 f t t t 2 f 16 "16 16" 100 0 0 100 boolgt - ));
DESCR("greater-than"); DESCR("greater-than");
DATA(insert OID = 60 ( booleq PGUID 11 f t t t 2 f 16 "16 16" 100 0 0 100 booleq - )); DATA(insert OID = 60 ( booleq PGUID 12 f t t t 2 f 16 "16 16" 100 0 0 100 booleq - ));
DESCR("equal"); DESCR("equal");
DATA(insert OID = 61 ( chareq PGUID 11 f t t t 2 f 16 "18 18" 100 0 0 100 chareq - )); DATA(insert OID = 61 ( chareq PGUID 12 f t t t 2 f 16 "18 18" 100 0 0 100 chareq - ));
DESCR("equal"); DESCR("equal");
DATA(insert OID = 62 ( nameeq PGUID 11 f t t t 2 f 16 "19 19" 100 0 0 100 nameeq - )); DATA(insert OID = 62 ( nameeq PGUID 11 f t t t 2 f 16 "19 19" 100 0 0 100 nameeq - ));
DESCR("equal"); DESCR("equal");
DATA(insert OID = 63 ( int2eq PGUID 11 f t t t 2 f 16 "21 21" 100 0 0 100 int2eq - )); DATA(insert OID = 63 ( int2eq PGUID 12 f t t t 2 f 16 "21 21" 100 0 0 100 int2eq - ));
DESCR("equal"); DESCR("equal");
DATA(insert OID = 64 ( int2lt PGUID 11 f t t t 2 f 16 "21 21" 100 0 0 100 int2lt - )); DATA(insert OID = 64 ( int2lt PGUID 12 f t t t 2 f 16 "21 21" 100 0 0 100 int2lt - ));
DESCR("less-than"); DESCR("less-than");
DATA(insert OID = 65 ( int4eq PGUID 11 f t t t 2 f 16 "23 23" 100 0 0 100 int4eq - )); DATA(insert OID = 65 ( int4eq PGUID 12 f t t t 2 f 16 "23 23" 100 0 0 100 int4eq - ));
DESCR("equal"); DESCR("equal");
DATA(insert OID = 66 ( int4lt PGUID 11 f t t t 2 f 16 "23 23" 100 0 0 100 int4lt - )); DATA(insert OID = 66 ( int4lt PGUID 12 f t t t 2 f 16 "23 23" 100 0 0 100 int4lt - ));
DESCR("less-than"); DESCR("less-than");
DATA(insert OID = 67 ( texteq PGUID 11 f t t t 2 f 16 "25 25" 100 0 0 0 texteq - )); DATA(insert OID = 67 ( texteq PGUID 11 f t t t 2 f 16 "25 25" 100 0 0 0 texteq - ));
DESCR("equal"); DESCR("equal");
DATA(insert OID = 68 ( xideq PGUID 11 f t t t 2 f 16 "28 28" 100 0 0 100 xideq - )); DATA(insert OID = 68 ( xideq PGUID 12 f t t t 2 f 16 "28 28" 100 0 0 100 xideq - ));
DESCR("equal"); DESCR("equal");
DATA(insert OID = 69 ( cideq PGUID 11 f t t t 2 f 16 "29 29" 100 0 0 100 cideq - )); DATA(insert OID = 69 ( cideq PGUID 12 f t t t 2 f 16 "29 29" 100 0 0 100 cideq - ));
DESCR("equal"); DESCR("equal");
DATA(insert OID = 70 ( charne PGUID 11 f t t t 2 f 16 "18 18" 100 0 0 100 charne - )); DATA(insert OID = 70 ( charne PGUID 12 f t t t 2 f 16 "18 18" 100 0 0 100 charne - ));
DESCR("not equal"); DESCR("not equal");
DATA(insert OID = 1246 ( charlt PGUID 11 f t t t 2 f 16 "18 18" 100 0 0 100 charlt - )); DATA(insert OID = 1246 ( charlt PGUID 12 f t t t 2 f 16 "18 18" 100 0 0 100 charlt - ));
DESCR("less-than"); DESCR("less-than");
DATA(insert OID = 72 ( charle PGUID 11 f t t t 2 f 16 "18 18" 100 0 0 100 charle - )); DATA(insert OID = 72 ( charle PGUID 12 f t t t 2 f 16 "18 18" 100 0 0 100 charle - ));
DESCR("less-than-or-equal"); DESCR("less-than-or-equal");
DATA(insert OID = 73 ( chargt PGUID 11 f t t t 2 f 16 "18 18" 100 0 0 100 chargt - )); DATA(insert OID = 73 ( chargt PGUID 12 f t t t 2 f 16 "18 18" 100 0 0 100 chargt - ));
DESCR("greater-than"); DESCR("greater-than");
DATA(insert OID = 74 ( charge PGUID 11 f t t t 2 f 16 "18 18" 100 0 0 100 charge - )); DATA(insert OID = 74 ( charge PGUID 12 f t t t 2 f 16 "18 18" 100 0 0 100 charge - ));
DESCR("greater-than-or-equal"); DESCR("greater-than-or-equal");
DATA(insert OID = 1248 ( charpl PGUID 11 f t t t 2 f 18 "18 18" 100 0 0 100 charpl - )); DATA(insert OID = 1248 ( charpl PGUID 12 f t t t 2 f 18 "18 18" 100 0 0 100 charpl - ));
DESCR("addition"); DESCR("add");
DATA(insert OID = 1250 ( charmi PGUID 11 f t t t 2 f 18 "18 18" 100 0 0 100 charmi - )); DATA(insert OID = 1250 ( charmi PGUID 12 f t t t 2 f 18 "18 18" 100 0 0 100 charmi - ));
DESCR("subtract"); DESCR("subtract");
DATA(insert OID = 77 ( charmul PGUID 11 f t t t 2 f 18 "18 18" 100 0 0 100 charmul - )); DATA(insert OID = 77 ( charmul PGUID 12 f t t t 2 f 18 "18 18" 100 0 0 100 charmul - ));
DESCR("multiply"); DESCR("multiply");
DATA(insert OID = 78 ( chardiv PGUID 11 f t t t 2 f 18 "18 18" 100 0 0 100 chardiv - )); DATA(insert OID = 78 ( chardiv PGUID 12 f t t t 2 f 18 "18 18" 100 0 0 100 chardiv - ));
DESCR("divide"); DESCR("divide");
DATA(insert OID = 79 ( nameregexeq PGUID 11 f t t t 2 f 16 "19 25" 100 0 0 100 nameregexeq - )); DATA(insert OID = 79 ( nameregexeq PGUID 11 f t t t 2 f 16 "19 25" 100 0 0 100 nameregexeq - ));
@ -205,42 +205,42 @@ DESCR("length");
DATA(insert OID = 1258 ( textcat PGUID 11 f t t t 2 f 25 "25 25" 100 0 1 0 textcat - )); DATA(insert OID = 1258 ( textcat PGUID 11 f t t t 2 f 25 "25 25" 100 0 1 0 textcat - ));
DESCR("concatenate"); DESCR("concatenate");
DATA(insert OID = 84 ( boolne PGUID 11 f t t t 2 f 16 "16 16" 100 0 0 100 boolne - )); DATA(insert OID = 84 ( boolne PGUID 12 f t t t 2 f 16 "16 16" 100 0 0 100 boolne - ));
DESCR("not equal"); DESCR("not equal");
DATA(insert OID = 89 ( version PGUID 11 f t f t 0 f 25 "" 100 0 0 100 version - )); DATA(insert OID = 89 ( version PGUID 11 f t f t 0 f 25 "" 100 0 0 100 version - ));
DESCR("PostgreSQL version string"); DESCR("PostgreSQL version string");
DATA(insert OID = 1265 ( rtcostestimate PGUID 11 f t f t 7 f 0 "0 0 0 0 0 0 0" 100 0 0 100 rtcostestimate - )); DATA(insert OID = 1265 ( rtcostestimate PGUID 12 f t f t 7 f 0 "0 0 0 0 0 0 0" 100 0 0 100 rtcostestimate - ));
DESCR("r-tree cost estimator"); DESCR("r-tree cost estimator");
DATA(insert OID = 1268 ( btcostestimate PGUID 11 f t f t 7 f 0 "0 0 0 0 0 0 0" 100 0 0 100 btcostestimate - )); DATA(insert OID = 1268 ( btcostestimate PGUID 12 f t f t 7 f 0 "0 0 0 0 0 0 0" 100 0 0 100 btcostestimate - ));
DESCR("btree cost estimator"); DESCR("btree cost estimator");
/* OIDS 100 - 199 */ /* OIDS 100 - 199 */
DATA(insert OID = 100 ( int8fac PGUID 11 f t t t 1 f 20 "20" 100 0 0 100 int8fac - )); DATA(insert OID = 100 ( int8fac PGUID 11 f t t t 1 f 20 "20" 100 0 0 100 int8fac - ));
DESCR("factorial"); DESCR("factorial");
DATA(insert OID = 101 ( eqsel PGUID 11 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 eqsel - )); DATA(insert OID = 101 ( eqsel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 eqsel - ));
DESCR("restriction selectivity of = and related operators"); DESCR("restriction selectivity of = and related operators");
DATA(insert OID = 102 ( neqsel PGUID 11 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 neqsel - )); DATA(insert OID = 102 ( neqsel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 neqsel - ));
DESCR("restriction selectivity of <> and related operators"); DESCR("restriction selectivity of <> and related operators");
DATA(insert OID = 103 ( scalarltsel PGUID 11 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 scalarltsel - )); DATA(insert OID = 103 ( scalarltsel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 scalarltsel - ));
DESCR("restriction selectivity of < and related operators on scalar datatypes"); DESCR("restriction selectivity of < and related operators on scalar datatypes");
DATA(insert OID = 104 ( scalargtsel PGUID 11 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 scalargtsel - )); DATA(insert OID = 104 ( scalargtsel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 scalargtsel - ));
DESCR("restriction selectivity of > and related operators on scalar datatypes"); DESCR("restriction selectivity of > and related operators on scalar datatypes");
DATA(insert OID = 105 ( eqjoinsel PGUID 11 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 eqjoinsel - )); DATA(insert OID = 105 ( eqjoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 eqjoinsel - ));
DESCR("join selectivity of = and related operators"); DESCR("join selectivity of = and related operators");
DATA(insert OID = 106 ( neqjoinsel PGUID 11 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 neqjoinsel - )); DATA(insert OID = 106 ( neqjoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 neqjoinsel - ));
DESCR("join selectivity of <> and related operators"); DESCR("join selectivity of <> and related operators");
DATA(insert OID = 107 ( scalarltjoinsel PGUID 11 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 scalarltjoinsel - )); DATA(insert OID = 107 ( scalarltjoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 scalarltjoinsel - ));
DESCR("join selectivity of < and related operators on scalar datatypes"); DESCR("join selectivity of < and related operators on scalar datatypes");
DATA(insert OID = 108 ( scalargtjoinsel PGUID 11 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 scalargtjoinsel - )); DATA(insert OID = 108 ( scalargtjoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 scalargtjoinsel - ));
DESCR("join selectivity of > and related operators on scalar datatypes"); DESCR("join selectivity of > and related operators on scalar datatypes");
DATA(insert OID = 112 ( text PGUID 11 f t t t 1 f 25 "23" 100 0 0 100 int4_text - )); DATA(insert OID = 112 ( text PGUID 12 f t t t 1 f 25 "23" 100 0 0 100 int4_text - ));
DESCR("convert int4 to text"); DESCR("convert int4 to text");
DATA(insert OID = 113 ( text PGUID 11 f t t t 1 f 25 "21" 100 0 0 100 int2_text - )); DATA(insert OID = 113 ( text PGUID 12 f t t t 1 f 25 "21" 100 0 0 100 int2_text - ));
DESCR("convert int2 to text"); DESCR("convert int2 to text");
DATA(insert OID = 114 ( text PGUID 11 f t t t 1 f 25 "26" 100 0 0 100 oid_text - )); DATA(insert OID = 114 ( text PGUID 12 f t t t 1 f 25 "26" 100 0 0 100 oid_text - ));
DESCR("convert oid to text"); DESCR("convert oid to text");
DATA(insert OID = 115 ( box_above PGUID 11 f t t t 2 f 16 "603 603" 100 1 0 100 box_above - )); DATA(insert OID = 115 ( box_above PGUID 11 f t t t 2 f 16 "603 603" 100 1 0 100 box_above - ));
@ -292,99 +292,99 @@ DATA(insert OID = 137 ( on_ppath PGUID 11 f t t t 2 f 16 "600 602" 100 0 1
DESCR("contained in"); DESCR("contained in");
DATA(insert OID = 138 ( box_center PGUID 11 f t t t 1 f 600 "603" 100 1 0 100 box_center - )); DATA(insert OID = 138 ( box_center PGUID 11 f t t t 1 f 600 "603" 100 1 0 100 box_center - ));
DESCR("center of"); DESCR("center of");
DATA(insert OID = 139 ( areasel PGUID 11 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 areasel - )); DATA(insert OID = 139 ( areasel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 areasel - ));
DESCR("restriction selectivity for area-comparison operators"); DESCR("restriction selectivity for area-comparison operators");
DATA(insert OID = 140 ( areajoinsel PGUID 11 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 areajoinsel - )); DATA(insert OID = 140 ( areajoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 areajoinsel - ));
DESCR("join selectivity for area-comparison operators"); DESCR("join selectivity for area-comparison operators");
DATA(insert OID = 141 ( int4mul PGUID 11 f t t t 2 f 23 "23 23" 100 0 0 100 int4mul - )); DATA(insert OID = 141 ( int4mul PGUID 12 f t t t 2 f 23 "23 23" 100 0 0 100 int4mul - ));
DESCR("multiply"); DESCR("multiply");
DATA(insert OID = 142 ( int4fac PGUID 11 f t t t 1 f 23 "23" 100 0 0 100 int4fac - )); DATA(insert OID = 142 ( int4fac PGUID 12 f t t t 1 f 23 "23" 100 0 0 100 int4fac - ));
DESCR("factorial"); DESCR("factorial");
DATA(insert OID = 143 ( pointdist PGUID 11 f t t t 2 f 23 "600 600" 100 0 0 100 pointdist - )); DATA(insert OID = 143 ( pointdist PGUID 11 f t t t 2 f 23 "600 600" 100 0 0 100 pointdist - ));
DESCR(""); DESCR("");
DATA(insert OID = 144 ( int4ne PGUID 11 f t t t 2 f 16 "23 23" 100 0 0 100 int4ne - )); DATA(insert OID = 144 ( int4ne PGUID 12 f t t t 2 f 16 "23 23" 100 0 0 100 int4ne - ));
DESCR("not equal"); DESCR("not equal");
DATA(insert OID = 145 ( int2ne PGUID 11 f t t t 2 f 16 "21 21" 100 0 0 100 int2ne - )); DATA(insert OID = 145 ( int2ne PGUID 12 f t t t 2 f 16 "21 21" 100 0 0 100 int2ne - ));
DESCR("not equal"); DESCR("not equal");
DATA(insert OID = 146 ( int2gt PGUID 11 f t t t 2 f 16 "21 21" 100 0 0 100 int2gt - )); DATA(insert OID = 146 ( int2gt PGUID 12 f t t t 2 f 16 "21 21" 100 0 0 100 int2gt - ));
DESCR("greater-than"); DESCR("greater-than");
DATA(insert OID = 147 ( int4gt PGUID 11 f t t t 2 f 16 "23 23" 100 0 0 100 int4gt - )); DATA(insert OID = 147 ( int4gt PGUID 12 f t t t 2 f 16 "23 23" 100 0 0 100 int4gt - ));
DESCR("greater-than"); DESCR("greater-than");
DATA(insert OID = 148 ( int2le PGUID 11 f t t t 2 f 16 "21 21" 100 0 0 100 int2le - )); DATA(insert OID = 148 ( int2le PGUID 12 f t t t 2 f 16 "21 21" 100 0 0 100 int2le - ));
DESCR("less-than-or-equal"); DESCR("less-than-or-equal");
DATA(insert OID = 149 ( int4le PGUID 11 f t t t 2 f 16 "23 23" 100 0 0 100 int4le - )); DATA(insert OID = 149 ( int4le PGUID 12 f t t t 2 f 16 "23 23" 100 0 0 100 int4le - ));
DESCR("less-than-or-equal"); DESCR("less-than-or-equal");
DATA(insert OID = 150 ( int4ge PGUID 11 f t t t 2 f 16 "23 23" 100 0 0 100 int4ge - )); DATA(insert OID = 150 ( int4ge PGUID 12 f t t t 2 f 16 "23 23" 100 0 0 100 int4ge - ));
DESCR("greater-than-or-equal"); DESCR("greater-than-or-equal");
DATA(insert OID = 151 ( int2ge PGUID 11 f t t t 2 f 16 "21 21" 100 0 0 100 int2ge - )); DATA(insert OID = 151 ( int2ge PGUID 12 f t t t 2 f 16 "21 21" 100 0 0 100 int2ge - ));
DESCR("greater-than-or-equal"); DESCR("greater-than-or-equal");
DATA(insert OID = 152 ( int2mul PGUID 11 f t t t 2 f 21 "21 21" 100 0 0 100 int2mul - )); DATA(insert OID = 152 ( int2mul PGUID 12 f t t t 2 f 21 "21 21" 100 0 0 100 int2mul - ));
DESCR("multiply"); DESCR("multiply");
DATA(insert OID = 153 ( int2div PGUID 11 f t t t 2 f 21 "21 21" 100 0 0 100 int2div - )); DATA(insert OID = 153 ( int2div PGUID 12 f t t t 2 f 21 "21 21" 100 0 0 100 int2div - ));
DESCR("divide"); DESCR("divide");
DATA(insert OID = 154 ( int4div PGUID 11 f t t t 2 f 23 "23 23" 100 0 0 100 int4div - )); DATA(insert OID = 154 ( int4div PGUID 12 f t t t 2 f 23 "23 23" 100 0 0 100 int4div - ));
DESCR("divide"); DESCR("divide");
DATA(insert OID = 155 ( int2mod PGUID 11 f t t t 2 f 21 "21 21" 100 0 0 100 int2mod - )); DATA(insert OID = 155 ( int2mod PGUID 12 f t t t 2 f 21 "21 21" 100 0 0 100 int2mod - ));
DESCR("modulus"); DESCR("modulus");
DATA(insert OID = 156 ( int4mod PGUID 11 f t t t 2 f 23 "23 23" 100 0 0 100 int4mod - )); DATA(insert OID = 156 ( int4mod PGUID 12 f t t t 2 f 23 "23 23" 100 0 0 100 int4mod - ));
DESCR("modulus"); DESCR("modulus");
DATA(insert OID = 157 ( textne PGUID 11 f t t t 2 f 16 "25 25" 100 0 0 0 textne - )); DATA(insert OID = 157 ( textne PGUID 11 f t t t 2 f 16 "25 25" 100 0 0 0 textne - ));
DESCR("not equal"); DESCR("not equal");
DATA(insert OID = 158 ( int24eq PGUID 11 f t t t 2 f 16 "21 23" 100 0 0 100 int24eq - )); DATA(insert OID = 158 ( int24eq PGUID 12 f t t t 2 f 16 "21 23" 100 0 0 100 int24eq - ));
DESCR("equal"); DESCR("equal");
DATA(insert OID = 159 ( int42eq PGUID 11 f t t t 2 f 16 "23 21" 100 0 0 100 int42eq - )); DATA(insert OID = 159 ( int42eq PGUID 12 f t t t 2 f 16 "23 21" 100 0 0 100 int42eq - ));
DESCR("equal"); DESCR("equal");
DATA(insert OID = 160 ( int24lt PGUID 11 f t t t 2 f 16 "21 23" 100 0 0 100 int24lt - )); DATA(insert OID = 160 ( int24lt PGUID 12 f t t t 2 f 16 "21 23" 100 0 0 100 int24lt - ));
DESCR("less-than"); DESCR("less-than");
DATA(insert OID = 161 ( int42lt PGUID 11 f t t t 2 f 16 "23 21" 100 0 0 100 int42lt - )); DATA(insert OID = 161 ( int42lt PGUID 12 f t t t 2 f 16 "23 21" 100 0 0 100 int42lt - ));
DESCR("less-than"); DESCR("less-than");
DATA(insert OID = 162 ( int24gt PGUID 11 f t t t 2 f 16 "21 23" 100 0 0 100 int24gt - )); DATA(insert OID = 162 ( int24gt PGUID 12 f t t t 2 f 16 "21 23" 100 0 0 100 int24gt - ));
DESCR("greater-than"); DESCR("greater-than");
DATA(insert OID = 163 ( int42gt PGUID 11 f t t t 2 f 16 "23 21" 100 0 0 100 int42gt - )); DATA(insert OID = 163 ( int42gt PGUID 12 f t t t 2 f 16 "23 21" 100 0 0 100 int42gt - ));
DESCR("greater-than"); DESCR("greater-than");
DATA(insert OID = 164 ( int24ne PGUID 11 f t t t 2 f 16 "21 23" 100 0 0 100 int24ne - )); DATA(insert OID = 164 ( int24ne PGUID 12 f t t t 2 f 16 "21 23" 100 0 0 100 int24ne - ));
DESCR("not equal"); DESCR("not equal");
DATA(insert OID = 165 ( int42ne PGUID 11 f t t t 2 f 16 "23 21" 100 0 0 100 int42ne - )); DATA(insert OID = 165 ( int42ne PGUID 12 f t t t 2 f 16 "23 21" 100 0 0 100 int42ne - ));
DESCR("not equal"); DESCR("not equal");
DATA(insert OID = 166 ( int24le PGUID 11 f t t t 2 f 16 "21 23" 100 0 0 100 int24le - )); DATA(insert OID = 166 ( int24le PGUID 12 f t t t 2 f 16 "21 23" 100 0 0 100 int24le - ));
DESCR("less-than-or-equal"); DESCR("less-than-or-equal");
DATA(insert OID = 167 ( int42le PGUID 11 f t t t 2 f 16 "23 21" 100 0 0 100 int42le - )); DATA(insert OID = 167 ( int42le PGUID 12 f t t t 2 f 16 "23 21" 100 0 0 100 int42le - ));
DESCR("less-than-or-equal"); DESCR("less-than-or-equal");
DATA(insert OID = 168 ( int24ge PGUID 11 f t t t 2 f 16 "21 23" 100 0 0 100 int24ge - )); DATA(insert OID = 168 ( int24ge PGUID 12 f t t t 2 f 16 "21 23" 100 0 0 100 int24ge - ));
DESCR("greater-than-or-equal"); DESCR("greater-than-or-equal");
DATA(insert OID = 169 ( int42ge PGUID 11 f t t t 2 f 16 "23 21" 100 0 0 100 int42ge - )); DATA(insert OID = 169 ( int42ge PGUID 12 f t t t 2 f 16 "23 21" 100 0 0 100 int42ge - ));
DESCR("greater-than-or-equal"); DESCR("greater-than-or-equal");
DATA(insert OID = 170 ( int24mul PGUID 11 f t t t 2 f 23 "21 23" 100 0 0 100 int24mul - )); DATA(insert OID = 170 ( int24mul PGUID 12 f t t t 2 f 23 "21 23" 100 0 0 100 int24mul - ));
DESCR("multiply"); DESCR("multiply");
DATA(insert OID = 171 ( int42mul PGUID 11 f t t t 2 f 23 "23 21" 100 0 0 100 int42mul - )); DATA(insert OID = 171 ( int42mul PGUID 12 f t t t 2 f 23 "23 21" 100 0 0 100 int42mul - ));
DESCR("multiply"); DESCR("multiply");
DATA(insert OID = 172 ( int24div PGUID 11 f t t t 2 f 23 "21 23" 100 0 0 100 int24div - )); DATA(insert OID = 172 ( int24div PGUID 12 f t t t 2 f 23 "21 23" 100 0 0 100 int24div - ));
DESCR("divide"); DESCR("divide");
DATA(insert OID = 173 ( int42div PGUID 11 f t t t 2 f 23 "23 21" 100 0 0 100 int42div - )); DATA(insert OID = 173 ( int42div PGUID 12 f t t t 2 f 23 "23 21" 100 0 0 100 int42div - ));
DESCR("divide"); DESCR("divide");
DATA(insert OID = 174 ( int24mod PGUID 11 f t t t 2 f 23 "21 23" 100 0 0 100 int24mod - )); DATA(insert OID = 174 ( int24mod PGUID 12 f t t t 2 f 23 "21 23" 100 0 0 100 int24mod - ));
DESCR("modulus"); DESCR("modulus");
DATA(insert OID = 175 ( int42mod PGUID 11 f t t t 2 f 23 "23 21" 100 0 0 100 int42mod - )); DATA(insert OID = 175 ( int42mod PGUID 12 f t t t 2 f 23 "23 21" 100 0 0 100 int42mod - ));
DESCR("modulus"); DESCR("modulus");
DATA(insert OID = 176 ( int2pl PGUID 11 f t t t 2 f 21 "21 21" 100 0 0 100 int2pl - )); DATA(insert OID = 176 ( int2pl PGUID 12 f t t t 2 f 21 "21 21" 100 0 0 100 int2pl - ));
DESCR("addition"); DESCR("addition");
DATA(insert OID = 177 ( int4pl PGUID 11 f t t t 2 f 23 "23 23" 100 0 0 100 int4pl - )); DATA(insert OID = 177 ( int4pl PGUID 12 f t t t 2 f 23 "23 23" 100 0 0 100 int4pl - ));
DESCR("addition"); DESCR("addition");
DATA(insert OID = 178 ( int24pl PGUID 11 f t t t 2 f 23 "21 23" 100 0 0 100 int24pl - )); DATA(insert OID = 178 ( int24pl PGUID 12 f t t t 2 f 23 "21 23" 100 0 0 100 int24pl - ));
DESCR("addition"); DESCR("addition");
DATA(insert OID = 179 ( int42pl PGUID 11 f t t t 2 f 23 "23 21" 100 0 0 100 int42pl - )); DATA(insert OID = 179 ( int42pl PGUID 12 f t t t 2 f 23 "23 21" 100 0 0 100 int42pl - ));
DESCR("addition"); DESCR("addition");
DATA(insert OID = 180 ( int2mi PGUID 11 f t t t 2 f 21 "21 21" 100 0 0 100 int2mi - )); DATA(insert OID = 180 ( int2mi PGUID 12 f t t t 2 f 21 "21 21" 100 0 0 100 int2mi - ));
DESCR("subtract"); DESCR("subtract");
DATA(insert OID = 181 ( int4mi PGUID 11 f t t t 2 f 23 "23 23" 100 0 0 100 int4mi - )); DATA(insert OID = 181 ( int4mi PGUID 12 f t t t 2 f 23 "23 23" 100 0 0 100 int4mi - ));
DESCR("subtract"); DESCR("subtract");
DATA(insert OID = 182 ( int24mi PGUID 11 f t t t 2 f 23 "21 23" 100 0 0 100 int24mi - )); DATA(insert OID = 182 ( int24mi PGUID 12 f t t t 2 f 23 "21 23" 100 0 0 100 int24mi - ));
DESCR("subtract"); DESCR("subtract");
DATA(insert OID = 183 ( int42mi PGUID 11 f t t t 2 f 23 "23 21" 100 0 0 100 int42mi - )); DATA(insert OID = 183 ( int42mi PGUID 12 f t t t 2 f 23 "23 21" 100 0 0 100 int42mi - ));
DESCR("subtract"); DESCR("subtract");
DATA(insert OID = 184 ( oideq PGUID 11 f t t t 2 f 16 "26 26" 100 0 0 100 oideq - )); DATA(insert OID = 184 ( oideq PGUID 12 f t t t 2 f 16 "26 26" 100 0 0 100 oideq - ));
DESCR("equal"); DESCR("equal");
DATA(insert OID = 185 ( oidne PGUID 11 f t t t 2 f 16 "26 26" 100 0 0 100 oidne - )); DATA(insert OID = 185 ( oidne PGUID 12 f t t t 2 f 16 "26 26" 100 0 0 100 oidne - ));
DESCR("not equal"); DESCR("not equal");
DATA(insert OID = 186 ( box_same PGUID 11 f t t t 2 f 16 "603 603" 100 0 0 100 box_same - )); DATA(insert OID = 186 ( box_same PGUID 11 f t t t 2 f 16 "603 603" 100 0 0 100 box_same - ));
DESCR("same as"); DESCR("same as");
@ -440,9 +440,9 @@ DESCR("larger of two");
DATA(insert OID = 211 ( float4smaller PGUID 11 f t t t 2 f 700 "700 700" 100 0 0 100 float4smaller - )); DATA(insert OID = 211 ( float4smaller PGUID 11 f t t t 2 f 700 "700 700" 100 0 0 100 float4smaller - ));
DESCR("smaller of two"); DESCR("smaller of two");
DATA(insert OID = 212 ( int4um PGUID 11 f t t t 1 f 23 "23" 100 0 0 100 int4um - )); DATA(insert OID = 212 ( int4um PGUID 12 f t t t 1 f 23 "23" 100 0 0 100 int4um - ));
DESCR("negate"); DESCR("negate");
DATA(insert OID = 213 ( int2um PGUID 11 f t t t 1 f 21 "21" 100 0 0 100 int2um - )); DATA(insert OID = 213 ( int2um PGUID 12 f t t t 1 f 21 "21" 100 0 0 100 int2um - ));
DESCR("negate"); DESCR("negate");
DATA(insert OID = 214 ( float8in PGUID 11 f t t t 1 f 701 "0" 100 0 0 100 float8in - )); DATA(insert OID = 214 ( float8in PGUID 11 f t t t 1 f 701 "0" 100 0 0 100 float8in - ));
@ -489,13 +489,13 @@ DATA(insert OID = 233 ( dexp PGUID 11 f t t t 1 f 701 "701" 100 0 0 100 d
DESCR("natural exponential (e^x)"); DESCR("natural exponential (e^x)");
DATA(insert OID = 234 ( dlog1 PGUID 11 f t t t 1 f 701 "701" 100 0 0 100 dlog1 - )); DATA(insert OID = 234 ( dlog1 PGUID 11 f t t t 1 f 701 "701" 100 0 0 100 dlog1 - ));
DESCR("natural logarithm"); DESCR("natural logarithm");
DATA(insert OID = 235 ( float8 PGUID 11 f t t t 1 f 701 "21" 100 0 0 100 i2tod - )); DATA(insert OID = 235 ( float8 PGUID 12 f t t t 1 f 701 "21" 100 0 0 100 i2tod - ));
DESCR("convert int2 to float8"); DESCR("convert int2 to float8");
DATA(insert OID = 236 ( float4 PGUID 11 f t t t 1 f 700 "21" 100 0 0 100 i2tof - )); DATA(insert OID = 236 ( float4 PGUID 12 f t t t 1 f 700 "21" 100 0 0 100 i2tof - ));
DESCR("convert int2 to float4"); DESCR("convert int2 to float4");
DATA(insert OID = 237 ( int2 PGUID 11 f t t t 1 f 21 "701" 100 0 0 100 dtoi2 - )); DATA(insert OID = 237 ( int2 PGUID 12 f t t t 1 f 21 "701" 100 0 0 100 dtoi2 - ));
DESCR("convert float8 to int2"); DESCR("convert float8 to int2");
DATA(insert OID = 238 ( int2 PGUID 11 f t t t 1 f 21 "700" 100 0 0 100 ftoi2 - )); DATA(insert OID = 238 ( int2 PGUID 12 f t t t 1 f 21 "700" 100 0 0 100 ftoi2 - ));
DESCR("convert float4 to int2"); DESCR("convert float4 to int2");
DATA(insert OID = 239 ( line_distance PGUID 11 f t t t 2 f 701 "628 628" 100 0 0 100 line_distance - )); DATA(insert OID = 239 ( line_distance PGUID 11 f t t t 2 f 701 "628 628" 100 0 0 100 line_distance - ));
DESCR("distance between"); DESCR("distance between");
@ -573,7 +573,7 @@ DESCR("Current date and time with microseconds");
DATA(insert OID = 275 ( isfinite PGUID 11 f t f t 1 f 16 "702" 100 0 0 100 abstime_finite - )); DATA(insert OID = 275 ( isfinite PGUID 11 f t f t 1 f 16 "702" 100 0 0 100 abstime_finite - ));
DESCR(""); DESCR("");
DATA(insert OID = 276 ( int2fac PGUID 11 f t t t 1 f 23 "21" 100 0 0 100 int2fac - )); DATA(insert OID = 276 ( int2fac PGUID 12 f t t t 1 f 23 "21" 100 0 0 100 int2fac - ));
DESCR(""); DESCR("");
DATA(insert OID = 277 ( inter_sl PGUID 11 f t t t 2 f 16 "601 628" 100 0 0 100 inter_sl - )); DATA(insert OID = 277 ( inter_sl PGUID 11 f t t t 2 f 16 "601 628" 100 0 0 100 inter_sl - ));
@ -656,11 +656,11 @@ DATA(insert OID = 311 ( float8 PGUID 11 f t t t 1 f 701 "700" 100 0 0 100
DESCR("convert float4 to float8"); DESCR("convert float4 to float8");
DATA(insert OID = 312 ( float4 PGUID 11 f t t t 1 f 700 "701" 100 0 0 100 dtof - )); DATA(insert OID = 312 ( float4 PGUID 11 f t t t 1 f 700 "701" 100 0 0 100 dtof - ));
DESCR("convert float8 to float4"); DESCR("convert float8 to float4");
DATA(insert OID = 313 ( int4 PGUID 11 f t t t 1 f 23 "21" 100 0 0 100 i2toi4 - )); DATA(insert OID = 313 ( int4 PGUID 12 f t t t 1 f 23 "21" 100 0 0 100 i2toi4 - ));
DESCR("convert int2 to int4"); DESCR("convert int2 to int4");
DATA(insert OID = 314 ( int2 PGUID 11 f t t t 1 f 21 "23" 100 0 0 100 i4toi2 - )); DATA(insert OID = 314 ( int2 PGUID 12 f t t t 1 f 21 "23" 100 0 0 100 i4toi2 - ));
DESCR("convert int4 to int2"); DESCR("convert int4 to int2");
DATA(insert OID = 315 ( int2vectoreq PGUID 11 f t t t 2 f 16 "22 22" 100 0 0 100 int2vectoreq - )); DATA(insert OID = 315 ( int2vectoreq PGUID 12 f t t t 2 f 16 "22 22" 100 0 0 100 int2vectoreq - ));
DESCR("equal"); DESCR("equal");
DATA(insert OID = 316 ( float8 PGUID 11 f t t t 1 f 701 "23" 100 0 0 100 i4tod - )); DATA(insert OID = 316 ( float8 PGUID 11 f t t t 1 f 701 "23" 100 0 0 100 i4tod - ));
DESCR("convert int4 to float8"); DESCR("convert int4 to float8");
@ -730,31 +730,31 @@ DESCR("(internal)");
DATA(insert OID = 348 ( poly_out PGUID 11 f t t t 1 f 23 "0" 100 0 1 0 poly_out - )); DATA(insert OID = 348 ( poly_out PGUID 11 f t t t 1 f 23 "0" 100 0 1 0 poly_out - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 350 ( btint2cmp PGUID 11 f t t t 2 f 23 "21 21" 100 0 0 100 btint2cmp - )); DATA(insert OID = 350 ( btint2cmp PGUID 12 f t t t 2 f 23 "21 21" 100 0 0 100 btint2cmp - ));
DESCR("btree less-equal-greater"); DESCR("btree less-equal-greater");
DATA(insert OID = 351 ( btint4cmp PGUID 11 f t t t 2 f 23 "23 23" 100 0 0 100 btint4cmp - )); DATA(insert OID = 351 ( btint4cmp PGUID 12 f t t t 2 f 23 "23 23" 100 0 0 100 btint4cmp - ));
DESCR("btree less-equal-greater"); DESCR("btree less-equal-greater");
DATA(insert OID = 842 ( btint8cmp PGUID 11 f t t t 2 f 23 "20 20" 100 0 0 100 btint8cmp - )); DATA(insert OID = 842 ( btint8cmp PGUID 12 f t t t 2 f 23 "20 20" 100 0 0 100 btint8cmp - ));
DESCR("btree less-equal-greater"); DESCR("btree less-equal-greater");
DATA(insert OID = 352 ( btint42cmp PGUID 11 f t t t 2 f 23 "23 21" 100 0 0 100 btint42cmp - )); DATA(insert OID = 352 ( btint42cmp PGUID 12 f t t t 2 f 23 "23 21" 100 0 0 100 btint42cmp - ));
DESCR("btree less-equal-greater"); DESCR("btree less-equal-greater");
DATA(insert OID = 353 ( btint24cmp PGUID 11 f t t t 2 f 23 "21 23" 100 0 0 100 btint24cmp - )); DATA(insert OID = 353 ( btint24cmp PGUID 12 f t t t 2 f 23 "21 23" 100 0 0 100 btint24cmp - ));
DESCR("btree less-equal-greater"); DESCR("btree less-equal-greater");
DATA(insert OID = 354 ( btfloat4cmp PGUID 11 f t t t 2 f 23 "700 700" 100 0 0 100 btfloat4cmp - )); DATA(insert OID = 354 ( btfloat4cmp PGUID 12 f t t t 2 f 23 "700 700" 100 0 0 100 btfloat4cmp - ));
DESCR("btree less-equal-greater"); DESCR("btree less-equal-greater");
DATA(insert OID = 355 ( btfloat8cmp PGUID 11 f t t t 2 f 23 "701 701" 100 0 0 100 btfloat8cmp - )); DATA(insert OID = 355 ( btfloat8cmp PGUID 12 f t t t 2 f 23 "701 701" 100 0 0 100 btfloat8cmp - ));
DESCR("btree less-equal-greater"); DESCR("btree less-equal-greater");
DATA(insert OID = 356 ( btoidcmp PGUID 11 f t t t 2 f 23 "26 26" 100 0 0 100 btoidcmp - )); DATA(insert OID = 356 ( btoidcmp PGUID 12 f t t t 2 f 23 "26 26" 100 0 0 100 btoidcmp - ));
DESCR("btree less-equal-greater"); DESCR("btree less-equal-greater");
DATA(insert OID = 404 ( btoidvectorcmp PGUID 11 f t t t 2 f 23 "30 30" 100 0 0 100 btoidvectorcmp - )); DATA(insert OID = 404 ( btoidvectorcmp PGUID 12 f t t t 2 f 23 "30 30" 100 0 0 100 btoidvectorcmp - ));
DESCR("btree less-equal-greater"); DESCR("btree less-equal-greater");
DATA(insert OID = 357 ( btabstimecmp PGUID 11 f t f t 2 f 23 "702 702" 100 0 0 100 btabstimecmp - )); DATA(insert OID = 357 ( btabstimecmp PGUID 11 f t f t 2 f 23 "702 702" 100 0 0 100 btabstimecmp - ));
DESCR("btree less-equal-greater"); DESCR("btree less-equal-greater");
DATA(insert OID = 358 ( btcharcmp PGUID 11 f t t t 2 f 23 "18 18" 100 0 0 100 btcharcmp - )); DATA(insert OID = 358 ( btcharcmp PGUID 12 f t t t 2 f 23 "18 18" 100 0 0 100 btcharcmp - ));
DESCR("btree less-equal-greater"); DESCR("btree less-equal-greater");
DATA(insert OID = 359 ( btnamecmp PGUID 11 f t t t 2 f 23 "19 19" 100 0 0 100 btnamecmp - )); DATA(insert OID = 359 ( btnamecmp PGUID 12 f t t t 2 f 23 "19 19" 100 0 0 100 btnamecmp - ));
DESCR("btree less-equal-greater"); DESCR("btree less-equal-greater");
DATA(insert OID = 360 ( bttextcmp PGUID 11 f t t t 2 f 23 "25 25" 100 0 0 100 bttextcmp - )); DATA(insert OID = 360 ( bttextcmp PGUID 12 f t t t 2 f 23 "25 25" 100 0 0 100 bttextcmp - ));
DESCR("btree less-equal-greater"); DESCR("btree less-equal-greater");
DATA(insert OID = 361 ( lseg_distance PGUID 11 f t t t 2 f 701 "601 601" 100 0 0 100 lseg_distance - )); DATA(insert OID = 361 ( lseg_distance PGUID 11 f t t t 2 f 701 "601 601" 100 0 0 100 lseg_distance - ));
@ -795,7 +795,7 @@ DESCR("convert name to char()");
DATA(insert OID = 409 ( name PGUID 11 f t t t 1 f 19 "1042" 100 0 0 100 bpchar_name - )); DATA(insert OID = 409 ( name PGUID 11 f t t t 1 f 19 "1042" 100 0 0 100 bpchar_name - ));
DESCR("convert char() to name"); DESCR("convert char() to name");
DATA(insert OID = 438 ( hashcostestimate PGUID 11 f t f t 7 f 0 "0 0 0 0 0 0 0" 100 0 0 100 hashcostestimate - )); DATA(insert OID = 438 ( hashcostestimate PGUID 12 f t f t 7 f 0 "0 0 0 0 0 0 0" 100 0 0 100 hashcostestimate - ));
DESCR("hash index cost estimator"); DESCR("hash index cost estimator");
DATA(insert OID = 440 ( hashgettuple PGUID 11 f t f t 2 f 23 "0" 100 0 0 100 hashgettuple - )); DATA(insert OID = 440 ( hashgettuple PGUID 11 f t f t 2 f 23 "0" 100 0 0 100 hashgettuple - ));
@ -816,25 +816,25 @@ DATA(insert OID = 447 ( hashrestrpos PGUID 11 f t f t 1 f 23 "0" 100 0 0 100
DESCR("hash(internal)"); DESCR("hash(internal)");
DATA(insert OID = 448 ( hashbuild PGUID 11 f t f t 9 f 23 "0" 100 0 0 100 hashbuild - )); DATA(insert OID = 448 ( hashbuild PGUID 11 f t f t 9 f 23 "0" 100 0 0 100 hashbuild - ));
DESCR("hash(internal)"); DESCR("hash(internal)");
DATA(insert OID = 449 ( hashint2 PGUID 11 f t t t 1 f 23 "21" 100 0 0 100 hashint2 - )); DATA(insert OID = 449 ( hashint2 PGUID 12 f t t t 1 f 23 "21" 100 0 0 100 hashint2 - ));
DESCR("hash"); DESCR("hash");
DATA(insert OID = 450 ( hashint4 PGUID 11 f t t t 1 f 23 "23" 100 0 0 100 hashint4 - )); DATA(insert OID = 450 ( hashint4 PGUID 12 f t t t 1 f 23 "23" 100 0 0 100 hashint4 - ));
DESCR("hash"); DESCR("hash");
DATA(insert OID = 949 ( hashint8 PGUID 11 f t t t 1 f 23 "20" 100 0 0 100 hashint8 - )); DATA(insert OID = 949 ( hashint8 PGUID 12 f t t t 1 f 23 "20" 100 0 0 100 hashint8 - ));
DESCR("hash"); DESCR("hash");
DATA(insert OID = 451 ( hashfloat4 PGUID 11 f t t t 1 f 23 "700" 100 0 0 100 hashfloat4 - )); DATA(insert OID = 451 ( hashfloat4 PGUID 12 f t t t 1 f 23 "700" 100 0 0 100 hashfloat4 - ));
DESCR("hash"); DESCR("hash");
DATA(insert OID = 452 ( hashfloat8 PGUID 11 f t t t 1 f 23 "701" 100 0 0 100 hashfloat8 - )); DATA(insert OID = 452 ( hashfloat8 PGUID 12 f t t t 1 f 23 "701" 100 0 0 100 hashfloat8 - ));
DESCR("hash"); DESCR("hash");
DATA(insert OID = 453 ( hashoid PGUID 11 f t t t 1 f 23 "26" 100 0 0 100 hashoid - )); DATA(insert OID = 453 ( hashoid PGUID 12 f t t t 1 f 23 "26" 100 0 0 100 hashoid - ));
DESCR("hash"); DESCR("hash");
DATA(insert OID = 454 ( hashchar PGUID 11 f t t t 1 f 23 "18" 100 0 0 100 hashchar - )); DATA(insert OID = 454 ( hashchar PGUID 12 f t t t 1 f 23 "18" 100 0 0 100 hashchar - ));
DESCR("hash"); DESCR("hash");
DATA(insert OID = 455 ( hashname PGUID 11 f t t t 1 f 23 "19" 100 0 0 100 hashname - )); DATA(insert OID = 455 ( hashname PGUID 12 f t t t 1 f 23 "19" 100 0 0 100 hashname - ));
DESCR("hash"); DESCR("hash");
DATA(insert OID = 456 ( hashtext PGUID 11 f t t t 1 f 23 "25" 100 0 0 100 hashtext - )); DATA(insert OID = 456 ( hashtext PGUID 12 f t t t 1 f 23 "25" 100 0 0 100 hashtext - ));
DESCR("hash"); DESCR("hash");
DATA(insert OID = 457 ( hashoidvector PGUID 11 f t t t 1 f 23 "30" 100 0 0 100 hashoidvector - )); DATA(insert OID = 457 ( hashoidvector PGUID 12 f t t t 1 f 23 "30" 100 0 0 100 hashoidvector - ));
DESCR("hash"); DESCR("hash");
DATA(insert OID = 458 ( text_larger PGUID 11 f t t t 2 f 25 "25 25" 100 0 0 100 text_larger - )); DATA(insert OID = 458 ( text_larger PGUID 11 f t t t 2 f 25 "25 25" 100 0 0 100 text_larger - ));
DESCR("larger of two"); DESCR("larger of two");
@ -898,9 +898,9 @@ DATA(insert OID = 1285 ( int4notin PGUID 11 f t f t 2 f 16 "23 0" 100 0 0 1
DESCR("not in"); DESCR("not in");
DATA(insert OID = 1286 ( oidnotin PGUID 11 f t f t 2 f 16 "26 0" 100 0 0 100 oidnotin - )); DATA(insert OID = 1286 ( oidnotin PGUID 11 f t f t 2 f 16 "26 0" 100 0 0 100 oidnotin - ));
DESCR("not in"); DESCR("not in");
DATA(insert OID = 1287 ( int44in PGUID 11 f t t t 1 f 22 "0" 100 0 0 100 int44in - )); DATA(insert OID = 1287 ( int44in PGUID 12 f t t t 1 f 22 "0" 100 0 0 100 int44in - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 653 ( int44out PGUID 11 f t t t 1 f 23 "0" 100 0 0 100 int44out - )); DATA(insert OID = 653 ( int44out PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 int44out - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 655 ( namelt PGUID 11 f t t t 2 f 16 "19 19" 100 0 0 100 namelt - )); DATA(insert OID = 655 ( namelt PGUID 11 f t t t 2 f 16 "19 19" 100 0 0 100 namelt - ));
DESCR("less-than"); DESCR("less-than");
@ -920,31 +920,31 @@ DESCR("truncate varchar()");
DATA(insert OID = 676 ( mktinterval PGUID 11 f t f t 2 f 704 "702 702" 100 0 0 100 mktinterval - )); DATA(insert OID = 676 ( mktinterval PGUID 11 f t f t 2 f 704 "702 702" 100 0 0 100 mktinterval - ));
DESCR("convert to tinterval"); DESCR("convert to tinterval");
DATA(insert OID = 619 ( oidvectorne PGUID 11 f t t t 2 f 16 "30 30" 100 0 0 100 oidvectorne - )); DATA(insert OID = 619 ( oidvectorne PGUID 12 f t t t 2 f 16 "30 30" 100 0 0 100 oidvectorne - ));
DESCR("less-than"); DESCR("less-than");
DATA(insert OID = 677 ( oidvectorlt PGUID 11 f t t t 2 f 16 "30 30" 100 0 0 100 oidvectorlt - )); DATA(insert OID = 677 ( oidvectorlt PGUID 12 f t t t 2 f 16 "30 30" 100 0 0 100 oidvectorlt - ));
DESCR("less-than"); DESCR("less-than");
DATA(insert OID = 678 ( oidvectorle PGUID 11 f t t t 2 f 16 "30 30" 100 0 0 100 oidvectorle - )); DATA(insert OID = 678 ( oidvectorle PGUID 12 f t t t 2 f 16 "30 30" 100 0 0 100 oidvectorle - ));
DESCR("less-than-or-equal"); DESCR("less-than-or-equal");
DATA(insert OID = 679 ( oidvectoreq PGUID 11 f t t t 2 f 16 "30 30" 100 0 0 100 oidvectoreq - )); DATA(insert OID = 679 ( oidvectoreq PGUID 12 f t t t 2 f 16 "30 30" 100 0 0 100 oidvectoreq - ));
DESCR("equal"); DESCR("equal");
DATA(insert OID = 680 ( oidvectorge PGUID 11 f t t t 2 f 16 "30 30" 100 0 0 100 oidvectorge - )); DATA(insert OID = 680 ( oidvectorge PGUID 12 f t t t 2 f 16 "30 30" 100 0 0 100 oidvectorge - ));
DESCR("greater-than-or-equal"); DESCR("greater-than-or-equal");
DATA(insert OID = 681 ( oidvectorgt PGUID 11 f t t t 2 f 16 "30 30" 100 0 0 100 oidvectorgt - )); DATA(insert OID = 681 ( oidvectorgt PGUID 12 f t t t 2 f 16 "30 30" 100 0 0 100 oidvectorgt - ));
DESCR("greater-than"); DESCR("greater-than");
/* OIDS 700 - 799 */ /* OIDS 700 - 799 */
DATA(insert OID = 710 ( getpgusername PGUID 11 f t f t 0 f 19 "0" 100 0 0 100 getpgusername - )); DATA(insert OID = 710 ( getpgusername PGUID 11 f t f t 0 f 19 "0" 100 0 0 100 getpgusername - ));
DESCR("Return username"); DESCR("Return username");
DATA(insert OID = 711 ( userfntest PGUID 11 f t t t 1 f 23 "23" 100 0 0 100 userfntest - )); DATA(insert OID = 711 ( userfntest PGUID 12 f t t t 1 f 23 "23" 100 0 0 100 userfntest - ));
DESCR(""); DESCR("");
DATA(insert OID = 713 ( oidrand PGUID 11 f t f t 2 f 16 "26 23" 100 0 0 100 oidrand - )); DATA(insert OID = 713 ( oidrand PGUID 12 f t f t 2 f 16 "26 23" 100 0 0 100 oidrand - ));
DESCR("random"); DESCR("random");
DATA(insert OID = 715 ( oidsrand PGUID 11 f t f t 1 f 16 "23" 100 0 0 100 oidsrand - )); DATA(insert OID = 715 ( oidsrand PGUID 12 f t f t 1 f 16 "23" 100 0 0 100 oidsrand - ));
DESCR("seed random number generator"); DESCR("seed random number generator");
DATA(insert OID = 716 ( oideqint4 PGUID 11 f t t t 2 f 16 "26 23" 100 0 0 100 oideqint4 - )); DATA(insert OID = 716 ( oideqint4 PGUID 12 f t t t 2 f 16 "26 23" 100 0 0 100 oideqint4 - ));
DESCR("equal"); DESCR("equal");
DATA(insert OID = 717 ( int4eqoid PGUID 11 f t t t 2 f 16 "23 26" 100 0 0 100 int4eqoid - )); DATA(insert OID = 717 ( int4eqoid PGUID 12 f t t t 2 f 16 "23 26" 100 0 0 100 int4eqoid - ));
DESCR("equal"); DESCR("equal");
DATA(insert OID = 720 ( octet_length PGUID 11 f t t t 1 f 23 "17" 100 0 0 100 byteaoctetlen - )); DATA(insert OID = 720 ( octet_length PGUID 11 f t t t 1 f 23 "17" 100 0 0 100 byteaoctetlen - ));
@ -1000,16 +1000,16 @@ DESCR("array");
DATA(insert OID = 752 ( filename_in PGUID 11 f t t t 1 f 605 "0" 100 0 0 100 filename_in - )); DATA(insert OID = 752 ( filename_in PGUID 11 f t t t 1 f 605 "0" 100 0 0 100 filename_in - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 753 ( filename_out PGUID 11 f t t t 2 f 19 "0 0" 100 0 0 100 filename_out - )); DATA(insert OID = 753 ( filename_out PGUID 11 f t t t 2 f 23 "0 0" 100 0 0 100 filename_out - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 760 ( smgrin PGUID 11 f t f t 1 f 210 "0" 100 0 0 100 smgrin - )); DATA(insert OID = 760 ( smgrin PGUID 12 f t f t 1 f 210 "0" 100 0 0 100 smgrin - ));
DESCR("storage manager(internal)"); DESCR("storage manager(internal)");
DATA(insert OID = 761 ( smgrout PGUID 11 f t f t 1 f 23 "0" 100 0 0 100 smgrout - )); DATA(insert OID = 761 ( smgrout PGUID 12 f t f t 1 f 23 "0" 100 0 0 100 smgrout - ));
DESCR("storage manager(internal)"); DESCR("storage manager(internal)");
DATA(insert OID = 762 ( smgreq PGUID 11 f t f t 2 f 16 "210 210" 100 0 0 100 smgreq - )); DATA(insert OID = 762 ( smgreq PGUID 12 f t f t 2 f 16 "210 210" 100 0 0 100 smgreq - ));
DESCR("storage manager"); DESCR("storage manager");
DATA(insert OID = 763 ( smgrne PGUID 11 f t f t 2 f 16 "210 210" 100 0 0 100 smgrne - )); DATA(insert OID = 763 ( smgrne PGUID 12 f t f t 2 f 16 "210 210" 100 0 0 100 smgrne - ));
DESCR("storage manager"); DESCR("storage manager");
DATA(insert OID = 764 ( lo_import PGUID 11 f t f t 1 f 26 "25" 100 0 0 100 lo_import - )); DATA(insert OID = 764 ( lo_import PGUID 11 f t f t 1 f 26 "25" 100 0 0 100 lo_import - ));
@ -1017,20 +1017,20 @@ DESCR("large object import");
DATA(insert OID = 765 ( lo_export PGUID 11 f t f t 2 f 23 "26 25" 100 0 0 100 lo_export - )); DATA(insert OID = 765 ( lo_export PGUID 11 f t f t 2 f 23 "26 25" 100 0 0 100 lo_export - ));
DESCR("large object export"); DESCR("large object export");
DATA(insert OID = 766 ( int4inc PGUID 11 f t t t 1 f 23 "23" 100 0 0 100 int4inc - )); DATA(insert OID = 766 ( int4inc PGUID 12 f t t t 1 f 23 "23" 100 0 0 100 int4inc - ));
DESCR("increment"); DESCR("increment");
DATA(insert OID = 767 ( int2inc PGUID 11 f t t t 1 f 21 "21" 100 0 0 100 int2inc - )); DATA(insert OID = 767 ( int2inc PGUID 12 f t t t 1 f 21 "21" 100 0 0 100 int2inc - ));
DESCR("increment"); DESCR("increment");
DATA(insert OID = 768 ( int4larger PGUID 11 f t t t 2 f 23 "23 23" 100 0 0 100 int4larger - )); DATA(insert OID = 768 ( int4larger PGUID 12 f t t t 2 f 23 "23 23" 100 0 0 100 int4larger - ));
DESCR("larger of two"); DESCR("larger of two");
DATA(insert OID = 769 ( int4smaller PGUID 11 f t t t 2 f 23 "23 23" 100 0 0 100 int4smaller - )); DATA(insert OID = 769 ( int4smaller PGUID 12 f t t t 2 f 23 "23 23" 100 0 0 100 int4smaller - ));
DESCR("smaller of two"); DESCR("smaller of two");
DATA(insert OID = 770 ( int2larger PGUID 11 f t t t 2 f 21 "21 21" 100 0 0 100 int2larger - )); DATA(insert OID = 770 ( int2larger PGUID 12 f t t t 2 f 21 "21 21" 100 0 0 100 int2larger - ));
DESCR("larger of two"); DESCR("larger of two");
DATA(insert OID = 771 ( int2smaller PGUID 11 f t t t 2 f 21 "21 21" 100 0 0 100 int2smaller - )); DATA(insert OID = 771 ( int2smaller PGUID 12 f t t t 2 f 21 "21 21" 100 0 0 100 int2smaller - ));
DESCR("smaller of two"); DESCR("smaller of two");
DATA(insert OID = 772 ( gistcostestimate PGUID 11 f t f t 7 f 0 "0 0 0 0 0 0 0" 100 0 0 100 gistcostestimate - )); DATA(insert OID = 772 ( gistcostestimate PGUID 12 f t f t 7 f 0 "0 0 0 0 0 0 0" 100 0 0 100 gistcostestimate - ));
DESCR("gist cost estimator"); DESCR("gist cost estimator");
DATA(insert OID = 774 ( gistgettuple PGUID 11 f t f t 2 f 23 "0" 100 0 0 100 gistgettuple - )); DATA(insert OID = 774 ( gistgettuple PGUID 11 f t f t 2 f 23 "0" 100 0 0 100 gistgettuple - ));
DESCR("gist(internal)"); DESCR("gist(internal)");
@ -1066,11 +1066,11 @@ DESCR("greater-than-or-equal");
/* OIDS 800 - 899 */ /* OIDS 800 - 899 */
DATA(insert OID = 817 ( oid PGUID 11 f t t t 1 f 26 "25" 100 0 0 100 text_oid -)); DATA(insert OID = 817 ( oid PGUID 12 f t t t 1 f 26 "25" 100 0 0 100 text_oid -));
DESCR("convert text to oid"); DESCR("convert text to oid");
DATA(insert OID = 818 ( int2 PGUID 11 f t t t 1 f 21 "25" 100 0 0 100 text_int2 -)); DATA(insert OID = 818 ( int2 PGUID 12 f t t t 1 f 21 "25" 100 0 0 100 text_int2 -));
DESCR("convert text to int2"); DESCR("convert text to int2");
DATA(insert OID = 819 ( int4 PGUID 11 f t t t 1 f 23 "25" 100 0 0 100 text_int4 -)); DATA(insert OID = 819 ( int4 PGUID 12 f t t t 1 f 23 "25" 100 0 0 100 text_int4 -));
DESCR("convert text to int4"); DESCR("convert text to int4");
DATA(insert OID = 838 ( float8 PGUID 11 f t t t 1 f 701 "25" 100 0 0 100 text_float8 -)); DATA(insert OID = 838 ( float8 PGUID 11 f t t t 1 f 701 "25" 100 0 0 100 text_float8 -));
@ -1114,22 +1114,22 @@ DESCR("matches LIKE expression");
DATA(insert OID = 859 ( namenlike PGUID 11 f t t t 2 f 16 "19 25" 100 0 0 100 namenlike - )); DATA(insert OID = 859 ( namenlike PGUID 11 f t t t 2 f 16 "19 25" 100 0 0 100 namenlike - ));
DESCR("does not match LIKE expression"); DESCR("does not match LIKE expression");
DATA(insert OID = 860 ( bpchar PGUID 11 f t t t 1 f 1042 "18" 100 0 0 100 char_bpchar - )); DATA(insert OID = 860 ( bpchar PGUID 12 f t t t 1 f 1042 "18" 100 0 0 100 char_bpchar - ));
DESCR("convert char to char()"); DESCR("convert char to char()");
DATA(insert OID = 861 ( char PGUID 11 f t t t 1 f 18 "1042" 100 0 0 100 bpchar_char - )); DATA(insert OID = 861 ( char PGUID 12 f t t t 1 f 18 "1042" 100 0 0 100 bpchar_char - ));
DESCR("convert char() to char"); DESCR("convert char() to char");
DATA(insert OID = 862 ( int4_mul_cash PGUID 11 f t t t 2 f 790 "23 790" 100 0 0 100 int4_mul_cash - )); DATA(insert OID = 862 ( int4_mul_cash PGUID 11 f t t t 2 f 790 "23 790" 100 0 0 100 int4_mul_cash - ));
DESCR("multiply"); DESCR("multiply");
DATA(insert OID = 863 ( int2_mul_cash PGUID 11 f t t t 2 f 790 "21 790" 100 0 0 100 int2_mul_cash - )); DATA(insert OID = 863 ( int2_mul_cash PGUID 12 f t t t 2 f 790 "21 790" 100 0 0 100 int2_mul_cash - ));
DESCR("multiply"); DESCR("multiply");
DATA(insert OID = 864 ( cash_mul_int4 PGUID 11 f t t t 2 f 790 "790 23" 100 0 0 100 cash_mul_int4 - )); DATA(insert OID = 864 ( cash_mul_int4 PGUID 11 f t t t 2 f 790 "790 23" 100 0 0 100 cash_mul_int4 - ));
DESCR("multiply"); DESCR("multiply");
DATA(insert OID = 865 ( cash_div_int4 PGUID 11 f t t t 2 f 790 "790 23" 100 0 0 100 cash_div_int4 - )); DATA(insert OID = 865 ( cash_div_int4 PGUID 11 f t t t 2 f 790 "790 23" 100 0 0 100 cash_div_int4 - ));
DESCR("divide"); DESCR("divide");
DATA(insert OID = 866 ( cash_mul_int2 PGUID 11 f t t t 2 f 790 "790 21" 100 0 0 100 cash_mul_int2 - )); DATA(insert OID = 866 ( cash_mul_int2 PGUID 12 f t t t 2 f 790 "790 21" 100 0 0 100 cash_mul_int2 - ));
DESCR("multiply"); DESCR("multiply");
DATA(insert OID = 867 ( cash_div_int2 PGUID 11 f t t t 2 f 790 "790 21" 100 0 0 100 cash_div_int2 - )); DATA(insert OID = 867 ( cash_div_int2 PGUID 12 f t t t 2 f 790 "790 21" 100 0 0 100 cash_div_int2 - ));
DESCR("divide"); DESCR("divide");
DATA(insert OID = 886 ( cash_in PGUID 11 f t t t 1 f 790 "0" 100 0 0 100 cash_in - )); DATA(insert OID = 886 ( cash_in PGUID 11 f t t t 1 f 790 "0" 100 0 0 100 cash_in - ));
@ -1178,13 +1178,13 @@ DESCR("");
DATA(insert OID = 939 ( revertpoly PGUID 11 f t f t 1 f 604 "604" 100 0 0 100 revertpoly - )); DATA(insert OID = 939 ( revertpoly PGUID 11 f t f t 1 f 604 "604" 100 0 0 100 revertpoly - ));
DESCR(""); DESCR("");
DATA(insert OID = 940 ( mod PGUID 11 f t t t 2 f 21 "21 21" 100 0 0 100 int2mod - )); DATA(insert OID = 940 ( mod PGUID 12 f t t t 2 f 21 "21 21" 100 0 0 100 int2mod - ));
DESCR("modulus"); DESCR("modulus");
DATA(insert OID = 941 ( mod PGUID 11 f t t t 2 f 23 "23 23" 100 0 0 100 int4mod - )); DATA(insert OID = 941 ( mod PGUID 12 f t t t 2 f 23 "23 23" 100 0 0 100 int4mod - ));
DESCR("modulus"); DESCR("modulus");
DATA(insert OID = 942 ( mod PGUID 11 f t t t 2 f 23 "21 23" 100 0 0 100 int24mod - )); DATA(insert OID = 942 ( mod PGUID 12 f t t t 2 f 23 "21 23" 100 0 0 100 int24mod - ));
DESCR("modulus"); DESCR("modulus");
DATA(insert OID = 943 ( mod PGUID 11 f t t t 2 f 23 "23 21" 100 0 0 100 int42mod - )); DATA(insert OID = 943 ( mod PGUID 12 f t t t 2 f 23 "23 21" 100 0 0 100 int42mod - ));
DESCR("modulus"); DESCR("modulus");
DATA(insert OID = 945 ( int8mod PGUID 11 f t t t 2 f 20 "20 20" 100 0 0 100 int8mod - )); DATA(insert OID = 945 ( int8mod PGUID 11 f t t t 2 f 20 "20 20" 100 0 0 100 int8mod - ));
@ -1192,17 +1192,17 @@ DESCR("modulus");
DATA(insert OID = 947 ( mod PGUID 11 f t t t 2 f 20 "20 20" 100 0 0 100 int8mod - )); DATA(insert OID = 947 ( mod PGUID 11 f t t t 2 f 20 "20 20" 100 0 0 100 int8mod - ));
DESCR("modulus"); DESCR("modulus");
DATA(insert OID = 944 ( char PGUID 11 f t t t 1 f 18 "25" 100 0 0 100 text_char - )); DATA(insert OID = 944 ( char PGUID 12 f t t t 1 f 18 "25" 100 0 0 100 text_char - ));
DESCR("convert text to char"); DESCR("convert text to char");
DATA(insert OID = 946 ( text PGUID 11 f t t t 1 f 25 "18" 100 0 0 100 char_text - )); DATA(insert OID = 946 ( text PGUID 12 f t t t 1 f 25 "18" 100 0 0 100 char_text - ));
DESCR("convert char to text"); DESCR("convert char to text");
DATA(insert OID = 948 ( varchar PGUID 11 f t t t 1 f 25 "1043" 100 0 0 100 bpchar_char - )); DATA(insert OID = 948 ( varchar PGUID 12 f t t t 1 f 25 "1043" 100 0 0 100 bpchar_char - ));
DESCR("convert varchar() to text"); DESCR("convert varchar() to text");
DATA(insert OID = 950 ( istrue PGUID 11 f t t t 1 f 16 "16" 100 0 0 100 istrue - )); DATA(insert OID = 950 ( istrue PGUID 12 f t t f 1 f 16 "16" 100 0 0 100 istrue - ));
DESCR(""); DESCR("bool is true (not false or unknown)");
DATA(insert OID = 951 ( isfalse PGUID 11 f t t t 1 f 16 "16" 100 0 0 100 isfalse - )); DATA(insert OID = 951 ( isfalse PGUID 12 f t t f 1 f 16 "16" 100 0 0 100 isfalse - ));
DESCR(""); DESCR("bool is false (not true or unknown)");
DATA(insert OID = 952 ( lo_open PGUID 11 f t f t 2 f 23 "26 23" 100 0 0 100 lo_open - )); DATA(insert OID = 952 ( lo_open PGUID 11 f t f t 2 f 23 "26 23" 100 0 0 100 lo_open - ));
DESCR("large object open"); DESCR("large object open");
@ -1232,7 +1232,7 @@ DESCR("closest point to line on box");
DATA(insert OID = 964 ( lo_unlink PGUID 11 f t f t 1 f 23 "26" 100 0 0 100 lo_unlink - )); DATA(insert OID = 964 ( lo_unlink PGUID 11 f t f t 1 f 23 "26" 100 0 0 100 lo_unlink - ));
DESCR("large object unlink(delete)"); DESCR("large object unlink(delete)");
DATA(insert OID = 972 ( regproctooid PGUID 11 f t t t 1 f 26 "24" 100 0 0 100 regproctooid - )); DATA(insert OID = 972 ( regproctooid PGUID 12 f t t t 1 f 26 "24" 100 0 0 100 regproctooid - ));
DESCR("get oid for regproc"); DESCR("get oid for regproc");
DATA(insert OID = 973 ( path_inter PGUID 11 f t t t 2 f 16 "602 602" 100 0 10 100 path_inter - )); DATA(insert OID = 973 ( path_inter PGUID 11 f t t t 2 f 16 "602 602" 100 0 10 100 path_inter - ));
@ -1288,9 +1288,9 @@ DESCR("equal");
/* OIDS 1000 - 1999 */ /* OIDS 1000 - 1999 */
DATA(insert OID = 1029 ( nullvalue PGUID 11 f t t f 1 f 16 "0" 100 0 0 100 nullvalue - )); DATA(insert OID = 1029 ( nullvalue PGUID 12 f t t f 1 f 16 "0" 100 0 0 100 nullvalue - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1030 ( nonnullvalue PGUID 11 f t t f 1 f 16 "0" 100 0 0 100 nonnullvalue - )); DATA(insert OID = 1030 ( nonnullvalue PGUID 12 f t t f 1 f 16 "0" 100 0 0 100 nonnullvalue - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1031 ( aclitemin PGUID 11 f t f t 1 f 1033 "0" 100 0 0 100 aclitemin - )); DATA(insert OID = 1031 ( aclitemin PGUID 11 f t f t 1 f 1033 "0" 100 0 0 100 aclitemin - ));
DESCR("(internal)"); DESCR("(internal)");
@ -1517,9 +1517,9 @@ DESCR("matches regex., case-insensitive");
DATA(insert OID = 1241 ( nameicregexne PGUID 11 f t t t 2 f 16 "19 25" 100 0 0 100 nameicregexne - )); DATA(insert OID = 1241 ( nameicregexne PGUID 11 f t t t 2 f 16 "19 25" 100 0 0 100 nameicregexne - ));
DESCR("does not match regex., case-insensitive"); DESCR("does not match regex., case-insensitive");
DATA(insert OID = 1251 ( int4abs PGUID 11 f t t t 1 f 23 "23" 100 0 0 100 int4abs - )); DATA(insert OID = 1251 ( int4abs PGUID 12 f t t t 1 f 23 "23" 100 0 0 100 int4abs - ));
DESCR("absolute value"); DESCR("absolute value");
DATA(insert OID = 1253 ( int2abs PGUID 11 f t t t 1 f 21 "21" 100 0 0 100 int2abs - )); DATA(insert OID = 1253 ( int2abs PGUID 12 f t t t 1 f 21 "21" 100 0 0 100 int2abs - ));
DESCR("absolute value"); DESCR("absolute value");
DATA(insert OID = 1263 ( interval PGUID 11 f t f t 1 f 1186 "25" 100 0 0 100 text_interval - )); DATA(insert OID = 1263 ( interval PGUID 11 f t f t 1 f 1186 "25" 100 0 0 100 text_interval - ));
@ -1575,13 +1575,13 @@ DESCR("current transaction time");
/* OIDS 1300 - 1399 */ /* OIDS 1300 - 1399 */
DATA(insert OID = 1300 ( positionsel PGUID 11 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 positionsel - )); DATA(insert OID = 1300 ( positionsel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 positionsel - ));
DESCR("restriction selectivity for position-comparison operators"); DESCR("restriction selectivity for position-comparison operators");
DATA(insert OID = 1301 ( positionjoinsel PGUID 11 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 positionjoinsel - )); DATA(insert OID = 1301 ( positionjoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 positionjoinsel - ));
DESCR("join selectivity for position-comparison operators"); DESCR("join selectivity for position-comparison operators");
DATA(insert OID = 1302 ( contsel PGUID 11 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 contsel - )); DATA(insert OID = 1302 ( contsel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 contsel - ));
DESCR("restriction selectivity for containment comparison operators"); DESCR("restriction selectivity for containment comparison operators");
DATA(insert OID = 1303 ( contjoinsel PGUID 11 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 contjoinsel - )); DATA(insert OID = 1303 ( contjoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 contjoinsel - ));
DESCR("join selectivity for containment comparison operators"); DESCR("join selectivity for containment comparison operators");
DATA(insert OID = 1304 ( overlaps PGUID 11 f t t t 4 f 16 "1184 1184 1184 1184" 100 0 1 0 overlaps_timestamp - )); DATA(insert OID = 1304 ( overlaps PGUID 11 f t t t 4 f 16 "1184 1184 1184 1184" 100 0 1 0 overlaps_timestamp - ));
@ -1640,7 +1640,7 @@ DESCR("exponential");
DATA(insert OID = 1348 ( obj_description PGUID 14 f t f t 1 f 25 "26" 100 0 0 100 "select description from pg_description where objoid = $1" - )); DATA(insert OID = 1348 ( obj_description PGUID 14 f t f t 1 f 25 "26" 100 0 0 100 "select description from pg_description where objoid = $1" - ));
DESCR("get description for object id"); DESCR("get description for object id");
DATA(insert OID = 1349 ( oidvectortypes PGUID 11 f t f t 1 f 25 "30" 100 0 0 100 oidvectortypes - )); DATA(insert OID = 1349 ( oidvectortypes PGUID 12 f t f t 1 f 25 "30" 100 0 0 100 oidvectortypes - ));
DESCR("print type names of oidvector field"); DESCR("print type names of oidvector field");
@ -1727,9 +1727,9 @@ DATA(insert OID = 1390 ( isfinite PGUID 11 f t f t 1 f 16 "1186" 100 0 0 100
DESCR("boolean test"); DESCR("boolean test");
DATA(insert OID = 1391 ( factorial PGUID 11 f t t t 1 f 23 "21" 100 0 0 100 int2fac - )); DATA(insert OID = 1391 ( factorial PGUID 12 f t t t 1 f 23 "21" 100 0 0 100 int2fac - ));
DESCR("factorial"); DESCR("factorial");
DATA(insert OID = 1392 ( factorial PGUID 11 f t t t 1 f 23 "23" 100 0 0 100 int4fac - )); DATA(insert OID = 1392 ( factorial PGUID 12 f t t t 1 f 23 "23" 100 0 0 100 int4fac - ));
DESCR("factorial"); DESCR("factorial");
DATA(insert OID = 1393 ( factorial PGUID 11 f t t t 1 f 20 "20" 100 0 0 100 int8fac - )); DATA(insert OID = 1393 ( factorial PGUID 11 f t t t 1 f 20 "20" 100 0 0 100 int8fac - ));
DESCR("factorial"); DESCR("factorial");
@ -1739,9 +1739,9 @@ DATA(insert OID = 1395 ( abs PGUID 11 f t t t 1 f 701 "701" 100 0 0 100 f
DESCR("absolute value"); DESCR("absolute value");
DATA(insert OID = 1396 ( abs PGUID 11 f t t t 1 f 20 "20" 100 0 0 100 int8abs - )); DATA(insert OID = 1396 ( abs PGUID 11 f t t t 1 f 20 "20" 100 0 0 100 int8abs - ));
DESCR("absolute value"); DESCR("absolute value");
DATA(insert OID = 1397 ( abs PGUID 11 f t t t 1 f 23 "23" 100 0 0 100 int4abs - )); DATA(insert OID = 1397 ( abs PGUID 12 f t t t 1 f 23 "23" 100 0 0 100 int4abs - ));
DESCR("absolute value"); DESCR("absolute value");
DATA(insert OID = 1398 ( abs PGUID 11 f t t t 1 f 21 "21" 100 0 0 100 int2abs - )); DATA(insert OID = 1398 ( abs PGUID 12 f t t t 1 f 21 "21" 100 0 0 100 int2abs - ));
DESCR("absolute value"); DESCR("absolute value");
/* OIDS 1400 - 1499 */ /* OIDS 1400 - 1499 */
@ -1783,6 +1783,11 @@ DESCR("lines horizontal?");
DATA(insert OID = 1416 ( point PGUID 11 f t t t 1 f 600 "718" 100 0 1 0 circle_center - )); DATA(insert OID = 1416 ( point PGUID 11 f t t t 1 f 600 "718" 100 0 1 0 circle_center - ));
DESCR("center of"); DESCR("center of");
DATA(insert OID = 1417 ( isnottrue PGUID 12 f t t f 1 f 16 "16" 100 0 0 100 isnottrue - ));
DESCR("bool is not true (ie, false or unknown)");
DATA(insert OID = 1418 ( isnotfalse PGUID 12 f t t f 1 f 16 "16" 100 0 0 100 isnotfalse - ));
DESCR("bool is not false (ie, true or unknown)");
DATA(insert OID = 1421 ( box PGUID 11 f t t t 2 f 603 "600 600" 100 0 0 100 box - )); DATA(insert OID = 1421 ( box PGUID 11 f t t t 2 f 603 "600 600" 100 0 0 100 box - ));
DESCR("convert points to box"); DESCR("convert points to box");
DATA(insert OID = 1422 ( box_add PGUID 11 f t t t 2 f 603 "603 600" 100 0 0 100 box_add - )); DATA(insert OID = 1422 ( box_add PGUID 11 f t t t 2 f 603 "603 600" 100 0 0 100 box_add - ));
@ -2057,7 +2062,7 @@ DESCR("PI");
DATA(insert OID = 1618 ( interval_mul PGUID 11 f t t t 2 f 1186 "1186 701" 100 0 0 100 interval_mul - )); DATA(insert OID = 1618 ( interval_mul PGUID 11 f t t t 2 f 1186 "1186 701" 100 0 0 100 interval_mul - ));
DESCR("multiply interval"); DESCR("multiply interval");
DATA(insert OID = 1619 ( varchar PGUID 11 f t t t 1 f 1043 "23" 100 0 0 100 int4_text - )); DATA(insert OID = 1619 ( varchar PGUID 12 f t t t 1 f 1043 "23" 100 0 0 100 int4_text - ));
DESCR("convert int4 to varchar"); DESCR("convert int4 to varchar");
DATA(insert OID = 1620 ( ascii PGUID 11 f t t t 1 f 23 "25" 100 0 0 100 ascii - )); DATA(insert OID = 1620 ( ascii PGUID 11 f t t t 1 f 23 "25" 100 0 0 100 ascii - ));
@ -2308,11 +2313,11 @@ DESCR("host address");
DATA(insert OID = 683 ( network PGUID 11 f t t t 1 f 25 "869" 100 0 0 100 network_network - )); DATA(insert OID = 683 ( network PGUID 11 f t t t 1 f 25 "869" 100 0 0 100 network_network - ));
DESCR("network address"); DESCR("network address");
DATA(insert OID = 1691 ( boolle PGUID 11 f t t t 2 f 16 "16 16" 100 0 0 100 boolle - )); DATA(insert OID = 1691 ( boolle PGUID 12 f t t t 2 f 16 "16 16" 100 0 0 100 boolle - ));
DESCR("less-than-or-equal"); DESCR("less-than-or-equal");
DATA(insert OID = 1692 ( boolge PGUID 11 f t t t 2 f 16 "16 16" 100 0 0 100 boolge - )); DATA(insert OID = 1692 ( boolge PGUID 12 f t t t 2 f 16 "16 16" 100 0 0 100 boolge - ));
DESCR("greater-than-or-equal"); DESCR("greater-than-or-equal");
DATA(insert OID = 1693 ( btboolcmp PGUID 11 f t t t 2 f 23 "16 16" 100 0 0 100 btboolcmp - )); DATA(insert OID = 1693 ( btboolcmp PGUID 12 f t t t 2 f 23 "16 16" 100 0 0 100 btboolcmp - ));
DESCR("btree less-equal-greater"); DESCR("btree less-equal-greater");
/* OID's 1700 - 1799 NUMERIC data type */ /* OID's 1700 - 1799 NUMERIC data type */
@ -2414,9 +2419,9 @@ DATA(insert OID = 1779 ( int8 PGUID 11 f t t t 1 f 20 "1700" 100 0 0 100 nu
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1781 ( numeric PGUID 11 f t t t 1 f 1700 "20" 100 0 0 100 int8_numeric - )); DATA(insert OID = 1781 ( numeric PGUID 11 f t t t 1 f 1700 "20" 100 0 0 100 int8_numeric - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1782 ( numeric PGUID 11 f t t t 1 f 1700 "21" 100 0 0 100 int2_numeric - )); DATA(insert OID = 1782 ( numeric PGUID 12 f t t t 1 f 1700 "21" 100 0 0 100 int2_numeric - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1783 ( int2 PGUID 11 f t t t 1 f 21 "1700" 100 0 0 100 numeric_int2 - )); DATA(insert OID = 1783 ( int2 PGUID 12 f t t t 1 f 21 "1700" 100 0 0 100 numeric_int2 - ));
DESCR("(internal)"); DESCR("(internal)");
/* formatting */ /* formatting */
@ -2439,30 +2444,35 @@ DESCR("convert text to timestamp");
DATA(insert OID = 1780 ( to_date PGUID 11 f t f t 2 f 1082 "25 25" 100 0 0 100 to_date - )); DATA(insert OID = 1780 ( to_date PGUID 11 f t f t 2 f 1082 "25 25" 100 0 0 100 to_date - ));
DESCR("convert text to date"); DESCR("convert text to date");
DATA(insert OID = 1798 ( oidin PGUID 12 f t t t 1 f 26 "0" 100 0 0 100 oidin - ));
DESCR("(internal)");
DATA(insert OID = 1799 ( oidout PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 oidout - ));
DESCR("(internal)");
/* Selectivity estimators for LIKE and related operators */ /* Selectivity estimators for LIKE and related operators */
DATA(insert OID = 1818 ( regexeqsel PGUID 11 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 regexeqsel - )); DATA(insert OID = 1818 ( regexeqsel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 regexeqsel - ));
DESCR("restriction selectivity of regex match"); DESCR("restriction selectivity of regex match");
DATA(insert OID = 1819 ( likesel PGUID 11 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 likesel - )); DATA(insert OID = 1819 ( likesel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 likesel - ));
DESCR("restriction selectivity of LIKE"); DESCR("restriction selectivity of LIKE");
DATA(insert OID = 1820 ( icregexeqsel PGUID 11 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 icregexeqsel - )); DATA(insert OID = 1820 ( icregexeqsel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 icregexeqsel - ));
DESCR("restriction selectivity of case-insensitive regex match"); DESCR("restriction selectivity of case-insensitive regex match");
DATA(insert OID = 1821 ( regexnesel PGUID 11 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 regexnesel - )); DATA(insert OID = 1821 ( regexnesel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 regexnesel - ));
DESCR("restriction selectivity of regex non-match"); DESCR("restriction selectivity of regex non-match");
DATA(insert OID = 1822 ( nlikesel PGUID 11 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 nlikesel - )); DATA(insert OID = 1822 ( nlikesel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 nlikesel - ));
DESCR("restriction selectivity of NOT LIKE"); DESCR("restriction selectivity of NOT LIKE");
DATA(insert OID = 1823 ( icregexnesel PGUID 11 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 icregexnesel - )); DATA(insert OID = 1823 ( icregexnesel PGUID 12 f t f t 5 f 701 "26 26 21 0 23" 100 0 0 100 icregexnesel - ));
DESCR("restriction selectivity of case-insensitive regex non-match"); DESCR("restriction selectivity of case-insensitive regex non-match");
DATA(insert OID = 1824 ( regexeqjoinsel PGUID 11 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 regexeqjoinsel - )); DATA(insert OID = 1824 ( regexeqjoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 regexeqjoinsel - ));
DESCR("join selectivity of regex match"); DESCR("join selectivity of regex match");
DATA(insert OID = 1825 ( likejoinsel PGUID 11 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 likejoinsel - )); DATA(insert OID = 1825 ( likejoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 likejoinsel - ));
DESCR("join selectivity of LIKE"); DESCR("join selectivity of LIKE");
DATA(insert OID = 1826 ( icregexeqjoinsel PGUID 11 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 icregexeqjoinsel - )); DATA(insert OID = 1826 ( icregexeqjoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 icregexeqjoinsel - ));
DESCR("join selectivity of case-insensitive regex match"); DESCR("join selectivity of case-insensitive regex match");
DATA(insert OID = 1827 ( regexnejoinsel PGUID 11 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 regexnejoinsel - )); DATA(insert OID = 1827 ( regexnejoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 regexnejoinsel - ));
DESCR("join selectivity of regex non-match"); DESCR("join selectivity of regex non-match");
DATA(insert OID = 1828 ( nlikejoinsel PGUID 11 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 nlikejoinsel - )); DATA(insert OID = 1828 ( nlikejoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 nlikejoinsel - ));
DESCR("join selectivity of NOT LIKE"); DESCR("join selectivity of NOT LIKE");
DATA(insert OID = 1829 ( icregexnejoinsel PGUID 11 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 icregexnejoinsel - )); DATA(insert OID = 1829 ( icregexnejoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 icregexnejoinsel - ));
DESCR("join selectivity of case-insensitive regex non-match"); DESCR("join selectivity of case-insensitive regex non-match");

View File

@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pg_type.h,v 1.88 2000/04/12 17:16:29 momjian Exp $ * $Id: pg_type.h,v 1.89 2000/06/05 07:29:01 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
@ -191,7 +191,7 @@ DATA(insert OID = 25 ( text PGUID -1 -1 f b t \054 0 18 textin textout text
DESCR("variable-length string, no limit specified"); DESCR("variable-length string, no limit specified");
#define TEXTOID 25 #define TEXTOID 25
DATA(insert OID = 26 ( oid PGUID 4 10 t b t \054 0 0 int4in int4out int4in int4out i _null_ )); DATA(insert OID = 26 ( oid PGUID 4 10 t b t \054 0 0 oidin oidout oidin oidout i _null_ ));
DESCR("object identifier(oid), maximum 4 billion"); DESCR("object identifier(oid), maximum 4 billion");
#define OIDOID 26 #define OIDOID 26
@ -214,21 +214,21 @@ DESCR("array of INDEX_MAX_KEYS oids, used in system tables");
DATA(insert OID = 32 ( SET PGUID -1 -1 f b t \054 0 0 textin textout textin textout i _null_ )); DATA(insert OID = 32 ( SET PGUID -1 -1 f b t \054 0 0 textin textout textin textout i _null_ ));
DESCR("set of tuples"); DESCR("set of tuples");
DATA(insert OID = 71 ( pg_type PGUID 4 4 t c t \054 1247 0 foo bar foo bar i _null_)); DATA(insert OID = 71 ( pg_type PGUID 4 4 t c t \054 1247 0 int4in int4out int4in int4out i _null_));
DATA(insert OID = 75 ( pg_attribute PGUID 4 4 t c t \054 1249 0 foo bar foo bar i _null_)); DATA(insert OID = 75 ( pg_attribute PGUID 4 4 t c t \054 1249 0 int4in int4out int4in int4out i _null_));
DATA(insert OID = 81 ( pg_proc PGUID 4 4 t c t \054 1255 0 foo bar foo bar i _null_)); DATA(insert OID = 81 ( pg_proc PGUID 4 4 t c t \054 1255 0 int4in int4out int4in int4out i _null_));
DATA(insert OID = 83 ( pg_class PGUID 4 4 t c t \054 1259 0 foo bar foo bar i _null_)); DATA(insert OID = 83 ( pg_class PGUID 4 4 t c t \054 1259 0 int4in int4out int4in int4out i _null_));
DATA(insert OID = 86 ( pg_shadow PGUID 4 4 t c t \054 1260 0 foo bar foo bar i _null_)); DATA(insert OID = 86 ( pg_shadow PGUID 4 4 t c t \054 1260 0 int4in int4out int4in int4out i _null_));
DATA(insert OID = 87 ( pg_group PGUID 4 4 t c t \054 1261 0 foo bar foo bar i _null_)); DATA(insert OID = 87 ( pg_group PGUID 4 4 t c t \054 1261 0 int4in int4out int4in int4out i _null_));
DATA(insert OID = 88 ( pg_database PGUID 4 4 t c t \054 1262 0 foo bar foo bar i _null_)); DATA(insert OID = 88 ( pg_database PGUID 4 4 t c t \054 1262 0 int4in int4out int4in int4out i _null_));
DATA(insert OID = 90 ( pg_variable PGUID 4 4 t c t \054 1264 0 foo bar foo bar i _null_)); DATA(insert OID = 90 ( pg_variable PGUID 4 4 t c t \054 1264 0 int4in int4out int4in int4out i _null_));
DATA(insert OID = 99 ( pg_log PGUID 4 4 t c t \054 1269 0 foo bar foo bar i _null_)); DATA(insert OID = 99 ( pg_log PGUID 4 4 t c t \054 1269 0 int4in int4out int4in int4out i _null_));
/* OIDS 100 - 199 */ /* OIDS 100 - 199 */
DATA(insert OID = 109 ( pg_attrdef PGUID 4 4 t c t \054 1215 0 foo bar foo bar i _null_)); DATA(insert OID = 109 ( pg_attrdef PGUID 4 4 t c t \054 1215 0 int4in int4out int4in int4out i _null_));
DATA(insert OID = 110 ( pg_relcheck PGUID 4 4 t c t \054 1216 0 foo bar foo bar i _null_)); DATA(insert OID = 110 ( pg_relcheck PGUID 4 4 t c t \054 1216 0 int4in int4out int4in int4out i _null_));
DATA(insert OID = 111 ( pg_trigger PGUID 4 4 t c t \054 1219 0 foo bar foo bar i _null_)); DATA(insert OID = 111 ( pg_trigger PGUID 4 4 t c t \054 1219 0 int4in int4out int4in int4out i _null_));
/* OIDS 200 - 299 */ /* OIDS 200 - 299 */

View File

@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: fmgr.h,v 1.3 2000/05/30 04:24:56 tgl Exp $ * $Id: fmgr.h,v 1.4 2000/06/05 07:29:02 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -101,12 +101,15 @@ extern void fmgr_info(Oid functionId, FmgrInfo *finfo);
/* Macros for fetching arguments of standard types */ /* Macros for fetching arguments of standard types */
#define PG_GETARG_DATUM(n) (fcinfo->arg[n])
#define PG_GETARG_INT32(n) DatumGetInt32(fcinfo->arg[n]) #define PG_GETARG_INT32(n) DatumGetInt32(fcinfo->arg[n])
#define PG_GETARG_UINT32(n) DatumGetUInt32(fcinfo->arg[n])
#define PG_GETARG_INT16(n) DatumGetInt16(fcinfo->arg[n]) #define PG_GETARG_INT16(n) DatumGetInt16(fcinfo->arg[n])
#define PG_GETARG_CHAR(n) DatumGetChar(fcinfo->arg[n]) #define PG_GETARG_CHAR(n) DatumGetChar(fcinfo->arg[n])
#define PG_GETARG_BOOL(n) DatumGetBool(fcinfo->arg[n]) #define PG_GETARG_BOOL(n) DatumGetBool(fcinfo->arg[n])
#define PG_GETARG_OID(n) DatumGetObjectId(fcinfo->arg[n]) #define PG_GETARG_OID(n) DatumGetObjectId(fcinfo->arg[n])
#define PG_GETARG_POINTER(n) DatumGetPointer(fcinfo->arg[n]) #define PG_GETARG_POINTER(n) DatumGetPointer(fcinfo->arg[n])
#define PG_GETARG_CSTRING(n) DatumGetCString(fcinfo->arg[n])
#define PG_GETARG_NAME(n) DatumGetName(fcinfo->arg[n]) #define PG_GETARG_NAME(n) DatumGetName(fcinfo->arg[n])
/* these macros hide the pass-by-reference-ness of the datatype: */ /* these macros hide the pass-by-reference-ness of the datatype: */
#define PG_GETARG_FLOAT4(n) DatumGetFloat4(fcinfo->arg[n]) #define PG_GETARG_FLOAT4(n) DatumGetFloat4(fcinfo->arg[n])
@ -115,10 +118,16 @@ extern void fmgr_info(Oid functionId, FmgrInfo *finfo);
/* use this if you want the raw, possibly-toasted input datum: */ /* use this if you want the raw, possibly-toasted input datum: */
#define PG_GETARG_RAW_VARLENA_P(n) ((struct varlena *) PG_GETARG_POINTER(n)) #define PG_GETARG_RAW_VARLENA_P(n) ((struct varlena *) PG_GETARG_POINTER(n))
/* use this if you want the input datum de-toasted: */ /* use this if you want the input datum de-toasted: */
#if 1
/* VERY TEMPORARY until some TOAST support is committed ... */
#define PG_GETARG_VARLENA_P(n) PG_GETARG_RAW_VARLENA_P(n)
#else
/* Eventually it will look more like this... */
#define PG_GETARG_VARLENA_P(n) \ #define PG_GETARG_VARLENA_P(n) \
(VARATT_IS_EXTENDED(PG_GETARG_RAW_VARLENA_P(n)) ? \ (VARATT_IS_EXTENDED(PG_GETARG_RAW_VARLENA_P(n)) ? \
(struct varlena *) heap_tuple_untoast_attr((varattrib *) PG_GETARG_RAW_VARLENA_P(n)) : \ (struct varlena *) heap_tuple_untoast_attr((varattrib *) PG_GETARG_RAW_VARLENA_P(n)) : \
PG_GETARG_RAW_VARLENA_P(n)) PG_GETARG_RAW_VARLENA_P(n))
#endif
/* GETARG macros for varlena types will typically look like this: */ /* GETARG macros for varlena types will typically look like this: */
#define PG_GETARG_TEXT_P(n) ((text *) PG_GETARG_VARLENA_P(n)) #define PG_GETARG_TEXT_P(n) ((text *) PG_GETARG_VARLENA_P(n))
@ -129,11 +138,13 @@ extern void fmgr_info(Oid functionId, FmgrInfo *finfo);
/* Macros for returning results of standard types */ /* Macros for returning results of standard types */
#define PG_RETURN_INT32(x) return Int32GetDatum(x) #define PG_RETURN_INT32(x) return Int32GetDatum(x)
#define PG_RETURN_UINT32(x) return UInt32GetDatum(x)
#define PG_RETURN_INT16(x) return Int16GetDatum(x) #define PG_RETURN_INT16(x) return Int16GetDatum(x)
#define PG_RETURN_CHAR(x) return CharGetDatum(x) #define PG_RETURN_CHAR(x) return CharGetDatum(x)
#define PG_RETURN_BOOL(x) return BoolGetDatum(x) #define PG_RETURN_BOOL(x) return BoolGetDatum(x)
#define PG_RETURN_OID(x) return ObjectIdGetDatum(x) #define PG_RETURN_OID(x) return ObjectIdGetDatum(x)
#define PG_RETURN_POINTER(x) return PointerGetDatum(x) #define PG_RETURN_POINTER(x) return PointerGetDatum(x)
#define PG_RETURN_CSTRING(x) return CStringGetDatum(x)
#define PG_RETURN_NAME(x) return NameGetDatum(x) #define PG_RETURN_NAME(x) return NameGetDatum(x)
/* these macros hide the pass-by-reference-ness of the datatype: */ /* these macros hide the pass-by-reference-ness of the datatype: */
#define PG_RETURN_FLOAT4(x) return Float4GetDatum(x) #define PG_RETURN_FLOAT4(x) return Float4GetDatum(x)
@ -242,57 +253,19 @@ extern PGFunction load_external_function(char *filename, char *funcname);
extern void load_file(char *filename); extern void load_file(char *filename);
/*------------------------------------------------------------------------- /*
*
* !!! OLD INTERFACE !!! * !!! OLD INTERFACE !!!
* *
* All the definitions below here are associated with the old fmgr API. * fmgr() is the only remaining vestige of the old-style caller support
* They will go away as soon as we have converted all call points to use * functions. It's no longer used anywhere in the Postgres distribution,
* the new API. Note that old-style callee functions do not depend on * but we should leave it around for a release or two to ease the transition
* these definitions, so we don't need to have converted all of them before * for user-supplied C functions. OidFunctionCallN() replaces it for new
* dropping the old API ... just all the old-style call points. * code.
*
*-------------------------------------------------------------------------
*/ */
/* ptr to func returning (char *) */
#if defined(__mc68000__) && defined(__ELF__)
/* The m68k SVR4 ABI defines that pointers are returned in %a0 instead of
* %d0. So if a function pointer is declared to return a pointer, the
* compiler may look only into %a0, but if the called function was declared
* to return return an integer type, it puts its value only into %d0. So the
* caller doesn't pink up the correct return value. The solution is to
* declare the function pointer to return int, so the compiler picks up the
* return value from %d0. (Functions returning pointers put their value
* *additionally* into %d0 for compability.) The price is that there are
* some warnings about int->pointer conversions...
*/
typedef int32 ((*func_ptr) ());
#else
typedef char *((*func_ptr) ());
#endif
#if 0
typedef struct {
char *data[FUNC_MAX_ARGS];
} FmgrValues;
/* /*
* defined in fmgr.c * DEPRECATED, DO NOT USE IN NEW CODE
*/ */
extern char *fmgr(Oid procedureId, ... ); extern char *fmgr(Oid procedureId, ... );
extern char *fmgr_faddr_link(char *arg0, ...);
/*
* Macros for calling through the result of fmgr_info.
*/
/* We don't make this static so fmgr_faddr() macro can access it */
extern FmgrInfo *fmgr_pl_finfo;
#define fmgr_faddr(finfo) (fmgr_pl_finfo = (finfo), (func_ptr) fmgr_faddr_link)
#endif
#endif /* FMGR_H */ #endif /* FMGR_H */

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: smgr.h,v 1.20 2000/04/12 17:16:52 momjian Exp $ * $Id: smgr.h,v 1.21 2000/06/05 07:29:06 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -100,9 +100,9 @@ extern int mmshutdown(void);
extern int MMShmemSize(void); extern int MMShmemSize(void);
/* smgrtype.c */ /* smgrtype.c */
extern char *smgrout(int2 i); extern Datum smgrout(PG_FUNCTION_ARGS);
extern int2 smgrin(char *s); extern Datum smgrin(PG_FUNCTION_ARGS);
extern bool smgreq(int2 a, int2 b); extern Datum smgreq(PG_FUNCTION_ARGS);
extern bool smgrne(int2 a, int2 b); extern Datum smgrne(PG_FUNCTION_ARGS);
#endif /* SMGR_H */ #endif /* SMGR_H */

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: builtins.h,v 1.112 2000/05/29 01:59:13 tgl Exp $ * $Id: builtins.h,v 1.113 2000/06/05 07:29:07 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -33,108 +33,110 @@
* Defined in adt/ * Defined in adt/
*/ */
/* bool.c */ /* bool.c */
extern bool boolin(char *b); extern Datum boolin(PG_FUNCTION_ARGS);
extern char *boolout(bool b); extern Datum boolout(PG_FUNCTION_ARGS);
extern bool booleq(bool arg1, bool arg2); extern Datum booleq(PG_FUNCTION_ARGS);
extern bool boolne(bool arg1, bool arg2); extern Datum boolne(PG_FUNCTION_ARGS);
extern bool boollt(bool arg1, bool arg2); extern Datum boollt(PG_FUNCTION_ARGS);
extern bool boolgt(bool arg1, bool arg2); extern Datum boolgt(PG_FUNCTION_ARGS);
extern bool boolle(bool arg1, bool arg2); extern Datum boolle(PG_FUNCTION_ARGS);
extern bool boolge(bool arg1, bool arg2); extern Datum boolge(PG_FUNCTION_ARGS);
extern bool istrue(bool arg1); extern Datum istrue(PG_FUNCTION_ARGS);
extern bool isfalse(bool arg1); extern Datum isfalse(PG_FUNCTION_ARGS);
extern Datum isnottrue(PG_FUNCTION_ARGS);
extern Datum isnotfalse(PG_FUNCTION_ARGS);
/* char.c */ /* char.c */
extern int32 charin(char *ch); extern Datum charin(PG_FUNCTION_ARGS);
extern char *charout(int32 ch); extern Datum charout(PG_FUNCTION_ARGS);
extern int32 cidin(char *s); extern Datum chareq(PG_FUNCTION_ARGS);
extern char *cidout(int32 c); extern Datum charne(PG_FUNCTION_ARGS);
extern bool chareq(int8 arg1, int8 arg2); extern Datum charlt(PG_FUNCTION_ARGS);
extern bool charne(int8 arg1, int8 arg2); extern Datum charle(PG_FUNCTION_ARGS);
extern bool charlt(int8 arg1, int8 arg2); extern Datum chargt(PG_FUNCTION_ARGS);
extern bool charle(int8 arg1, int8 arg2); extern Datum charge(PG_FUNCTION_ARGS);
extern bool chargt(int8 arg1, int8 arg2); extern Datum charpl(PG_FUNCTION_ARGS);
extern bool charge(int8 arg1, int8 arg2); extern Datum charmi(PG_FUNCTION_ARGS);
extern int8 charpl(int8 arg1, int8 arg2); extern Datum charmul(PG_FUNCTION_ARGS);
extern int8 charmi(int8 arg1, int8 arg2); extern Datum chardiv(PG_FUNCTION_ARGS);
extern int8 charmul(int8 arg1, int8 arg2); extern Datum text_char(PG_FUNCTION_ARGS);
extern int8 chardiv(int8 arg1, int8 arg2); extern Datum char_text(PG_FUNCTION_ARGS);
extern bool cideq(int8 arg1, int8 arg2); extern Datum cidin(PG_FUNCTION_ARGS);
extern int8 text_char(text *arg1); extern Datum cidout(PG_FUNCTION_ARGS);
extern text *char_text(int8 arg1); extern Datum cideq(PG_FUNCTION_ARGS);
/* int.c */ /* int.c */
extern int32 int2in(char *num); extern Datum int2in(PG_FUNCTION_ARGS);
extern char *int2out(int16 sh); extern Datum int2out(PG_FUNCTION_ARGS);
extern int16 *int2vectorin(char *shs); extern Datum int2vectorin(PG_FUNCTION_ARGS);
extern char *int2vectorout(int16 *shs); extern Datum int2vectorout(PG_FUNCTION_ARGS);
extern bool int2vectoreq(int16 *arg1, int16 *arg2); extern Datum int2vectoreq(PG_FUNCTION_ARGS);
extern int32 *int44in(char *input_string); extern Datum int44in(PG_FUNCTION_ARGS);
extern char *int44out(int32 *an_array); extern Datum int44out(PG_FUNCTION_ARGS);
extern int32 int4in(char *num); extern Datum int4in(PG_FUNCTION_ARGS);
extern char *int4out(int32 l); extern Datum int4out(PG_FUNCTION_ARGS);
extern int32 i2toi4(int16 arg1); extern Datum i2toi4(PG_FUNCTION_ARGS);
extern int16 i4toi2(int32 arg1); extern Datum i4toi2(PG_FUNCTION_ARGS);
extern text *int2_text(int16 arg1); extern Datum int2_text(PG_FUNCTION_ARGS);
extern int16 text_int2(text *arg1); extern Datum text_int2(PG_FUNCTION_ARGS);
extern text *int4_text(int32 arg1); extern Datum int4_text(PG_FUNCTION_ARGS);
extern int32 text_int4(text *arg1); extern Datum text_int4(PG_FUNCTION_ARGS);
extern bool int4eq(int32 arg1, int32 arg2); extern Datum int4eq(PG_FUNCTION_ARGS);
extern bool int4ne(int32 arg1, int32 arg2); extern Datum int4ne(PG_FUNCTION_ARGS);
extern bool int4lt(int32 arg1, int32 arg2); extern Datum int4lt(PG_FUNCTION_ARGS);
extern bool int4le(int32 arg1, int32 arg2); extern Datum int4le(PG_FUNCTION_ARGS);
extern bool int4gt(int32 arg1, int32 arg2); extern Datum int4gt(PG_FUNCTION_ARGS);
extern bool int4ge(int32 arg1, int32 arg2); extern Datum int4ge(PG_FUNCTION_ARGS);
extern bool int2eq(int16 arg1, int16 arg2); extern Datum int2eq(PG_FUNCTION_ARGS);
extern bool int2ne(int16 arg1, int16 arg2); extern Datum int2ne(PG_FUNCTION_ARGS);
extern bool int2lt(int16 arg1, int16 arg2); extern Datum int2lt(PG_FUNCTION_ARGS);
extern bool int2le(int16 arg1, int16 arg2); extern Datum int2le(PG_FUNCTION_ARGS);
extern bool int2gt(int16 arg1, int16 arg2); extern Datum int2gt(PG_FUNCTION_ARGS);
extern bool int2ge(int16 arg1, int16 arg2); extern Datum int2ge(PG_FUNCTION_ARGS);
extern bool int24eq(int32 arg1, int32 arg2); extern Datum int24eq(PG_FUNCTION_ARGS);
extern bool int24ne(int32 arg1, int32 arg2); extern Datum int24ne(PG_FUNCTION_ARGS);
extern bool int24lt(int32 arg1, int32 arg2); extern Datum int24lt(PG_FUNCTION_ARGS);
extern bool int24le(int32 arg1, int32 arg2); extern Datum int24le(PG_FUNCTION_ARGS);
extern bool int24gt(int32 arg1, int32 arg2); extern Datum int24gt(PG_FUNCTION_ARGS);
extern bool int24ge(int32 arg1, int32 arg2); extern Datum int24ge(PG_FUNCTION_ARGS);
extern bool int42eq(int32 arg1, int32 arg2); extern Datum int42eq(PG_FUNCTION_ARGS);
extern bool int42ne(int32 arg1, int32 arg2); extern Datum int42ne(PG_FUNCTION_ARGS);
extern bool int42lt(int32 arg1, int32 arg2); extern Datum int42lt(PG_FUNCTION_ARGS);
extern bool int42le(int32 arg1, int32 arg2); extern Datum int42le(PG_FUNCTION_ARGS);
extern bool int42gt(int32 arg1, int32 arg2); extern Datum int42gt(PG_FUNCTION_ARGS);
extern bool int42ge(int32 arg1, int32 arg2); extern Datum int42ge(PG_FUNCTION_ARGS);
extern int32 int4um(int32 arg); extern Datum int4um(PG_FUNCTION_ARGS);
extern int32 int4pl(int32 arg1, int32 arg2); extern Datum int4pl(PG_FUNCTION_ARGS);
extern int32 int4mi(int32 arg1, int32 arg2); extern Datum int4mi(PG_FUNCTION_ARGS);
extern int32 int4mul(int32 arg1, int32 arg2); extern Datum int4mul(PG_FUNCTION_ARGS);
extern int32 int4div(int32 arg1, int32 arg2); extern Datum int4div(PG_FUNCTION_ARGS);
extern int32 int4abs(int32 arg); extern Datum int4abs(PG_FUNCTION_ARGS);
extern int32 int4inc(int32 arg); extern Datum int4inc(PG_FUNCTION_ARGS);
extern int16 int2um(int16 arg); extern Datum int2um(PG_FUNCTION_ARGS);
extern int16 int2pl(int16 arg1, int16 arg2); extern Datum int2pl(PG_FUNCTION_ARGS);
extern int16 int2mi(int16 arg1, int16 arg2); extern Datum int2mi(PG_FUNCTION_ARGS);
extern int16 int2mul(int16 arg1, int16 arg2); extern Datum int2mul(PG_FUNCTION_ARGS);
extern int16 int2div(int16 arg1, int16 arg2); extern Datum int2div(PG_FUNCTION_ARGS);
extern int16 int2abs(int16 arg); extern Datum int2abs(PG_FUNCTION_ARGS);
extern int16 int2inc(int16 arg); extern Datum int2inc(PG_FUNCTION_ARGS);
extern int32 int24pl(int32 arg1, int32 arg2); extern Datum int24pl(PG_FUNCTION_ARGS);
extern int32 int24mi(int32 arg1, int32 arg2); extern Datum int24mi(PG_FUNCTION_ARGS);
extern int32 int24mul(int32 arg1, int32 arg2); extern Datum int24mul(PG_FUNCTION_ARGS);
extern int32 int24div(int32 arg1, int32 arg2); extern Datum int24div(PG_FUNCTION_ARGS);
extern int32 int42pl(int32 arg1, int32 arg2); extern Datum int42pl(PG_FUNCTION_ARGS);
extern int32 int42mi(int32 arg1, int32 arg2); extern Datum int42mi(PG_FUNCTION_ARGS);
extern int32 int42mul(int32 arg1, int32 arg2); extern Datum int42mul(PG_FUNCTION_ARGS);
extern int32 int42div(int32 arg1, int32 arg2); extern Datum int42div(PG_FUNCTION_ARGS);
extern int32 int4mod(int32 arg1, int32 arg2); extern Datum int4mod(PG_FUNCTION_ARGS);
extern int32 int2mod(int16 arg1, int16 arg2); extern Datum int2mod(PG_FUNCTION_ARGS);
extern int32 int24mod(int32 arg1, int32 arg2); extern Datum int24mod(PG_FUNCTION_ARGS);
extern int32 int42mod(int32 arg1, int32 arg2); extern Datum int42mod(PG_FUNCTION_ARGS);
extern int32 int4fac(int32 arg1); extern Datum int4fac(PG_FUNCTION_ARGS);
extern int32 int2fac(int16 arg1); extern Datum int2fac(PG_FUNCTION_ARGS);
extern int16 int2larger(int16 arg1, int16 arg2); extern Datum int2larger(PG_FUNCTION_ARGS);
extern int16 int2smaller(int16 arg1, int16 arg2); extern Datum int2smaller(PG_FUNCTION_ARGS);
extern int32 int4larger(int32 arg1, int32 arg2); extern Datum int4larger(PG_FUNCTION_ARGS);
extern int32 int4smaller(int32 arg1, int32 arg2); extern Datum int4smaller(PG_FUNCTION_ARGS);
/* name.c */ /* name.c */
extern NameData *namein(const char *s); extern NameData *namein(const char *s);
@ -168,20 +170,20 @@ extern void ltoa(int32 l, char *a);
* Per-opclass comparison functions for new btrees. These are * Per-opclass comparison functions for new btrees. These are
* stored in pg_amproc and defined in nbtree/ * stored in pg_amproc and defined in nbtree/
*/ */
extern int32 btint2cmp(int16 a, int16 b); extern Datum btboolcmp(PG_FUNCTION_ARGS);
extern int32 btint4cmp(int32 a, int32 b); extern Datum btint2cmp(PG_FUNCTION_ARGS);
extern int32 btint8cmp(int64 *a, int64 *b); extern Datum btint4cmp(PG_FUNCTION_ARGS);
extern int32 btint24cmp(int16 a, int32 b); extern Datum btint8cmp(PG_FUNCTION_ARGS);
extern int32 btint42cmp(int32 a, int16 b); extern Datum btint24cmp(PG_FUNCTION_ARGS);
extern int32 btfloat4cmp(float32 a, float32 b); extern Datum btint42cmp(PG_FUNCTION_ARGS);
extern int32 btfloat8cmp(float64 a, float64 b); extern Datum btfloat4cmp(PG_FUNCTION_ARGS);
extern int32 btoidcmp(Oid a, Oid b); extern Datum btfloat8cmp(PG_FUNCTION_ARGS);
extern int32 btoidvectorcmp(Oid *a, Oid *b); extern Datum btoidcmp(PG_FUNCTION_ARGS);
extern Datum btoidvectorcmp(PG_FUNCTION_ARGS);
extern int32 btabstimecmp(AbsoluteTime a, AbsoluteTime b); extern int32 btabstimecmp(AbsoluteTime a, AbsoluteTime b);
extern int32 btcharcmp(char a, char b); extern Datum btcharcmp(PG_FUNCTION_ARGS);
extern int32 btnamecmp(NameData *a, NameData *b); extern Datum btnamecmp(PG_FUNCTION_ARGS);
extern int32 bttextcmp(struct varlena * a, struct varlena * b); extern Datum bttextcmp(PG_FUNCTION_ARGS);
extern int32 btboolcmp(bool a, bool b);
/* support routines for the rtree access method, by opclass */ /* support routines for the rtree access method, by opclass */
extern BOX *rt_box_union(BOX *a, BOX *b); extern BOX *rt_box_union(BOX *a, BOX *b);
@ -244,14 +246,14 @@ extern bool float8gt(float64 arg1, float64 arg2);
extern bool float8ge(float64 arg1, float64 arg2); extern bool float8ge(float64 arg1, float64 arg2);
extern float64 ftod(float32 num); extern float64 ftod(float32 num);
extern float64 i4tod(int32 num); extern float64 i4tod(int32 num);
extern float64 i2tod(int16 num); extern Datum i2tod(PG_FUNCTION_ARGS);
extern float32 dtof(float64 num); extern float32 dtof(float64 num);
extern int32 dtoi4(float64 num); extern int32 dtoi4(float64 num);
extern int16 dtoi2(float64 num); extern Datum dtoi2(PG_FUNCTION_ARGS);
extern float32 i4tof(int32 num); extern float32 i4tof(int32 num);
extern float32 i2tof(int16 num); extern Datum i2tof(PG_FUNCTION_ARGS);
extern int32 ftoi4(float32 num); extern int32 ftoi4(float32 num);
extern int16 ftoi2(float32 num); extern Datum ftoi2(PG_FUNCTION_ARGS);
extern float64 text_float8(text *str); extern float64 text_float8(text *str);
extern float32 text_float4(text *str); extern float32 text_float4(text *str);
extern text *float8_text(float64 num); extern text *float8_text(float64 num);
@ -301,37 +303,33 @@ extern bool float84gt(float64 arg1, float32 arg2);
extern bool float84ge(float64 arg1, float32 arg2); extern bool float84ge(float64 arg1, float32 arg2);
/* misc.c */ /* misc.c */
extern bool nullvalue(Datum value, bool *isNull); extern Datum nullvalue(PG_FUNCTION_ARGS);
extern bool nonnullvalue(Datum value, bool *isNull); extern Datum nonnullvalue(PG_FUNCTION_ARGS);
extern bool oidrand(Oid o, int32 X); extern Datum oidrand(PG_FUNCTION_ARGS);
extern bool oidsrand(int32 X); extern Datum oidsrand(PG_FUNCTION_ARGS);
extern int32 userfntest(int i); extern Datum userfntest(PG_FUNCTION_ARGS);
/* define macros to replace mixed-case function calls - tgl 97/04/27 */
#define NullValue(v,b) nullvalue(v,b)
#define NonNullValue(v,b) nonnullvalue(v,b)
/* not_in.c */ /* not_in.c */
extern bool int4notin(int32 not_in_arg, char *relation_and_attr); extern bool int4notin(int32 not_in_arg, char *relation_and_attr);
extern bool oidnotin(Oid the_oid, char *compare); extern bool oidnotin(Oid the_oid, char *compare);
/* oid.c */ /* oid.c */
extern Oid *oidvectorin(char *oidString); extern Datum oidvectorin(PG_FUNCTION_ARGS);
extern char *oidvectorout(Oid *oidArray); extern Datum oidvectorout(PG_FUNCTION_ARGS);
extern Oid oidin(char *s); extern Datum oidin(PG_FUNCTION_ARGS);
extern char *oidout(Oid o); extern Datum oidout(PG_FUNCTION_ARGS);
extern bool oideq(Oid arg1, Oid arg2); extern Datum oideq(PG_FUNCTION_ARGS);
extern bool oidne(Oid arg1, Oid arg2); extern Datum oidne(PG_FUNCTION_ARGS);
extern bool oidvectoreq(Oid *arg1, Oid *arg2); extern Datum oidvectoreq(PG_FUNCTION_ARGS);
extern bool oidvectorne(Oid *arg1, Oid *arg2); extern Datum oidvectorne(PG_FUNCTION_ARGS);
extern bool oidvectorlt(Oid *arg1, Oid *arg2); extern Datum oidvectorlt(PG_FUNCTION_ARGS);
extern bool oidvectorle(Oid *arg1, Oid *arg2); extern Datum oidvectorle(PG_FUNCTION_ARGS);
extern bool oidvectorge(Oid *arg1, Oid *arg2); extern Datum oidvectorge(PG_FUNCTION_ARGS);
extern bool oidvectorgt(Oid *arg1, Oid *arg2); extern Datum oidvectorgt(PG_FUNCTION_ARGS);
extern bool oideqint4(Oid arg1, int32 arg2); extern Datum oideqint4(PG_FUNCTION_ARGS);
extern bool int4eqoid(int32 arg1, Oid arg2); extern Datum int4eqoid(PG_FUNCTION_ARGS);
extern text *oid_text(Oid arg1); extern Datum oid_text(PG_FUNCTION_ARGS);
extern Oid text_oid(text *arg1); extern Datum text_oid(PG_FUNCTION_ARGS);
/* regexp.c */ /* regexp.c */
extern bool nameregexeq(NameData *n, struct varlena * p); extern bool nameregexeq(NameData *n, struct varlena * p);
@ -345,13 +343,13 @@ extern bool texticregexne(struct varlena * s, struct varlena * p);
/* regproc.c */ /* regproc.c */
extern int32 regprocin(char *pro_name_and_oid); extern Datum regprocin(PG_FUNCTION_ARGS);
extern char *regprocout(RegProcedure proid); extern Datum regprocout(PG_FUNCTION_ARGS);
extern text *oidvectortypes(Oid *oidArray); extern Datum oidvectortypes(PG_FUNCTION_ARGS);
extern Oid regproctooid(RegProcedure rp); extern Datum regproctooid(PG_FUNCTION_ARGS);
/* define macro to replace mixed-case function call - tgl 97/04/27 */ /* define macro to replace mixed-case function call - tgl 97/04/27 */
#define RegprocToOid(rp) regproctooid(rp) #define RegprocToOid(rp) ((Oid) (rp))
/* ruleutils.c */ /* ruleutils.c */
extern text *pg_get_ruledef(NameData *rname); extern text *pg_get_ruledef(NameData *rname);
@ -362,69 +360,34 @@ extern char *deparse_expression(Node *expr, List *rangetables,
bool forceprefix); bool forceprefix);
/* selfuncs.c */ /* selfuncs.c */
extern float64 eqsel(Oid opid, Oid relid, AttrNumber attno, extern Datum eqsel(PG_FUNCTION_ARGS);
Datum value, int32 flag); extern Datum neqsel(PG_FUNCTION_ARGS);
extern float64 neqsel(Oid opid, Oid relid, AttrNumber attno, extern Datum scalarltsel(PG_FUNCTION_ARGS);
Datum value, int32 flag); extern Datum scalargtsel(PG_FUNCTION_ARGS);
extern float64 scalarltsel(Oid opid, Oid relid, AttrNumber attno, extern Datum regexeqsel(PG_FUNCTION_ARGS);
Datum value, int32 flag); extern Datum icregexeqsel(PG_FUNCTION_ARGS);
extern float64 scalargtsel(Oid opid, Oid relid, AttrNumber attno, extern Datum likesel(PG_FUNCTION_ARGS);
Datum value, int32 flag); extern Datum regexnesel(PG_FUNCTION_ARGS);
extern float64 regexeqsel(Oid opid, Oid relid, AttrNumber attno, extern Datum icregexnesel(PG_FUNCTION_ARGS);
Datum value, int32 flag); extern Datum nlikesel(PG_FUNCTION_ARGS);
extern float64 likesel(Oid opid, Oid relid, AttrNumber attno,
Datum value, int32 flag);
extern float64 icregexeqsel(Oid opid, Oid relid, AttrNumber attno,
Datum value, int32 flag);
extern float64 regexnesel(Oid opid, Oid relid, AttrNumber attno,
Datum value, int32 flag);
extern float64 nlikesel(Oid opid, Oid relid, AttrNumber attno,
Datum value, int32 flag);
extern float64 icregexnesel(Oid opid, Oid relid, AttrNumber attno,
Datum value, int32 flag);
extern float64 eqjoinsel(Oid opid, Oid relid1, AttrNumber attno1, extern Datum eqjoinsel(PG_FUNCTION_ARGS);
Oid relid2, AttrNumber attno2); extern Datum neqjoinsel(PG_FUNCTION_ARGS);
extern float64 neqjoinsel(Oid opid, Oid relid1, AttrNumber attno1, extern Datum scalarltjoinsel(PG_FUNCTION_ARGS);
Oid relid2, AttrNumber attno2); extern Datum scalargtjoinsel(PG_FUNCTION_ARGS);
extern float64 scalarltjoinsel(Oid opid, Oid relid1, AttrNumber attno1, extern Datum regexeqjoinsel(PG_FUNCTION_ARGS);
Oid relid2, AttrNumber attno2); extern Datum icregexeqjoinsel(PG_FUNCTION_ARGS);
extern float64 scalargtjoinsel(Oid opid, Oid relid1, AttrNumber attno1, extern Datum likejoinsel(PG_FUNCTION_ARGS);
Oid relid2, AttrNumber attno2); extern Datum regexnejoinsel(PG_FUNCTION_ARGS);
extern float64 regexeqjoinsel(Oid opid, Oid relid1, AttrNumber attno1, extern Datum icregexnejoinsel(PG_FUNCTION_ARGS);
Oid relid2, AttrNumber attno2); extern Datum nlikejoinsel(PG_FUNCTION_ARGS);
extern float64 likejoinsel(Oid opid, Oid relid1, AttrNumber attno1,
Oid relid2, AttrNumber attno2);
extern float64 icregexeqjoinsel(Oid opid, Oid relid1, AttrNumber attno1,
Oid relid2, AttrNumber attno2);
extern float64 regexnejoinsel(Oid opid, Oid relid1, AttrNumber attno1,
Oid relid2, AttrNumber attno2);
extern float64 nlikejoinsel(Oid opid, Oid relid1, AttrNumber attno1,
Oid relid2, AttrNumber attno2);
extern float64 icregexnejoinsel(Oid opid, Oid relid1, AttrNumber attno1,
Oid relid2, AttrNumber attno2);
extern void btcostestimate(Query *root, RelOptInfo *rel, extern Datum btcostestimate(PG_FUNCTION_ARGS);
IndexOptInfo *index, List *indexQuals, extern Datum rtcostestimate(PG_FUNCTION_ARGS);
Cost *indexStartupCost, extern Datum hashcostestimate(PG_FUNCTION_ARGS);
Cost *indexTotalCost, extern Datum gistcostestimate(PG_FUNCTION_ARGS);
Selectivity *indexSelectivity);
extern void rtcostestimate(Query *root, RelOptInfo *rel,
IndexOptInfo *index, List *indexQuals,
Cost *indexStartupCost,
Cost *indexTotalCost,
Selectivity *indexSelectivity);
extern void hashcostestimate(Query *root, RelOptInfo *rel,
IndexOptInfo *index, List *indexQuals,
Cost *indexStartupCost,
Cost *indexTotalCost,
Selectivity *indexSelectivity);
extern void gistcostestimate(Query *root, RelOptInfo *rel,
IndexOptInfo *index, List *indexQuals,
Cost *indexStartupCost,
Cost *indexTotalCost,
Selectivity *indexSelectivity);
/* selfuncs.c supporting routines that are also used by optimizer code */
typedef enum typedef enum
{ {
Pattern_Type_Like, Pattern_Type_Regex, Pattern_Type_Regex_IC Pattern_Type_Like, Pattern_Type_Regex, Pattern_Type_Regex_IC
@ -452,12 +415,19 @@ extern ItemPointer currtid_byreloid(Oid relOid, ItemPointer);
extern ItemPointer currtid_byrelname(const text *relName, ItemPointer); extern ItemPointer currtid_byrelname(const text *relName, ItemPointer);
/* varchar.c */ /* varchar.c */
/* bpchar and varchar are just a varlena header and some characters */
#define PG_GETARG_BPCHAR_P(n) ((struct varlena *) PG_GETARG_VARLENA_P(n))
#define PG_RETURN_BPCHAR_P(x) PG_RETURN_POINTER(x)
#define PG_GETARG_VARCHAR_P(n) ((struct varlena *) PG_GETARG_VARLENA_P(n))
#define PG_RETURN_VARCHAR_P(x) PG_RETURN_POINTER(x)
extern char *bpcharin(char *s, int dummy, int32 atttypmod); extern char *bpcharin(char *s, int dummy, int32 atttypmod);
extern char *bpcharout(char *s); extern char *bpcharout(char *s);
extern char *bpchar(char *s, int32 slen); extern char *bpchar(char *s, int32 slen);
extern ArrayType *_bpchar(ArrayType *v, int32 slen); extern ArrayType *_bpchar(ArrayType *v, int32 slen);
extern char *char_bpchar(int32 c); extern Datum char_bpchar(PG_FUNCTION_ARGS);
extern int32 bpchar_char(char *s); extern Datum bpchar_char(PG_FUNCTION_ARGS);
extern char *name_bpchar(NameData *s); extern char *name_bpchar(NameData *s);
extern NameData *bpchar_name(char *s); extern NameData *bpchar_name(char *s);
extern bool bpchareq(char *arg1, char *arg2); extern bool bpchareq(char *arg1, char *arg2);
@ -616,8 +586,8 @@ extern Numeric int4_numeric(int32 val);
extern int32 numeric_int4(Numeric num); extern int32 numeric_int4(Numeric num);
extern Numeric int8_numeric(int64 *val); extern Numeric int8_numeric(int64 *val);
extern int64 *numeric_int8(Numeric num); extern int64 *numeric_int8(Numeric num);
extern Numeric int2_numeric(int16 val); extern Datum int2_numeric(PG_FUNCTION_ARGS);
extern int16 numeric_int2(Numeric num); extern Datum numeric_int2(PG_FUNCTION_ARGS);
extern Numeric float4_numeric(float32 val); extern Numeric float4_numeric(float32 val);
extern float32 numeric_float4(Numeric num); extern float32 numeric_float4(Numeric num);
extern Numeric float8_numeric(float64 val); extern Numeric float8_numeric(float64 val);

View File

@ -37,9 +37,9 @@ extern Cash *cash_mul_int4(Cash *c, int4 i);
extern Cash *cash_div_int4(Cash *c, int4 i); extern Cash *cash_div_int4(Cash *c, int4 i);
extern Cash *int4_mul_cash(int4 i, Cash *c); extern Cash *int4_mul_cash(int4 i, Cash *c);
extern Cash *cash_mul_int2(Cash *c, int2 s); extern Datum cash_mul_int2(PG_FUNCTION_ARGS);
extern Cash *cash_div_int2(Cash *c, int2 s); extern Datum int2_mul_cash(PG_FUNCTION_ARGS);
extern Cash *int2_mul_cash(int2 s, Cash *c); extern Datum cash_div_int2(PG_FUNCTION_ARGS);
extern Cash *cashlarger(Cash *c1, Cash *c2); extern Cash *cashlarger(Cash *c1, Cash *c2);
extern Cash *cashsmaller(Cash *c1, Cash *c2); extern Cash *cashsmaller(Cash *c1, Cash *c2);

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: catcache.h,v 1.21 2000/04/12 17:16:54 momjian Exp $ * $Id: catcache.h,v 1.22 2000/06/05 07:29:07 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -17,6 +17,7 @@
/* #define CACHEDEBUG turns DEBUG elogs on */ /* #define CACHEDEBUG turns DEBUG elogs on */
#include "access/htup.h" #include "access/htup.h"
#include "fmgr.h"
#include "lib/dllist.h" #include "lib/dllist.h"
/* /*
@ -40,7 +41,6 @@ typedef struct catctup
#define NCCBUCK 500 /* CatCache buckets */ #define NCCBUCK 500 /* CatCache buckets */
#define MAXTUP 300 /* Maximum # of tuples cached per cache */ #define MAXTUP 300 /* Maximum # of tuples cached per cache */
typedef uint32 (*CCHashFunc) (Datum);
typedef struct catcache typedef struct catcache
{ {
@ -57,7 +57,7 @@ typedef struct catcache
short cc_nkeys; short cc_nkeys;
short cc_size; short cc_size;
short cc_key[4]; /* AttrNumber of each key */ short cc_key[4]; /* AttrNumber of each key */
CCHashFunc cc_hashfunc[4]; /* hash function to use for each key */ PGFunction cc_hashfunc[4]; /* hash function to use for each key */
ScanKeyData cc_skey[4]; ScanKeyData cc_skey[4];
struct catcache *cc_next; struct catcache *cc_next;
Dllist *cc_lrulist; /* LRU list, most recent first */ Dllist *cc_lrulist; /* LRU list, most recent first */

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: geo_decls.h,v 1.27 2000/04/12 17:16:55 momjian Exp $ * $Id: geo_decls.h,v 1.28 2000/06/05 07:29:07 tgl Exp $
* *
* NOTE * NOTE
* These routines do *not* use the float types from adt/. * These routines do *not* use the float types from adt/.
@ -22,6 +22,7 @@
#define GEO_DECLS_H #define GEO_DECLS_H
#include "access/attnum.h" #include "access/attnum.h"
#include "fmgr.h"
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
* Useful floating point utilities and constants. * Useful floating point utilities and constants.
@ -360,17 +361,11 @@ extern double *circle_area(CIRCLE *circle);
extern double circle_dt(CIRCLE *circle1, CIRCLE *circle2); extern double circle_dt(CIRCLE *circle1, CIRCLE *circle2);
/* geo_selfuncs.c */ /* geo_selfuncs.c */
extern float64 areasel(Oid opid, Oid relid, AttrNumber attno, extern Datum areasel(PG_FUNCTION_ARGS);
Datum value, int32 flag); extern Datum areajoinsel(PG_FUNCTION_ARGS);
extern float64 areajoinsel(Oid opid, Oid relid1, AttrNumber attno1, extern Datum positionsel(PG_FUNCTION_ARGS);
Oid relid2, AttrNumber attno2); extern Datum positionjoinsel(PG_FUNCTION_ARGS);
extern float64 positionsel(Oid opid, Oid relid, AttrNumber attno, extern Datum contsel(PG_FUNCTION_ARGS);
Datum value, int32 flag); extern Datum contjoinsel(PG_FUNCTION_ARGS);
extern float64 positionjoinsel(Oid opid, Oid relid1, AttrNumber attno1,
Oid relid2, AttrNumber attno2);
extern float64 contsel(Oid opid, Oid relid, AttrNumber attno,
Datum value, int32 flag);
extern float64 contjoinsel(Oid opid, Oid relid1, AttrNumber attno1,
Oid relid2, AttrNumber attno2);
#endif /* GEO_DECLS_H */ #endif /* GEO_DECLS_H */

View File

@ -33,7 +33,7 @@
* ENHANCEMENTS, OR MODIFICATIONS. * ENHANCEMENTS, OR MODIFICATIONS.
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.10 2000/05/30 04:24:57 tgl Exp $ * $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.11 2000/06/05 07:29:11 tgl Exp $
* *
**********************************************************************/ **********************************************************************/
@ -858,7 +858,8 @@ plperl_trigger_handler(PG_FUNCTION_ARGS)
Tcl_DStringAppendElement(&tcl_cmd, trigdata->tg_trigger->tgname); Tcl_DStringAppendElement(&tcl_cmd, trigdata->tg_trigger->tgname);
/* The oid of the trigger relation for argument TG_relid */ /* The oid of the trigger relation for argument TG_relid */
stroid = oidout(trigdata->tg_relation->rd_id); stroid = DatumGetCString(DirectFunctionCall1(oidout,
ObjectIdGetDatum(trigdata->tg_relation->rd_id)));
Tcl_DStringAppendElement(&tcl_cmd, stroid); Tcl_DStringAppendElement(&tcl_cmd, stroid);
pfree(stroid); pfree(stroid);

View File

@ -4,7 +4,7 @@
* procedural language * procedural language
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.9 2000/05/29 21:25:07 momjian Exp $ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.10 2000/06/05 07:29:14 tgl Exp $
* *
* This software is copyrighted by Jan Wieck - Hamburg. * This software is copyrighted by Jan Wieck - Hamburg.
* *
@ -433,7 +433,7 @@ decl_atttypmod :
decl_atttypmodval : T_NUMBER decl_atttypmodval : T_NUMBER
{ {
$$ = int2in(yytext) + VARHDRSZ; $$ = pg_atoi(yytext, sizeof(int16), '\0') + VARHDRSZ;
} }
; ;

View File

@ -31,7 +31,7 @@
* ENHANCEMENTS, OR MODIFICATIONS. * ENHANCEMENTS, OR MODIFICATIONS.
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.25 2000/05/30 04:24:59 tgl Exp $ * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.26 2000/06/05 07:29:13 tgl Exp $
* *
**********************************************************************/ **********************************************************************/
@ -905,7 +905,8 @@ pltcl_trigger_handler(PG_FUNCTION_ARGS)
Tcl_DStringAppendElement(&tcl_cmd, trigdata->tg_trigger->tgname); Tcl_DStringAppendElement(&tcl_cmd, trigdata->tg_trigger->tgname);
/* The oid of the trigger relation for argument TG_relid */ /* The oid of the trigger relation for argument TG_relid */
stroid = oidout(trigdata->tg_relation->rd_id); stroid = DatumGetCString(DirectFunctionCall1(oidout,
ObjectIdGetDatum(trigdata->tg_relation->rd_id)));
Tcl_DStringAppendElement(&tcl_cmd, stroid); Tcl_DStringAppendElement(&tcl_cmd, stroid);
pfree(stroid); pfree(stroid);

View File

@ -46,7 +46,7 @@ WHERE p1.oid != p2.oid AND
-----+---------+-----+--------- -----+---------+-----+---------
(0 rows) (0 rows)
-- Considering only built-in procs (prolang = 11), look for multiple uses -- Considering only built-in procs (prolang = 11/12), look for multiple uses
-- of the same internal function (ie, matching prosrc fields). It's OK to -- of the same internal function (ie, matching prosrc fields). It's OK to
-- have several entries with different pronames for the same internal function, -- have several entries with different pronames for the same internal function,
-- but conflicts in the number of arguments and other critical items should -- but conflicts in the number of arguments and other critical items should
@ -54,7 +54,9 @@ WHERE p1.oid != p2.oid AND
SELECT p1.oid, p1.proname, p2.oid, p2.proname SELECT p1.oid, p1.proname, p2.oid, p2.proname
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proisinh != p2.proisinh OR (p1.proisinh != p2.proisinh OR
p1.proistrusted != p2.proistrusted OR p1.proistrusted != p2.proistrusted OR
p1.proiscachable != p2.proiscachable OR p1.proiscachable != p2.proiscachable OR
@ -73,7 +75,9 @@ WHERE p1.oid != p2.oid AND
SELECT DISTINCT p1.prorettype, p2.prorettype SELECT DISTINCT p1.prorettype, p2.prorettype
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.prorettype < p2.prorettype); (p1.prorettype < p2.prorettype);
prorettype | prorettype prorettype | prorettype
------------+------------ ------------+------------
@ -84,7 +88,9 @@ WHERE p1.oid != p2.oid AND
SELECT DISTINCT p1.proargtypes[0], p2.proargtypes[0] SELECT DISTINCT p1.proargtypes[0], p2.proargtypes[0]
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proargtypes[0] < p2.proargtypes[0]); (p1.proargtypes[0] < p2.proargtypes[0]);
proargtypes | proargtypes proargtypes | proargtypes
-------------+------------- -------------+-------------
@ -95,7 +101,9 @@ WHERE p1.oid != p2.oid AND
SELECT DISTINCT p1.proargtypes[1], p2.proargtypes[1] SELECT DISTINCT p1.proargtypes[1], p2.proargtypes[1]
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proargtypes[1] < p2.proargtypes[1]); (p1.proargtypes[1] < p2.proargtypes[1]);
proargtypes | proargtypes proargtypes | proargtypes
-------------+------------- -------------+-------------
@ -104,7 +112,9 @@ WHERE p1.oid != p2.oid AND
SELECT DISTINCT p1.proargtypes[2], p2.proargtypes[2] SELECT DISTINCT p1.proargtypes[2], p2.proargtypes[2]
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proargtypes[2] < p2.proargtypes[2]); (p1.proargtypes[2] < p2.proargtypes[2]);
proargtypes | proargtypes proargtypes | proargtypes
-------------+------------- -------------+-------------
@ -113,7 +123,9 @@ WHERE p1.oid != p2.oid AND
SELECT DISTINCT p1.proargtypes[3], p2.proargtypes[3] SELECT DISTINCT p1.proargtypes[3], p2.proargtypes[3]
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proargtypes[3] < p2.proargtypes[3]); (p1.proargtypes[3] < p2.proargtypes[3]);
proargtypes | proargtypes proargtypes | proargtypes
-------------+------------- -------------+-------------
@ -122,7 +134,9 @@ WHERE p1.oid != p2.oid AND
SELECT DISTINCT p1.proargtypes[4], p2.proargtypes[4] SELECT DISTINCT p1.proargtypes[4], p2.proargtypes[4]
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proargtypes[4] < p2.proargtypes[4]); (p1.proargtypes[4] < p2.proargtypes[4]);
proargtypes | proargtypes proargtypes | proargtypes
-------------+------------- -------------+-------------
@ -131,7 +145,9 @@ WHERE p1.oid != p2.oid AND
SELECT DISTINCT p1.proargtypes[5], p2.proargtypes[5] SELECT DISTINCT p1.proargtypes[5], p2.proargtypes[5]
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proargtypes[5] < p2.proargtypes[5]); (p1.proargtypes[5] < p2.proargtypes[5]);
proargtypes | proargtypes proargtypes | proargtypes
-------------+------------- -------------+-------------
@ -140,7 +156,9 @@ WHERE p1.oid != p2.oid AND
SELECT DISTINCT p1.proargtypes[6], p2.proargtypes[6] SELECT DISTINCT p1.proargtypes[6], p2.proargtypes[6]
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proargtypes[6] < p2.proargtypes[6]); (p1.proargtypes[6] < p2.proargtypes[6]);
proargtypes | proargtypes proargtypes | proargtypes
-------------+------------- -------------+-------------
@ -149,7 +167,9 @@ WHERE p1.oid != p2.oid AND
SELECT DISTINCT p1.proargtypes[7], p2.proargtypes[7] SELECT DISTINCT p1.proargtypes[7], p2.proargtypes[7]
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proargtypes[7] < p2.proargtypes[7]); (p1.proargtypes[7] < p2.proargtypes[7]);
proargtypes | proargtypes proargtypes | proargtypes
-------------+------------- -------------+-------------

View File

@ -35,7 +35,7 @@ CREATE FUNCTION pt_in_widget(point, widget)
CREATE FUNCTION overpaid(emp) CREATE FUNCTION overpaid(emp)
RETURNS bool RETURNS bool
AS '_OBJWD_/regress_DLSUFFIX_' AS '_OBJWD_/regress_DLSUFFIX_'
LANGUAGE 'c'; LANGUAGE 'newC';
CREATE FUNCTION boxarea(box) CREATE FUNCTION boxarea(box)
RETURNS int4 RETURNS int4

View File

@ -27,7 +27,7 @@ CREATE FUNCTION pt_in_widget(point, widget)
CREATE FUNCTION overpaid(emp) CREATE FUNCTION overpaid(emp)
RETURNS bool RETURNS bool
AS '_OBJWD_/regress_DLSUFFIX_' AS '_OBJWD_/regress_DLSUFFIX_'
LANGUAGE 'c'; LANGUAGE 'newC';
CREATE FUNCTION boxarea(box) CREATE FUNCTION boxarea(box)
RETURNS int4 RETURNS int4
AS '_OBJWD_/regress_DLSUFFIX_' AS '_OBJWD_/regress_DLSUFFIX_'

View File

@ -1,5 +1,5 @@
/* /*
* $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.37 2000/05/29 01:59:15 tgl Exp $ * $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.38 2000/06/05 07:29:22 tgl Exp $
*/ */
#include <float.h> /* faked on sunos */ #include <float.h> /* faked on sunos */
@ -14,14 +14,14 @@
#define RDELIM ')' #define RDELIM ')'
#define DELIM ',' #define DELIM ','
typedef void *TUPLE; typedef TupleTableSlot *TUPLE;
extern double *regress_dist_ptpath(Point *pt, PATH *path); extern double *regress_dist_ptpath(Point *pt, PATH *path);
extern double *regress_path_dist(PATH *p1, PATH *p2); extern double *regress_path_dist(PATH *p1, PATH *p2);
extern PATH *poly2path(POLYGON *poly); extern PATH *poly2path(POLYGON *poly);
extern Point *interpt_pp(PATH *p1, PATH *p2); extern Point *interpt_pp(PATH *p1, PATH *p2);
extern void regress_lseg_construct(LSEG *lseg, Point *pt1, Point *pt2); extern void regress_lseg_construct(LSEG *lseg, Point *pt1, Point *pt2);
extern char overpaid(TUPLE tuple); extern Datum overpaid(PG_FUNCTION_ARGS);
extern int boxarea(BOX *box); extern int boxarea(BOX *box);
extern char *reverse_name(char *string); extern char *reverse_name(char *string);
@ -176,16 +176,17 @@ Point *pt2;
lseg->m = point_sl(pt1, pt2); lseg->m = point_sl(pt1, pt2);
} }
Datum
char overpaid(PG_FUNCTION_ARGS)
overpaid(tuple)
TUPLE tuple;
{ {
TUPLE tuple = (TUPLE) PG_GETARG_POINTER(0);
bool isnull; bool isnull;
long salary; long salary;
salary = (long) GetAttributeByName(tuple, "salary", &isnull); salary = (long) GetAttributeByName(tuple, "salary", &isnull);
return salary > 699; if (isnull)
PG_RETURN_NULL();
PG_RETURN_BOOL(salary > 699);
} }
/* New type "widget" /* New type "widget"
@ -395,13 +396,12 @@ funny_dup17(PG_FUNCTION_ARGS)
if (SPI_processed > 0) if (SPI_processed > 0)
{ {
selected = int4in( selected = DatumGetInt32(DirectFunctionCall1(int4in,
SPI_getvalue( CStringGetDatum(SPI_getvalue(
SPI_tuptable->vals[0], SPI_tuptable->vals[0],
SPI_tuptable->tupdesc, SPI_tuptable->tupdesc,
1 1
) ))));
);
} }
elog(NOTICE, "funny_dup17 (fired %s) on level %3d: %d/%d tuples inserted/selected", elog(NOTICE, "funny_dup17 (fired %s) on level %3d: %d/%d tuples inserted/selected",

View File

@ -44,7 +44,7 @@ WHERE p1.oid != p2.oid AND
p1.pronargs = p2.pronargs AND p1.pronargs = p2.pronargs AND
p1.proargtypes = p2.proargtypes; p1.proargtypes = p2.proargtypes;
-- Considering only built-in procs (prolang = 11), look for multiple uses -- Considering only built-in procs (prolang = 11/12), look for multiple uses
-- of the same internal function (ie, matching prosrc fields). It's OK to -- of the same internal function (ie, matching prosrc fields). It's OK to
-- have several entries with different pronames for the same internal function, -- have several entries with different pronames for the same internal function,
-- but conflicts in the number of arguments and other critical items should -- but conflicts in the number of arguments and other critical items should
@ -53,7 +53,9 @@ WHERE p1.oid != p2.oid AND
SELECT p1.oid, p1.proname, p2.oid, p2.proname SELECT p1.oid, p1.proname, p2.oid, p2.proname
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proisinh != p2.proisinh OR (p1.proisinh != p2.proisinh OR
p1.proistrusted != p2.proistrusted OR p1.proistrusted != p2.proistrusted OR
p1.proiscachable != p2.proiscachable OR p1.proiscachable != p2.proiscachable OR
@ -70,55 +72,73 @@ WHERE p1.oid != p2.oid AND
SELECT DISTINCT p1.prorettype, p2.prorettype SELECT DISTINCT p1.prorettype, p2.prorettype
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.prorettype < p2.prorettype); (p1.prorettype < p2.prorettype);
SELECT DISTINCT p1.proargtypes[0], p2.proargtypes[0] SELECT DISTINCT p1.proargtypes[0], p2.proargtypes[0]
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proargtypes[0] < p2.proargtypes[0]); (p1.proargtypes[0] < p2.proargtypes[0]);
SELECT DISTINCT p1.proargtypes[1], p2.proargtypes[1] SELECT DISTINCT p1.proargtypes[1], p2.proargtypes[1]
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proargtypes[1] < p2.proargtypes[1]); (p1.proargtypes[1] < p2.proargtypes[1]);
SELECT DISTINCT p1.proargtypes[2], p2.proargtypes[2] SELECT DISTINCT p1.proargtypes[2], p2.proargtypes[2]
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proargtypes[2] < p2.proargtypes[2]); (p1.proargtypes[2] < p2.proargtypes[2]);
SELECT DISTINCT p1.proargtypes[3], p2.proargtypes[3] SELECT DISTINCT p1.proargtypes[3], p2.proargtypes[3]
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proargtypes[3] < p2.proargtypes[3]); (p1.proargtypes[3] < p2.proargtypes[3]);
SELECT DISTINCT p1.proargtypes[4], p2.proargtypes[4] SELECT DISTINCT p1.proargtypes[4], p2.proargtypes[4]
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proargtypes[4] < p2.proargtypes[4]); (p1.proargtypes[4] < p2.proargtypes[4]);
SELECT DISTINCT p1.proargtypes[5], p2.proargtypes[5] SELECT DISTINCT p1.proargtypes[5], p2.proargtypes[5]
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proargtypes[5] < p2.proargtypes[5]); (p1.proargtypes[5] < p2.proargtypes[5]);
SELECT DISTINCT p1.proargtypes[6], p2.proargtypes[6] SELECT DISTINCT p1.proargtypes[6], p2.proargtypes[6]
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proargtypes[6] < p2.proargtypes[6]); (p1.proargtypes[6] < p2.proargtypes[6]);
SELECT DISTINCT p1.proargtypes[7], p2.proargtypes[7] SELECT DISTINCT p1.proargtypes[7], p2.proargtypes[7]
FROM pg_proc AS p1, pg_proc AS p2 FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid != p2.oid AND WHERE p1.oid != p2.oid AND
p1.prosrc = p2.prosrc AND p1.prolang = 11 AND p2.prolang = 11 AND p1.prosrc = p2.prosrc AND
(p1.prolang = 11 OR p1.prolang = 12) AND
(p2.prolang = 11 OR p2.prolang = 12) AND
(p1.proargtypes[7] < p2.proargtypes[7]); (p1.proargtypes[7] < p2.proargtypes[7]);
-- **************** pg_operator **************** -- **************** pg_operator ****************