From 7b2b779a2a00adef83ec530399aece723610d90c Mon Sep 17 00:00:00 2001 From: Bruce Momjian <bruce@momjian.us> Date: Sat, 18 Jul 1998 18:34:34 +0000 Subject: [PATCH] Add auto-size to screen to \d? commands. Use UNION to show all \d? results in one query. Add \d? field search feature. Rename MB to MULTIBYTE. --- src/backend/access/common/printtup.c | 10 +- src/backend/commands/mbutils.c | 18 +- src/backend/commands/variable.c | 14 +- src/backend/libpq/pqcomm.c | 12 +- src/backend/regex/engine.c | 14 +- src/backend/regex/regcomp.c | 34 +-- src/backend/regex/regerror.c | 2 +- src/backend/regex/regexec.c | 4 +- src/backend/regex/regfree.c | 2 +- src/backend/regex/utils.c | 8 +- src/backend/tcop/postgres.c | 8 +- src/backend/utils/adt/like.c | 6 +- src/backend/utils/adt/varchar.c | 10 +- src/backend/utils/adt/varlena.c | 20 +- src/bin/psql/psql.c | 410 +++++++++++++++------------ src/bin/psql/psqlHelp.h | 8 +- src/include/catalog/pg_proc.h | 212 +++++++------- src/include/commands/variable.h | 4 +- src/include/libpq/libpq.h | 4 +- src/include/regex/pg_wchar.h | 8 +- src/include/regex/regex.h | 2 +- src/include/regex/regex2.h | 14 +- src/include/regex/utils.h | 2 +- src/interfaces/libpq/fe-connect.c | 4 +- src/interfaces/libpq/fe-print.c | 10 +- src/interfaces/libpq/libpq-fe.h | 4 +- 26 files changed, 452 insertions(+), 392 deletions(-) diff --git a/src/backend/access/common/printtup.c b/src/backend/access/common/printtup.c index ccebe243825..37a45b4cc6b 100644 --- a/src/backend/access/common/printtup.c +++ b/src/backend/access/common/printtup.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.29 1998/06/16 07:29:18 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.30 1998/07/18 18:34:01 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -23,7 +23,7 @@ #include <libpq/libpq.h> #include <utils/syscache.h> -#ifdef MB +#ifdef MULTIBYTE #include <commands/variable.h> #endif @@ -84,7 +84,7 @@ printtup(HeapTuple tuple, TupleDesc typeinfo) Datum attr; bool isnull; Oid typoutput; -#ifdef MB +#ifdef MULTIBYTE unsigned char *p; #endif @@ -132,7 +132,7 @@ printtup(HeapTuple tuple, TupleDesc typeinfo) outputstr = fmgr(typoutput, attr, gettypelem(typeinfo->attrs[i]->atttypid), typeinfo->attrs[i]->atttypmod); -#ifdef MB +#ifdef MULTIBYTE p = pg_server_to_client(outputstr, strlen(outputstr)); pq_putint(strlen(p) + VARHDRSZ, VARHDRSZ); pq_putnchar(p, strlen(p)); @@ -281,7 +281,7 @@ printtup_internal(HeapTuple tuple, TupleDesc typeinfo) /* variable length, assume a varlena structure */ len = VARSIZE(attr) - VARHDRSZ; -#ifdef MB +#ifdef MULTIBYTE pq_putncharlen(VARDATA(attr), len); #else pq_putint(len, VARHDRSZ); diff --git a/src/backend/commands/mbutils.c b/src/backend/commands/mbutils.c index f1d81f42df9..86c72dfc265 100644 --- a/src/backend/commands/mbutils.c +++ b/src/backend/commands/mbutils.c @@ -2,7 +2,7 @@ * conversion between client encoding and server internal encoding * (currently mule internal code (mic) is used) * Tatsuo Ishii - * $Id: mbutils.c,v 1.1 1998/06/16 07:38:18 momjian Exp $ + * $Id: mbutils.c,v 1.2 1998/07/18 18:34:01 momjian Exp $ */ #include <stdio.h> #include <string.h> @@ -12,7 +12,7 @@ #include "regex/pg_wchar.h" #include "commands/variable.h" -static int client_encoding = MB; /* defalut client encoding is set to +static int client_encoding = MULTIBYTE; /* defalut client encoding is set to same as the server encoding */ /* * convert bogus chars that cannot be represented in the current encoding @@ -381,10 +381,10 @@ int pg_set_client_encoding(int encoding) { client_encoding = encoding; - if (client_encoding == MB) { /* server == client? */ + if (client_encoding == MULTIBYTE) { /* server == client? */ client_to_mic = client_from_mic = 0; server_to_mic = server_from_mic = 0; - } else if (MB == MULE_INTERNAL) { /* server == MULE_INETRNAL? */ + } else if (MULTIBYTE == MULE_INTERNAL) { /* server == MULE_INETRNAL? */ client_to_mic = get_enc_ent(encoding)->to_mic; client_from_mic = get_enc_ent(encoding)->from_mic; server_to_mic = server_from_mic = 0; @@ -393,16 +393,16 @@ int pg_set_client_encoding(int encoding) } } else if (encoding == MULE_INTERNAL) { /* client == MULE_INETRNAL? */ client_to_mic = client_from_mic = 0; - server_to_mic = get_enc_ent(MB)->to_mic; - server_from_mic = get_enc_ent(MB)->from_mic; + server_to_mic = get_enc_ent(MULTIBYTE)->to_mic; + server_from_mic = get_enc_ent(MULTIBYTE)->from_mic; if (server_to_mic == 0 || server_from_mic == 0) { return(-1); } } else { client_to_mic = get_enc_ent(encoding)->to_mic; client_from_mic = get_enc_ent(encoding)->from_mic; - server_to_mic = get_enc_ent(MB)->to_mic; - server_from_mic = get_enc_ent(MB)->from_mic; + server_to_mic = get_enc_ent(MULTIBYTE)->to_mic; + server_from_mic = get_enc_ent(MULTIBYTE)->from_mic; if (client_to_mic == 0 || client_from_mic == 0) { return(-1); } @@ -504,7 +504,7 @@ const char *pg_encoding_to_char(int encoding) return(p->name); } -#ifdef MBUTILSDEBUG +#ifdef MULTIBYTEUTILSDEBUG #include <stdio.h> main() diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index 51f9d871bdf..a4553e2d4e6 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -2,7 +2,7 @@ * Routines for handling of 'SET var TO', * 'SHOW var' and 'RESET var' statements. * - * $Id: variable.c,v 1.7 1998/06/16 07:29:21 momjian Exp $ + * $Id: variable.c,v 1.8 1998/07/18 18:34:01 momjian Exp $ * */ @@ -15,7 +15,7 @@ #include "commands/variable.h" #include "utils/builtins.h" #include "optimizer/internal.h" -#ifdef MB +#ifdef MULTIBYTE #include "regex/pg_wchar.h" #endif @@ -522,7 +522,7 @@ reset_timezone() return TRUE; } /* reset_timezone() */ -#ifdef MB +#ifdef MULTIBYTE /*-----------------------------------------------------------------------*/ bool parse_client_encoding(const char *value) @@ -535,7 +535,7 @@ parse_client_encoding(const char *value) } else { if (pg_set_client_encoding(encoding)) { elog(ERROR, "Conversion between %s and %s is not supported", - value, pg_encoding_to_char(MB)); + value, pg_encoding_to_char(MULTIBYTE)); } } return TRUE; @@ -558,10 +558,10 @@ reset_client_encoding() if (env) { encoding = pg_char_to_encoding(env); if (encoding < 0) { - encoding = MB; + encoding = MULTIBYTE; } } else { - encoding = MB; + encoding = MULTIBYTE; } pg_set_client_encoding(encoding); return TRUE; @@ -598,7 +598,7 @@ struct VariableParsers { "r_plans", parse_r_plans, show_r_plans, reset_r_plans }, -#ifdef MB +#ifdef MULTIBYTE { "client_encoding", parse_client_encoding, show_client_encoding, reset_client_encoding }, diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index 4c5b85b248b..6ba66d08758 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.48 1998/07/09 03:28:46 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.49 1998/07/18 18:34:03 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -67,7 +67,7 @@ #include "libpq/auth.h" #include "libpq/libpq.h" /* where the declarations go */ #include "storage/ipc.h" -#ifdef MB +#ifdef MULTIBYTE #include "commands/variable.h" #endif @@ -181,7 +181,7 @@ pq_getstr(char *s, int maxlen) { int c = '\0'; -#ifdef MB +#ifdef MULTIBYTE unsigned char *p, *ps; int len; @@ -199,7 +199,7 @@ pq_getstr(char *s, int maxlen) *s++ = c; *s = '\0'; -#ifdef MB +#ifdef MULTIBYTE p = pg_client_to_server(ps, len); if (ps != p) { /* actual conversion has been done? */ strcpy(ps, p); @@ -341,7 +341,7 @@ pq_getint(int b) void pq_putstr(char *s) { -#ifdef MB +#ifdef MULTIBYTE unsigned char *p; p = pg_server_to_client(s, strlen(s)); @@ -740,7 +740,7 @@ StreamOpen(char *hostName, short portName, Port *port) return (STATUS_OK); } -#ifdef MB +#ifdef MULTIBYTE void pq_putncharlen(char *s, int n) { diff --git a/src/backend/regex/engine.c b/src/backend/regex/engine.c index b95b6491eb6..43988b6dbd8 100644 --- a/src/backend/regex/engine.c +++ b/src/backend/regex/engine.c @@ -117,14 +117,14 @@ extern "C" #define EOW (BOL+5) #define CODEMAX (BOL+5) /* highest code used */ -#ifdef MB -# if MB == MULE_INTERNAL +#ifdef MULTIBYTE +# if MULTIBYTE == MULE_INTERNAL # define NONCHAR(c) ((c) > 16777216) /* 16777216 == 2^24 == 3 bytes */ # define NNONCHAR (CODEMAX-16777216) -# elif MB == EUC_JP || MB == EUC_CN || MB == EUC_KR || MB == EUC_TW +# elif MULTIBYTE == EUC_JP || MULTIBYTE == EUC_CN || MULTIBYTE == EUC_KR || MULTIBYTE == EUC_TW # define NONCHAR(c) ((c) > USHRT_MAX) # define NNONCHAR (CODEMAX-USHRT_MAX) -# elif MB == UNICODE +# elif MULTIBYTE == UNICODE # define NONCHAR(c) ((c) > USHRT_MAX) # define NNONCHAR (CODEMAX-USHRT_MAX) # else /* assume 1 byte code such as ISO8859-1 */ @@ -200,7 +200,7 @@ int eflags; else { start = string; -#ifdef MB +#ifdef MULTIBYTE stop = start + pg_wchar_strlen(start); #else stop = start + strlen(start); @@ -214,7 +214,7 @@ int eflags; { for (dp = start; dp < stop; dp++) if (*dp == g->must[0] && stop - dp >= g->mlen && -#ifdef MB +#ifdef MULTIBYTE memcmp(dp, g->must, (size_t) (g->mlen * sizeof(pg_wchar))) == 0) #else memcmp(dp, g->must, (size_t) g->mlen) == 0) @@ -1165,7 +1165,7 @@ sopno stopst; static int pg_isprint(int c) { -#ifdef MB +#ifdef MULTIBYTE return(c >= 0 && c <= UCHAR_MAX && isprint(c)); #else return(isprint(c)); diff --git a/src/backend/regex/regcomp.c b/src/backend/regex/regcomp.c index 4eb71eb525e..cc6a7613fd4 100644 --- a/src/backend/regex/regcomp.c +++ b/src/backend/regex/regcomp.c @@ -194,7 +194,7 @@ int cflags; struct parse *p = &pa; int i; size_t len; -#ifdef MB +#ifdef MULTIBYTE pg_wchar *wcp; #endif @@ -210,7 +210,7 @@ int cflags; if (cflags & REG_PEND) { -#ifdef MB +#ifdef MULTIBYTE wcp = preg->patsave; if (preg->re_endp < wcp) return (REG_INVARG); @@ -222,7 +222,7 @@ int cflags; #endif } else { -#ifdef MB +#ifdef MULTIBYTE wcp = (pg_wchar *)malloc((strlen(pattern)+1) * sizeof(pg_wchar)); if (wcp == NULL) { return (REG_ESPACE); @@ -253,7 +253,7 @@ int cflags; /* set things up */ p->g = g; -#ifdef MB +#ifdef MULTIBYTE p->next = wcp; #else p->next = (pg_wchar *)pattern; /* convenience; we do not modify it */ @@ -607,7 +607,7 @@ int starordinary; /* is a leading * an ordinary character? */ if (c == '\\') { REQUIRE(MORE(), REG_EESCAPE); -#ifdef MB +#ifdef MULTIBYTE c = BACKSL | (pg_wchar) GETNEXT(); #else c = BACKSL | (unsigned char) GETNEXT(); @@ -755,13 +755,13 @@ struct parse *p; { cset *cs = allocset(p); int invert = 0; -#ifdef MB +#ifdef MULTIBYTE pg_wchar sp1[] = {'[', ':', '<', ':', ']', ']'}; pg_wchar sp2[] = {'[', ':', '>', ':', ']', ']'}; #endif /* Dept of Truly Sickening Special-Case Kludges */ -#ifdef MB +#ifdef MULTIBYTE if (p->next + 5 < p->end && pg_wchar_strncmp(p->next, sp1, 6) == 0) #else if (p->next + 5 < p->end && strncmp(p->next, "[:<:]]", 6) == 0) @@ -771,7 +771,7 @@ struct parse *p; NEXTn(6); return; } -#ifdef MB +#ifdef MULTIBYTE if (p->next + 5 < p->end && pg_wchar_strncmp(p->next, sp2, 6) == 0) #else if (p->next + 5 < p->end && strncmp(p->next, "[:>:]]", 6) == 0) @@ -903,7 +903,7 @@ cset *cs; finish = start; /* xxx what about signed chars here... */ REQUIRE(start <= finish, REG_ERANGE); -#ifdef MB +#ifdef MULTIBYTE if (CHlc(start) != CHlc(finish)) { SETERROR(REG_ERANGE); } @@ -933,7 +933,7 @@ cset *cs; NEXT(); len = p->next - sp; for (cp = cclasses; cp->name != NULL; cp++) -#ifdef MB +#ifdef MULTIBYTE if (pg_char_and_wchar_strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0') #else if (strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0') @@ -1012,7 +1012,7 @@ int endc; /* name ended by endc,']' */ } len = p->next - sp; for (cp = cnames; cp->name != NULL; cp++) -#ifdef MB +#ifdef MULTIBYTE if (pg_char_and_wchar_strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0') #else if (strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0') @@ -1084,7 +1084,7 @@ int ch; bothcases(p, ch); else { -#ifdef MB +#ifdef MULTIBYTE EMIT(OCHAR, (pg_wchar) ch); #else EMIT(OCHAR, (unsigned char) ch); @@ -1788,7 +1788,7 @@ struct re_guts *g; return; /* turn it into a character string */ -#ifdef MB +#ifdef MULTIBYTE g->must = (pg_wchar *)malloc((size_t) (g->mlen + 1)*sizeof(pg_wchar)); #else g->must = malloc((size_t) g->mlen + 1); @@ -1854,7 +1854,7 @@ struct re_guts *g; */ static int pg_isdigit(int c) { -#ifdef MB +#ifdef MULTIBYTE return(c >= 0 && c <= UCHAR_MAX && isdigit(c)); #else return(isdigit(c)); @@ -1863,7 +1863,7 @@ static int pg_isdigit(int c) static int pg_isalpha(int c) { -#ifdef MB +#ifdef MULTIBYTE return(c >= 0 && c <= UCHAR_MAX && isalpha(c)); #else return(isalpha(c)); @@ -1872,7 +1872,7 @@ static int pg_isalpha(int c) static int pg_isupper(int c) { -#ifdef MB +#ifdef MULTIBYTE return(c >= 0 && c <= UCHAR_MAX && isupper(c)); #else return(isupper(c)); @@ -1881,7 +1881,7 @@ static int pg_isupper(int c) static int pg_islower(int c) { -#ifdef MB +#ifdef MULTIBYTE return(c >= 0 && c <= UCHAR_MAX && islower(c)); #else return(islower(c)); diff --git a/src/backend/regex/regerror.c b/src/backend/regex/regerror.c index abdc314a94b..f71ff9757e3 100644 --- a/src/backend/regex/regerror.c +++ b/src/backend/regex/regerror.c @@ -215,7 +215,7 @@ char *localbuf; struct rerr *r; for (r = rerrs; r->code != 0; r++) -#ifdef MB +#ifdef MULTIBYTE if (pg_char_and_wchar_strcmp(r->name, preg->re_endp) == 0) #else if (strcmp(r->name, preg->re_endp) == 0) diff --git a/src/backend/regex/regexec.c b/src/backend/regex/regexec.c index 8a51810a203..7fbcbf81c80 100644 --- a/src/backend/regex/regexec.c +++ b/src/backend/regex/regexec.c @@ -164,7 +164,7 @@ int eflags; { struct re_guts *g = preg->re_g; -#ifdef MB +#ifdef MULTIBYTE pg_wchar *str; int sts; #endif @@ -182,7 +182,7 @@ int eflags; return (REG_BADPAT); eflags = GOODFLAGS(eflags); -#ifdef MB +#ifdef MULTIBYTE str = (pg_wchar *)malloc((strlen(string)+1) * sizeof(pg_wchar)); if (!str) { return(REG_ESPACE); diff --git a/src/backend/regex/regfree.c b/src/backend/regex/regfree.c index b169c840412..aff5f62a9bb 100644 --- a/src/backend/regex/regfree.c +++ b/src/backend/regex/regfree.c @@ -68,7 +68,7 @@ regex_t *preg; return; preg->re_magic = 0; /* mark it invalid */ g->magic = 0; /* mark it invalid */ -#ifdef MB +#ifdef MULTIBYTE if (preg->patsave != NULL) { free((char *)preg->patsave); } diff --git a/src/backend/regex/utils.c b/src/backend/regex/utils.c index 0308140118b..0f8844f41e3 100644 --- a/src/backend/regex/utils.c +++ b/src/backend/regex/utils.c @@ -1,7 +1,7 @@ /* * misc conversion functions between pg_wchar and other encodings. * Tatsuo Ishii - * $Id: utils.c,v 1.3 1998/06/16 07:29:29 momjian Exp $ + * $Id: utils.c,v 1.4 1998/07/18 18:34:08 momjian Exp $ */ #include <regex/pg_wchar.h> @@ -350,19 +350,19 @@ static pg_wchar_tbl pg_wchar_table[] = { /* convert a multi-byte string to a wchar */ void pg_mb2wchar(const unsigned char *from, pg_wchar *to) { - (*pg_wchar_table[MB].mb2wchar_with_len)(from,to,strlen(from)); + (*pg_wchar_table[MULTIBYTE].mb2wchar_with_len)(from,to,strlen(from)); } /* convert a multi-byte string to a wchar with a limited length */ void pg_mb2wchar_with_len(const unsigned char *from, pg_wchar *to, int len) { - (*pg_wchar_table[MB].mb2wchar_with_len)(from,to,len); + (*pg_wchar_table[MULTIBYTE].mb2wchar_with_len)(from,to,len); } /* returns the byte length of a multi-byte word */ int pg_mblen(const unsigned char *mbstr) { - return((*pg_wchar_table[MB].mblen)(mbstr)); + return((*pg_wchar_table[MULTIBYTE].mblen)(mbstr)); } /* returns the byte length of a multi-byte word for an encoding */ diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 0a7408a7b94..bcf4259c2a2 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.79 1998/07/09 03:28:48 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.80 1998/07/18 18:34:09 momjian Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -83,7 +83,7 @@ #include "nodes/memnodes.h" #endif -#ifdef MB +#ifdef MULTIBYTE #include "commands/variable.h" #endif @@ -1270,7 +1270,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[]) InitPostgres(DBName); -#ifdef MB +#ifdef MULTIBYTE /* set default client encoding */ if (!Quiet) { @@ -1339,7 +1339,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[]) if (!IsUnderPostmaster) { puts("\nPOSTGRES backend interactive interface"); - puts("$Revision: 1.79 $ $Date: 1998/07/09 03:28:48 $"); + puts("$Revision: 1.80 $ $Date: 1998/07/18 18:34:09 $"); } /* ---------------- diff --git a/src/backend/utils/adt/like.c b/src/backend/utils/adt/like.c index 6d011d98d01..dc5cdabed6f 100644 --- a/src/backend/utils/adt/like.c +++ b/src/backend/utils/adt/like.c @@ -49,7 +49,7 @@ fixedlen_like(char *s, struct varlena * p, int charlen) return FALSE; /* be sure sterm is null-terminated */ -#ifdef MB +#ifdef MULTIBYTE sterm = (pg_wchar *) palloc((charlen + 1)*sizeof(pg_wchar)); (void)pg_mb2wchar_with_len((unsigned char *)s,sterm,charlen); #else @@ -64,7 +64,7 @@ fixedlen_like(char *s, struct varlena * p, int charlen) /* palloc the length of the text + the null character */ len = VARSIZE(p) - VARHDRSZ; -#ifdef MB +#ifdef MULTIBYTE pterm = (pg_wchar *) palloc((len + 1)*sizeof(pg_wchar)); (void)pg_mb2wchar_with_len((unsigned char *)VARDATA(p),pterm,len); #else @@ -111,7 +111,7 @@ textnlike(struct varlena * s, struct varlena * p) } -/* $Revision: 1.16 $ +/* $Revision: 1.17 $ ** "like.c" A first attempt at a LIKE operator for Postgres95. ** ** Originally written by Rich $alz, mirror!rs, Wed Nov 26 19:03:17 EST 1986. diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/varchar.c index 29ffacd014f..ce4631ce92b 100644 --- a/src/backend/utils/adt/varchar.c +++ b/src/backend/utils/adt/varchar.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.35 1998/07/12 21:29:23 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.36 1998/07/18 18:34:12 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -398,13 +398,13 @@ bcTruelen(char *arg) int32 bpcharlen(char *arg) { -#ifdef MB +#ifdef MULTIBYTE unsigned char *s; int len, l, wl; #endif if (!PointerIsValid(arg)) elog(ERROR, "Bad (null) char() external representation", NULL); -#ifdef MB +#ifdef MULTIBYTE l = bcTruelen(arg); len = 0; s = VARDATA(arg); @@ -563,14 +563,14 @@ bpcharcmp(char *arg1, char *arg2) int32 varcharlen(char *arg) { -#ifdef MB +#ifdef MULTIBYTE unsigned char *s; int len, l, wl; #endif if (!PointerIsValid(arg)) elog(ERROR, "Bad (null) varchar() external representation", NULL); -#ifdef MB +#ifdef MULTIBYTE len = 0; s = VARDATA(arg); l = VARSIZE(arg) - VARHDRSZ; diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index 596863dd876..3308212a3a9 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.37 1998/06/16 06:41:51 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.38 1998/07/18 18:34:13 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -206,7 +206,7 @@ textout(text *vlena) int32 textlen(text *t) { -#ifdef MB +#ifdef MULTIBYTE unsigned char *s; int len, l, wl; #endif @@ -214,7 +214,7 @@ textlen(text *t) if (!PointerIsValid(t)) elog(ERROR, "Null input to textlen"); -#ifdef MB +#ifdef MULTIBYTE len = 0; s = VARDATA(t); l = VARSIZE(t) - VARHDRSZ; @@ -322,7 +322,7 @@ text_substr(text *string, int32 m, int32 n) { text *ret; int len; -#ifdef MB +#ifdef MULTIBYTE int i; char *p; #endif @@ -331,7 +331,7 @@ text_substr(text *string, int32 m, int32 n) return string; len = VARSIZE(string) - VARHDRSZ; -#ifdef MB +#ifdef MULTIBYTE len = pg_mbstrlen_with_len(VARDATA(string),len); #endif @@ -348,7 +348,7 @@ text_substr(text *string, int32 m, int32 n) n = (len - m); } -#ifdef MB +#ifdef MULTIBYTE p = VARDATA(string); for (i=0;i<m;i++) { p += pg_mblen(p); @@ -387,7 +387,7 @@ textpos(text *t1, text *t2) len2; pg_wchar *p1, *p2; -#ifdef MB +#ifdef MULTIBYTE pg_wchar *ps1, *ps2; #endif @@ -399,7 +399,7 @@ textpos(text *t1, text *t2) len1 = (VARSIZE(t1) - VARHDRSZ); len2 = (VARSIZE(t2) - VARHDRSZ); -#ifdef MB +#ifdef MULTIBYTE ps1 = p1 = (pg_wchar *) palloc((len1 + 1)*sizeof(pg_wchar)); (void)pg_mb2wchar_with_len((unsigned char *)VARDATA(t1),p1,len1); len1 = pg_wchar_strlen(p1); @@ -414,7 +414,7 @@ textpos(text *t1, text *t2) px = (len1 - len2); for (p = 0; p <= px; p++) { -#ifdef MB +#ifdef MULTIBYTE if ((*p2 == *p1) && (pg_wchar_strncmp(p1, p2, len2) == 0)) #else if ((*p2 == *p1) && (strncmp(p1, p2, len2) == 0)) @@ -425,7 +425,7 @@ textpos(text *t1, text *t2) }; p1++; }; -#ifdef MB +#ifdef MULTIBYTE pfree(ps1); pfree(ps2); #endif diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c index 65692bd9a11..28237901f72 100644 --- a/src/bin/psql/psql.c +++ b/src/bin/psql/psql.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.147 1998/07/09 03:28:53 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.148 1998/07/18 18:34:14 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -129,7 +129,7 @@ static int tableList(PsqlSettings *pset, bool deep_tablelist, char info_type, bool system_tables); static int tableDesc(PsqlSettings *pset, char *table, FILE *fout); -static int objectDescription(PsqlSettings *pset, char *object, FILE *fout); +static int objectDescription(PsqlSettings *pset, char *object); static int rightsList(PsqlSettings *pset); static void prompt_for_password(char *username, char *password); static char * @@ -144,9 +144,7 @@ static void SendQuery(bool *success_p, PsqlSettings *pset, const char *query, const bool copy_in, const bool copy_out, FILE *copystream); static int -HandleSlashCmds(PsqlSettings *pset, - char *line, - char *query); +HandleSlashCmds(PsqlSettings *pset, char *line, char *query); static int MainLoop(PsqlSettings *pset, char *query, FILE *source); static FILE *setFout(PsqlSettings *pset, char *fname); @@ -626,8 +624,7 @@ tableDesc(PsqlSettings *pset, char *table, FILE *fout) char *pagerenv; #ifdef TIOCGWINSZ - if (fout == NULL && - pset->notty == 0 && + if (pset->notty == 0 && (ioctl(fileno(stdout), TIOCGWINSZ, &screen_size) == -1 || screen_size.ws_col == 0 || screen_size.ws_row == 0)) @@ -653,7 +650,7 @@ tableDesc(PsqlSettings *pset, char *table, FILE *fout) } else { -#ifdef MB +#ifdef MULTIBYTE for (i = 0; table[i]; i += PQmblen(table+i)) #else for (i = 0; table[i]; i++) @@ -790,29 +787,13 @@ tableDesc(PsqlSettings *pset, char *table, FILE *fout) * */ int -objectDescription(PsqlSettings *pset, char *object, FILE *fout) +objectDescription(PsqlSettings *pset, char *object) { char descbuf[512]; - int nDescriptions; - int i; PGresult *res; - int usePipe = 0; - char *pagerenv; - -#ifdef TIOCGWINSZ - if (fout == NULL && - pset->notty == 0 && - (ioctl(fileno(stdout), TIOCGWINSZ, &screen_size) == -1 || - screen_size.ws_col == 0 || - screen_size.ws_row == 0)) - { -#endif - screen_size.ws_row = 24; - screen_size.ws_col = 80; -#ifdef TIOCGWINSZ - } -#endif - + int i; + bool success; + /* Build the query */ while (isspace(*object)) @@ -830,7 +811,7 @@ objectDescription(PsqlSettings *pset, char *object, FILE *fout) } else { -#ifdef MB +#ifdef MULTIBYTE for (i = 0; object[i]; i += PQmblen(object+i)) #else for (i = 0; object[i]; i++) @@ -866,7 +847,7 @@ objectDescription(PsqlSettings *pset, char *object, FILE *fout) { strcat(descbuf, "SELECT DISTINCT description "); strcat(descbuf, "FROM pg_class, pg_description "); - strcat(descbuf, "WHERE pg_class.relname = '"); + strcat(descbuf, "WHERE pg_class.relname ~ '^"); strcat(descbuf, object); strcat(descbuf, "'"); strcat(descbuf, " and pg_class.oid = pg_description.objoid "); @@ -878,7 +859,7 @@ objectDescription(PsqlSettings *pset, char *object, FILE *fout) descbuf[0] = '\0'; strcat(descbuf, "SELECT DISTINCT description "); strcat(descbuf, "FROM pg_type, pg_description "); - strcat(descbuf, "WHERE pg_type.typname = '"); + strcat(descbuf, "WHERE pg_type.typname ~ '^"); strcat(descbuf, object); strcat(descbuf, "' and "); strcat(descbuf, " pg_type.oid = pg_description.objoid "); @@ -890,7 +871,7 @@ objectDescription(PsqlSettings *pset, char *object, FILE *fout) descbuf[0] = '\0'; strcat(descbuf, "SELECT DISTINCT description "); strcat(descbuf, "FROM pg_proc, pg_description "); - strcat(descbuf, "WHERE pg_proc.proname = '"); + strcat(descbuf, "WHERE pg_proc.proname ~ '^"); strcat(descbuf, object); strcat(descbuf, "'"); strcat(descbuf, " and pg_proc.oid = pg_description.objoid "); @@ -902,7 +883,7 @@ objectDescription(PsqlSettings *pset, char *object, FILE *fout) descbuf[0] = '\0'; strcat(descbuf, "SELECT DISTINCT description "); strcat(descbuf, "FROM pg_operator, pg_description "); - strcat(descbuf, "WHERE pg_operator.oprname = '"); + strcat(descbuf, "WHERE pg_operator.oprname ~ '^"); strcat(descbuf, object); strcat(descbuf, "'"); /* operator descriptions are attached to the proc */ @@ -915,59 +896,31 @@ objectDescription(PsqlSettings *pset, char *object, FILE *fout) descbuf[0] = '\0'; strcat(descbuf, "SELECT DISTINCT description "); strcat(descbuf, "FROM pg_aggregate, pg_description "); - strcat(descbuf, "WHERE pg_aggregate.aggname = '"); + strcat(descbuf, "WHERE pg_aggregate.aggname ~ '^"); strcat(descbuf, object); strcat(descbuf, "'"); strcat(descbuf, " and pg_aggregate.oid = pg_description.objoid "); if (!(res = PSQLexec(pset, descbuf))) return -1; + else if (PQntuples(res) <= 0) + { + PQclear(res); + descbuf[0] = '\0'; + strcat(descbuf, "SELECT 'no description' as description "); + if (!(res = PSQLexec(pset, descbuf))) + return -1; + } } } } } } - nDescriptions = PQntuples(res); - if (nDescriptions > 0) - { - if (fout == NULL) - { - if (pset->notty == 0 && - (pagerenv = getenv("PAGER")) && - pagerenv[0] != '\0' && - screen_size.ws_row <= nDescriptions + 1 && - (fout = popen(pagerenv, "w"))) - { - usePipe = 1; - pqsignal(SIGPIPE, SIG_IGN); - } - else - fout = stdout; - } - - /* - * * Display the information - */ - fprintf(fout, "\nObject = %s\n", object); + PQclear(res); - /* next, print out the instances */ - for (i = 0; i < PQntuples(res); i++) - fprintf(fout, "%s\n", PQgetvalue(res, i, 0)); + SendQuery(&success, pset, descbuf, false, false, NULL); - PQclear(res); - if (usePipe) - { - pclose(fout); - pqsignal(SIGPIPE, SIG_DFL); - } - return 0; - - } - else - { - fprintf(stderr, "Couldn't find comments for object %s!\n", object); - return -1; - } + return 0; } typedef char *(*READ_ROUTINE) (char *prompt, FILE *source); @@ -1752,6 +1705,7 @@ HandleSlashCmds(PsqlSettings *pset, case 'a': /* toggles to align fields on output */ toggle(pset, &pset->opt.align, "field alignment"); break; + case 'C': /* define new caption */ if (pset->opt.caption) { @@ -1764,6 +1718,7 @@ HandleSlashCmds(PsqlSettings *pset, exit(CMD_TERMINATE); } break; + case 'c': { if (strncmp(cmd, "copy ", strlen("copy ")) == 0 || @@ -1815,32 +1770,83 @@ HandleSlashCmds(PsqlSettings *pset, } } break; + case 'd': /* \d describe database information */ + /* + * if the optarg2 name is surrounded by double-quotes, then don't + * convert case + */ + if (optarg2) + { + if (*optarg2 == '"') + { + optarg2++; + if (*(optarg2 + strlen(optarg2) - 1) == '"') + *(optarg2 + strlen(optarg2) - 1) = '\0'; + } + else + { + int i; +#ifdef MULTIBYTE + for (i = 0; optarg2[i]; i += PQmblen(optarg2+i)) +#else + for (i = 0; optarg2[i]; i++) +#endif + if (isupper(optarg2[i])) + optarg2[i] = tolower(optarg2[i]); + } + } + +#ifdef TIOCGWINSZ + if (pset->notty == 0 && + (ioctl(fileno(stdout), TIOCGWINSZ, &screen_size) == -1 || + screen_size.ws_col == 0 || + screen_size.ws_row == 0)) + { +#endif + screen_size.ws_row = 24; + screen_size.ws_col = 80; +#ifdef TIOCGWINSZ + } +#endif if (strncmp(cmd, "da", 2) == 0) { + char descbuf[4096]; + /* aggregates */ - SendQuery(&success, pset, "\ - SELECT a.aggname AS aggname, \ - t.typname AS typname, \ - obj_description(a.oid) as description \ - FROM pg_aggregate a, pg_type t \ - WHERE a.aggbasetype = t.oid \ - ORDER BY aggname, typname;", - false, false, 0); - SendQuery(&success, pset, "\ - SELECT a.aggname AS aggname, \ - 'all types' as all_types, \ - obj_description(a.oid) as description \ - FROM pg_aggregate a \ - WHERE a.aggbasetype = 0 \ - ORDER BY aggname;", - false, false, 0); + descbuf[0] = '\0'; + strcat(descbuf, "SELECT a.aggname AS aggname, "); + strcat(descbuf, " t.typname AS type, "); + strcat(descbuf, " obj_description(a.oid) as description "); + strcat(descbuf, "FROM pg_aggregate a, pg_type t "); + strcat(descbuf, "WHERE a.aggbasetype = t.oid "); + if (optarg2) + { + strcat(descbuf, "AND a.aggname ~ '^"); + strcat(descbuf, optarg2); + strcat(descbuf, "' "); + } + strcat(descbuf, "UNION "); + strcat(descbuf, "SELECT a.aggname AS aggname, "); + strcat(descbuf, " 'all types' as type, "); + strcat(descbuf, " obj_description(a.oid) as description "); + strcat(descbuf, "FROM pg_aggregate a "); + strcat(descbuf, "WHERE a.aggbasetype = 0 "); + if (optarg2) + { + strcat(descbuf, "AND a.aggname ~ '^"); + strcat(descbuf, optarg2); + strcat(descbuf, "' "); + } + strcat(descbuf, "ORDER BY aggname, type;"); + SendQuery(&success, pset, descbuf, false, false, NULL); } else if (strncmp(cmd, "dd", 2) == 0) /* descriptions */ - objectDescription(pset, optarg + 1, NULL); + objectDescription(pset, optarg + 1); else if (strncmp(cmd, "df", 2) == 0) { + char descbuf[4096]; /* functions/procedures */ /* @@ -1848,75 +1854,101 @@ HandleSlashCmds(PsqlSettings *pset, * some arguments, but have no types defined for those * arguments */ - SendQuery(&success, pset, "\ - SELECT t.typname as return_type, \ - p.proname as function, \ - substr(oid8types(p.proargtypes),1,20) as arguments, \ - substr(obj_description(p.oid),1,28) as description \ - FROM pg_proc p, pg_type t \ - WHERE p.prorettype = t.oid and \ - (pronargs = 0 or oid8types(p.proargtypes) != '') and \ - t.typname != 'bool' \ - ORDER BY return_type, function;", - false, false, 0); - SendQuery(&success, pset, "\ - SELECT t.typname as rtns, \ - p.proname as function, \ - oid8types(p.proargtypes) as arguments, \ - substr(obj_description(p.oid),1,34) as description \ - FROM pg_proc p, pg_type t \ - WHERE p.prorettype = t.oid and \ - (pronargs = 0 or oid8types(p.proargtypes) != '') and \ - t.typname = 'bool' \ - ORDER BY rtns, function;", - false, false, 0); + descbuf[0] = '\0'; + strcat(descbuf, "SELECT t.typname as result, "); + strcat(descbuf, " p.proname as function, "); + if (screen_size.ws_col <= 80) + strcat(descbuf, " substr(oid8types(p.proargtypes),1,14) as arguments, "); + else + strcat(descbuf, " oid8types(p.proargtypes) as arguments, "); + if (screen_size.ws_col <= 80) + strcat(descbuf, " substr(obj_description(p.oid),1,34) as description "); + else + strcat(descbuf, " obj_description(p.oid) as description "); + strcat(descbuf, "FROM pg_proc p, pg_type t "); + strcat(descbuf, "WHERE p.prorettype = t.oid and "); + strcat(descbuf, "(pronargs = 0 or oid8types(p.proargtypes) != '') "); + if (optarg2) + { + strcat(descbuf, "AND p.proname ~ '^"); + strcat(descbuf, optarg2); + strcat(descbuf, "' "); + } + strcat(descbuf, "ORDER BY result, function, arguments;"); + SendQuery(&success, pset, descbuf, false, false, NULL); } else if (strncmp(cmd, "di", 2) == 0) /* only indices */ tableList(pset, false, 'i', false); else if (strncmp(cmd, "do", 2) == 0) { + char descbuf[4096]; /* operators */ - SendQuery(&success, pset, "\ - SELECT o.oprname AS op, \ - t0.typname AS result, \ - t1.typname AS left_type, \ - t2.typname AS right_type, \ - substr(obj_description(p.oid),1,42) as description \ - FROM pg_proc p, pg_type t0, \ - pg_type t1, pg_type t2, \ - pg_operator o \ - WHERE p.prorettype = t0.oid AND \ - RegprocToOid(o.oprcode) = p.oid AND \ - p.pronargs = 2 AND \ - o.oprleft = t1.oid AND \ - o.oprright = t2.oid \ - ORDER BY op, result, left_type, right_type;", - false, false, 0); - SendQuery(&success, pset, "\ - SELECT o.oprname AS left_unary, \ - t0.typname AS return_type, \ - t1.typname AS operand, \ - obj_description(p.oid) as description \ - FROM pg_operator o, pg_proc p, pg_type t0, pg_type t1 \ - WHERE RegprocToOid(o.oprcode) = p.oid AND \ - o.oprresult = t0.oid AND \ - o.oprkind = 'l' AND \ - o.oprright = t1.oid \ - ORDER BY left_unary, return_type, operand;", - false, false, 0); - SendQuery(&success, pset, "\ - SELECT o.oprname AS right_unary, \ - t0.typname AS return_type, \ - t1.typname AS operand, \ - obj_description(p.oid) as description \ - FROM pg_operator o, pg_proc p, pg_type t0, pg_type t1 \ - WHERE RegprocToOid(o.oprcode) = p.oid AND \ - o.oprresult = t0.oid AND \ - o.oprkind = 'r' AND \ - o.oprleft = t1.oid \ - ORDER BY right_unary, return_type, operand;", - false, false, 0); + descbuf[0] = '\0'; + strcat(descbuf, "SELECT o.oprname AS op, "); + strcat(descbuf, " t1.typname AS left_arg, "); + strcat(descbuf, " t2.typname AS right_arg, "); + strcat(descbuf, " t0.typname AS result, "); + if (screen_size.ws_col <= 80) + strcat(descbuf, " substr(obj_description(p.oid),1,41) as description "); + else + strcat(descbuf, " obj_description(p.oid) as description "); + strcat(descbuf, "FROM pg_proc p, pg_type t0, "); + strcat(descbuf, " pg_type t1, pg_type t2, "); + strcat(descbuf, " pg_operator o "); + strcat(descbuf, "WHERE p.prorettype = t0.oid AND "); + strcat(descbuf, " RegprocToOid(o.oprcode) = p.oid AND "); + strcat(descbuf, " p.pronargs = 2 AND "); + strcat(descbuf, " o.oprleft = t1.oid AND "); + strcat(descbuf, " o.oprright = t2.oid "); + if (optarg2) + { + strcat(descbuf, "AND o.oprname ~ '^"); + strcat(descbuf, optarg2); + strcat(descbuf, "' "); + } + strcat(descbuf, "UNION "); + strcat(descbuf, "SELECT o.oprname as op, "); + strcat(descbuf, " ''::name AS left_arg, "); + strcat(descbuf, " t1.typname AS right_arg, "); + strcat(descbuf, " t0.typname AS result, "); + if (screen_size.ws_col <= 80) + strcat(descbuf, " substr(obj_description(p.oid),1,41) as description "); + else + strcat(descbuf, " obj_description(p.oid) as description "); + strcat(descbuf, "FROM pg_operator o, pg_proc p, pg_type t0, pg_type t1 "); + strcat(descbuf, "WHERE RegprocToOid(o.oprcode) = p.oid AND "); + strcat(descbuf, " o.oprresult = t0.oid AND "); + strcat(descbuf, " o.oprkind = 'l' AND "); + strcat(descbuf, " o.oprright = t1.oid "); + if (optarg2) + { + strcat(descbuf, "AND o.oprname ~ '^"); + strcat(descbuf, optarg2); + strcat(descbuf, "' "); + } + strcat(descbuf, "UNION "); + strcat(descbuf, "SELECT o.oprname as op, "); + strcat(descbuf, " t1.typname AS left_arg, "); + strcat(descbuf, " ''::name AS right_arg, "); + strcat(descbuf, " t0.typname AS result, "); + if (screen_size.ws_col <= 80) + strcat(descbuf, " substr(obj_description(p.oid),1,41) as description "); + else + strcat(descbuf, " obj_description(p.oid) as description "); + strcat(descbuf, "FROM pg_operator o, pg_proc p, pg_type t0, pg_type t1 "); + strcat(descbuf, "WHERE RegprocToOid(o.oprcode) = p.oid AND "); + strcat(descbuf, " o.oprresult = t0.oid AND "); + strcat(descbuf, " o.oprkind = 'r' AND "); + strcat(descbuf, " o.oprleft = t1.oid "); + if (optarg2) + { + strcat(descbuf, "AND o.oprname ~ '^"); + strcat(descbuf, optarg2); + strcat(descbuf, "' "); + } + strcat(descbuf, "ORDER BY op, left_arg, right_arg, result;"); + SendQuery(&success, pset, descbuf, false, false, NULL); } else if (strncmp(cmd, "ds", 2) == 0) /* only sequences */ @@ -1928,15 +1960,25 @@ HandleSlashCmds(PsqlSettings *pset, /* only tables */ tableList(pset, false, 't', false); else if (strncmp(cmd, "dT", 2) == 0) - /* types */ - SendQuery(&success, pset, "\ - SELECT typname AS type, \ - obj_description(oid) as description \ - FROM pg_type \ - WHERE typrelid = 0 AND \ - typname !~ '^_.*' \ - ORDER BY type;", - false, false, 0); + { + char descbuf[4096]; + + /* types */ + descbuf[0] = '\0'; + strcat(descbuf, "SELECT typname AS type, "); + strcat(descbuf, " obj_description(oid) as description "); + strcat(descbuf, "FROM pg_type "); + strcat(descbuf, "WHERE typrelid = 0 AND "); + strcat(descbuf, " typname !~ '^_.*' "); + strcat(descbuf, "ORDER BY type;"); + if (optarg2) + { + strcat(descbuf, "AND typname ~ '^"); + strcat(descbuf, optarg2); + strcat(descbuf, "' "); + } + SendQuery(&success, pset, descbuf, false, false, NULL); + } else if (!optarg) /* show tables, sequences and indices */ tableList(pset, false, 'b', false); @@ -1950,13 +1992,14 @@ HandleSlashCmds(PsqlSettings *pset, tableDesc(pset, optarg, NULL); else slashUsage(pset); - break; + case 'e': /* edit */ { do_edit(optarg, query, &status); break; } + case 'E': { FILE *fd; @@ -1999,6 +2042,7 @@ HandleSlashCmds(PsqlSettings *pset, fclose(fd); break; } + case 'f': { char *fs = DEFAULT_FIELD_SEP; @@ -2036,11 +2080,13 @@ HandleSlashCmds(PsqlSettings *pset, } status = CMD_SEND; break; + case 'h': /* help */ { do_help(pset, optarg); break; } + case 'i': /* \i is include file */ { FILE *fd; @@ -2059,16 +2105,20 @@ HandleSlashCmds(PsqlSettings *pset, fclose(fd); break; } + case 'l': /* \l is list database */ listAllDbs(pset); break; + case 'H': if (toggle(pset, &pset->opt.html3, "HTML3.0 tabular output")) pset->opt.standard = 0; break; + case 'o': setFout(pset, optarg); break; + case 'p': if (query) { @@ -2076,14 +2126,17 @@ HandleSlashCmds(PsqlSettings *pset, fputc('\n', stdout); } break; + case 'q': /* \q is quit */ status = CMD_TERMINATE; break; + case 'r': /* reset(clear) the buffer */ query[0] = '\0'; if (!pset->quiet) printf("buffer reset(cleared)\n"); break; + case 's': /* \s is save history to a file */ if (!optarg) optarg = "/dev/tty"; @@ -2092,6 +2145,7 @@ HandleSlashCmds(PsqlSettings *pset, fprintf(stderr, "cannot write history to %s\n", optarg); #endif break; + case 'm': /* monitor like type-setting */ if (toggle(pset, &pset->opt.standard, "standard SQL separaters and padding")) { @@ -2112,12 +2166,15 @@ HandleSlashCmds(PsqlSettings *pset, printf("field separator changed to '%s'\n", pset->opt.fieldSep); } break; + case 'z': /* list table rights (grant/revoke) */ rightsList(pset); break; + case 't': /* toggle headers */ toggle(pset, &pset->opt.header, "output headings and row count"); break; + case 'T': /* define html <table ...> option */ if (pset->opt.tableOpt) free(pset->opt.tableOpt); @@ -2129,20 +2186,23 @@ HandleSlashCmds(PsqlSettings *pset, exit(CMD_TERMINATE); } break; + case 'x': toggle(pset, &pset->opt.expanded, "expanded table representation"); break; + case '!': do_shell(optarg); break; default: + case '?': /* \? is help */ slashUsage(pset); break; } free(cmd); return status; -} /* HandleSlashCmds() */ +} /* MainLoop() * Main processing loop for reading lines of input @@ -2311,7 +2371,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source) if (pset->singleLineMode) { - SendQuery(&success, pset, line, false, false, 0); + SendQuery(&success, pset, line, false, false, NULL); successResult &= success; querySent = true; } @@ -2319,12 +2379,12 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source) { int i; -#ifdef MB +#ifdef MULTIBYTE int mblen = 1; #endif was_bslash = false; -#ifdef MB +#ifdef MULTIBYTE for (i = 0; i < len; mblen=PQmblen(line+i), i+=mblen) #else for (i = 0; i < len; i++) @@ -2362,7 +2422,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source) if (was_bslash) was_bslash = false; -#ifdef MB +#ifdef MULTIBYTE else if (i > 0 && line[i - mblen] == '\\') #else else if (i > 0 && line[i - 1] == '\\') @@ -2375,14 +2435,14 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source) else if (xcomment != NULL) /* inside an extended * comment? */ { -#ifdef MB +#ifdef MULTIBYTE if (line[i] == '*' && line[i + mblen] == '/') #else if (line[i] == '*' && line[i + 1] == '/') #endif { xcomment = NULL; -#ifdef MB +#ifdef MULTIBYTE i += mblen; #else i++; @@ -2390,21 +2450,21 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source) } } /* possible backslash command? */ -#ifdef MB +#ifdef MULTIBYTE else if (line[i] == '/' && line[i + mblen] == '*') #else else if (line[i] == '/' && line[i + 1] == '*') #endif { xcomment = line + i; -#ifdef MB +#ifdef MULTIBYTE i += mblen; #else i++; #endif } /* single-line comment? truncate line */ -#ifdef MB +#ifdef MULTIBYTE else if ((line[i] == '-' && line[i + mblen] == '-') || (line[i] == '/' && line[i + mblen] == '/')) #else @@ -2436,7 +2496,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source) else strcpy(query, query_start); } - SendQuery(&success, pset, query, false, false, 0); + SendQuery(&success, pset, query, false, false, NULL); successResult &= success; line[i + 1] = hold_char; query_start = line + i + 1; @@ -2509,7 +2569,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source) /* had a backslash-g? force the query to be sent */ if (slashCmdStatus == CMD_SEND) { - SendQuery(&success, pset, query, false, false, 0); + SendQuery(&success, pset, query, false, false, NULL); successResult &= success; xcomment = NULL; in_quote = false; @@ -2745,7 +2805,7 @@ main(int argc, char **argv) { bool success;/* The query succeeded at the backend */ - SendQuery(&success, &settings, singleQuery, false, false, 0); + SendQuery(&success, &settings, singleQuery, false, false, NULL); successResult = success; } else diff --git a/src/bin/psql/psqlHelp.h b/src/bin/psql/psqlHelp.h index 0383b01a420..faa5ed26cfb 100644 --- a/src/bin/psql/psqlHelp.h +++ b/src/bin/psql/psqlHelp.h @@ -5,7 +5,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: psqlHelp.h,v 1.45 1998/07/12 04:49:47 momjian Exp $ + * $Id: psqlHelp.h,v 1.46 1998/07/18 18:34:16 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -263,7 +263,7 @@ static struct _helpStruct QL_HELP[] = { "notify <class_name>"}, {"reset", "set run-time environment back to default", -#ifdef MB +#ifdef MULTIBYTE "reset {DateStyle | GEQO | R_PLANS | CLIENT_ENCODING}"}, #else "reset {DateStyle | GEQO | R_PLANS}"}, @@ -288,7 +288,7 @@ static struct _helpStruct QL_HELP[] = { \t[union [all] select ...];"}, {"set", "set run-time environment", -#ifdef MB +#ifdef MULTIBYTE "set DateStyle to {'ISO' | 'SQL' | 'Postgres' | 'European' | 'US' | 'NonEuropean'}\n\ set GEQO to {'ON[=#]' | 'OFF'}\n\ set R_PLANS to {'ON' | 'OFF'}\n\ @@ -300,7 +300,7 @@ set R_PLANS to {'ON' | 'OFF'}"}, #endif {"show", "show current run-time environment", -#ifdef MB +#ifdef MULTIBYTE "show {DateStyle | GEQO | R_PLANS | CLIENT_ENCODING}"}, #else "show {DateStyle | GEQO | R_PLANS}"}, diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 103be88c0f7..dfbc7568249 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pg_proc.h,v 1.61 1998/07/08 14:08:59 thomas Exp $ + * $Id: pg_proc.h,v 1.62 1998/07/18 18:34:17 momjian Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -151,35 +151,35 @@ DESCR("less-than"); DATA(insert OID = 57 ( boolgt PGUID 11 f t f 2 f 16 "16 16" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 60 ( booleq PGUID 11 f t f 2 f 16 "16 16" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 61 ( chareq PGUID 11 f t f 2 f 16 "18 18" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 62 ( nameeq PGUID 11 f t f 2 f 16 "19 19" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 63 ( int2eq PGUID 11 f t f 2 f 16 "21 21" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 64 ( int2lt PGUID 11 f t f 2 f 16 "21 21" 100 0 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 65 ( int4eq PGUID 11 f t f 2 f 16 "23 23" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 66 ( int4lt PGUID 11 f t f 2 f 16 "23 23" 100 0 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 67 ( texteq PGUID 11 f t f 2 f 16 "25 25" 100 0 0 0 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 68 ( xideq PGUID 11 f t f 2 f 16 "28 28" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 69 ( cideq PGUID 11 f t f 2 f 16 "29 29" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 70 ( charne PGUID 11 f t f 2 f 16 "18 18" 100 0 0 100 foo bar )); DESCR("not equal"); DATA(insert OID = 1246 ( charlt PGUID 11 f t f 2 f 16 "18 18" 100 0 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 72 ( charle PGUID 11 f t f 2 f 16 "18 18" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 73 ( chargt PGUID 11 f t f 2 f 16 "18 18" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 74 ( charge PGUID 11 f t f 2 f 16 "18 18" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 1248 ( charpl PGUID 11 f t f 2 f 18 "18 18" 100 0 0 100 foo bar )); DESCR("addition"); DATA(insert OID = 1250 ( charmi PGUID 11 f t f 2 f 18 "18 18" 100 0 0 100 foo bar )); @@ -223,7 +223,7 @@ DESCR("btree"); DATA(insert OID = 1272 ( eqsel PGUID 11 f t f 5 f 701 "26 26 21 0 23" 100 0 0 100 foo bar )); DESCR("general selectivity"); DATA(insert OID = 102 ( neqsel PGUID 11 f t f 5 f 701 "26 26 21 0 23" 100 0 0 100 foo bar )); -DESCR("not-equals selectivity"); +DESCR("not-equal selectivity"); DATA(insert OID = 103 ( intltsel PGUID 11 f t f 5 f 701 "26 26 21 0 23" 100 0 0 100 foo bar )); DESCR("selectivity"); DATA(insert OID = 104 ( intgtsel PGUID 11 f t f 5 f 701 "26 26 21 0 23" 100 0 0 100 foo bar )); @@ -268,15 +268,15 @@ DESCR("(internal)"); DATA(insert OID = 125 ( box_overlap PGUID 11 f t f 2 f 16 "603 603" 100 1 0 100 foo bar )); DESCR("overlaps"); DATA(insert OID = 126 ( box_ge PGUID 11 f t f 2 f 16 "603 603" 100 1 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 127 ( box_gt PGUID 11 f t f 2 f 16 "603 603" 100 1 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 128 ( box_eq PGUID 11 f t f 2 f 16 "603 603" 100 1 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 129 ( box_lt PGUID 11 f t f 2 f 16 "603 603" 100 1 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 130 ( box_le PGUID 11 f t f 2 f 16 "603 603" 100 1 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 131 ( point_above PGUID 11 f t f 2 f 16 "600 600" 100 0 0 100 foo bar )); DESCR("is above"); DATA(insert OID = 132 ( point_left PGUID 11 f t f 2 f 16 "600 600" 100 0 0 100 foo bar )); @@ -312,13 +312,13 @@ DESCR("greater-than"); DATA(insert OID = 147 ( int4gt PGUID 11 f t f 2 f 16 "23 23" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 148 ( int2le PGUID 11 f t f 2 f 16 "21 21" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 149 ( int4le PGUID 11 f t f 2 f 16 "23 23" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 150 ( int4ge PGUID 11 f t f 2 f 16 "23 23" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 151 ( int2ge PGUID 11 f t f 2 f 16 "21 21" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 152 ( int2mul PGUID 11 f t f 2 f 21 "21 21" 100 0 0 100 foo bar )); DESCR("multiply"); DATA(insert OID = 153 ( int2div PGUID 11 f t f 2 f 21 "21 21" 100 0 0 100 foo bar )); @@ -332,9 +332,9 @@ DESCR("modulus"); DATA(insert OID = 157 ( textne PGUID 11 f t f 2 f 16 "25 25" 100 0 0 0 foo bar )); DESCR("not equal"); DATA(insert OID = 158 ( int24eq PGUID 11 f t f 2 f 23 "21 23" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 159 ( int42eq PGUID 11 f t f 2 f 23 "23 21" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 160 ( int24lt PGUID 11 f t f 2 f 23 "21 23" 100 0 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 161 ( int42lt PGUID 11 f t f 2 f 23 "23 21" 100 0 0 100 foo bar )); @@ -348,13 +348,13 @@ DESCR("not equal"); DATA(insert OID = 165 ( int42ne PGUID 11 f t f 2 f 23 "23 21" 100 0 0 100 foo bar )); DESCR("not equal"); DATA(insert OID = 166 ( int24le PGUID 11 f t f 2 f 23 "21 23" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 167 ( int42le PGUID 11 f t f 2 f 23 "23 21" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 168 ( int24ge PGUID 11 f t f 2 f 23 "21 23" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 169 ( int42ge PGUID 11 f t f 2 f 23 "23 21" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 170 ( int24mul PGUID 11 f t f 2 f 23 "21 23" 100 0 0 100 foo bar )); DESCR("multiply"); DATA(insert OID = 171 ( int42mul PGUID 11 f t f 2 f 23 "23 21" 100 0 0 100 foo bar )); @@ -384,7 +384,7 @@ DESCR("subtract"); DATA(insert OID = 183 ( int42mi PGUID 11 f t f 2 f 23 "23 21" 100 0 0 100 foo bar )); DESCR("subtract"); DATA(insert OID = 184 ( oideq PGUID 11 f t f 2 f 16 "26 26" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 185 ( oidne PGUID 11 f t f 2 f 16 "26 26" 100 0 0 100 foo bar )); DESCR("not equal"); DATA(insert OID = 186 ( box_same PGUID 11 f t f 2 f 16 "603 603" 100 0 0 100 foo bar )); @@ -525,7 +525,7 @@ DESCR(""); DATA(insert OID = 250 ( timenow PGUID 11 f t f 0 f 702 "0" 100 0 0 100 foo bar )); DESCR("(internal)"); DATA(insert OID = 251 ( abstimeeq PGUID 11 f t f 2 f 16 "702 702" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 252 ( abstimene PGUID 11 f t f 2 f 16 "702 702" 100 0 0 100 foo bar )); DESCR("not equal"); DATA(insert OID = 253 ( abstimelt PGUID 11 f t f 2 f 16 "702 702" 100 0 0 100 foo bar )); @@ -533,11 +533,11 @@ DESCR("less-than"); DATA(insert OID = 254 ( abstimegt PGUID 11 f t f 2 f 16 "702 702" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 255 ( abstimele PGUID 11 f t f 2 f 16 "702 702" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 256 ( abstimege PGUID 11 f t f 2 f 16 "702 702" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 257 ( reltimeeq PGUID 11 f t f 2 f 16 "703 703" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 258 ( reltimene PGUID 11 f t f 2 f 16 "703 703" 100 0 0 100 foo bar )); DESCR("not equal"); DATA(insert OID = 259 ( reltimelt PGUID 11 f t f 2 f 16 "703 703" 100 0 0 100 foo bar )); @@ -545,9 +545,9 @@ DESCR("less-than"); DATA(insert OID = 260 ( reltimegt PGUID 11 f t f 2 f 16 "703 703" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 261 ( reltimele PGUID 11 f t f 2 f 16 "703 703" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 262 ( reltimege PGUID 11 f t f 2 f 16 "703 703" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 263 ( intervalsame PGUID 11 f t f 2 f 16 "704 704" 100 0 0 100 foo bar )); DESCR("same as"); DATA(insert OID = 264 ( intervalct PGUID 11 f t f 2 f 16 "704 704" 100 0 0 100 foo bar )); @@ -555,7 +555,7 @@ DESCR("less-than"); DATA(insert OID = 265 ( intervalov PGUID 11 f t f 2 f 16 "704 704" 100 0 0 100 foo bar )); DESCR("overlaps"); DATA(insert OID = 266 ( intervalleneq PGUID 11 f t f 2 f 16 "704 703" 100 0 0 100 foo bar )); -DESCR("length equals"); +DESCR("length equal"); DATA(insert OID = 267 ( intervallenne PGUID 11 f t f 2 f 16 "704 703" 100 0 0 100 foo bar )); DESCR("length not equal to"); DATA(insert OID = 268 ( intervallenlt PGUID 11 f t f 2 f 16 "704 703" 100 0 0 100 foo bar )); @@ -563,9 +563,9 @@ DESCR("length less-than"); DATA(insert OID = 269 ( intervallengt PGUID 11 f t f 2 f 16 "704 703" 100 0 0 100 foo bar )); DESCR("length greater-than"); DATA(insert OID = 270 ( intervallenle PGUID 11 f t f 2 f 16 "704 703" 100 0 0 100 foo bar )); -DESCR("length less-than-or-equals"); +DESCR("length less-than-or-equal"); DATA(insert OID = 271 ( intervallenge PGUID 11 f t f 2 f 16 "704 703" 100 0 0 100 foo bar )); -DESCR("length greater-than-or-equals"); +DESCR("length greater-than-or-equal"); DATA(insert OID = 272 ( intervalstart PGUID 11 f t f 1 f 702 "704" 100 0 0 100 foo bar )); DESCR("start of interval"); DATA(insert OID = 273 ( intervalend PGUID 11 f t f 1 f 702 "704" 100 0 0 100 foo bar )); @@ -601,33 +601,33 @@ DATA(insert OID = 286 ( float84mi PGUID 11 f t f 2 f 701 "701 700" 100 0 0 DESCR("subtract"); DATA(insert OID = 287 ( float4eq PGUID 11 f t f 2 f 16 "700 700" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 288 ( float4ne PGUID 11 f t f 2 f 16 "700 700" 100 0 0 100 foo bar )); DESCR("not equal"); DATA(insert OID = 289 ( float4lt PGUID 11 f t f 2 f 16 "700 700" 100 0 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 290 ( float4le PGUID 11 f t f 2 f 16 "700 700" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 291 ( float4gt PGUID 11 f t f 2 f 16 "700 700" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 292 ( float4ge PGUID 11 f t f 2 f 16 "700 700" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 293 ( float8eq PGUID 11 f t f 2 f 16 "701 701" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 294 ( float8ne PGUID 11 f t f 2 f 16 "701 701" 100 0 0 100 foo bar )); DESCR("not equal"); DATA(insert OID = 295 ( float8lt PGUID 11 f t f 2 f 16 "701 701" 100 0 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 296 ( float8le PGUID 11 f t f 2 f 16 "701 701" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 297 ( float8gt PGUID 11 f t f 2 f 16 "701 701" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 298 ( float8ge PGUID 11 f t f 2 f 16 "701 701" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 299 ( float48eq PGUID 11 f t f 2 f 16 "700 701" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); /* OIDS 300 - 399 */ @@ -636,23 +636,23 @@ DESCR("not equal"); DATA(insert OID = 301 ( float48lt PGUID 11 f t f 2 f 16 "700 701" 100 0 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 302 ( float48le PGUID 11 f t f 2 f 16 "700 701" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 303 ( float48gt PGUID 11 f t f 2 f 16 "700 701" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 304 ( float48ge PGUID 11 f t f 2 f 16 "700 701" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 305 ( float84eq PGUID 11 f t f 2 f 16 "701 700" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 306 ( float84ne PGUID 11 f t f 2 f 16 "701 700" 100 0 0 100 foo bar )); DESCR("not equal"); DATA(insert OID = 307 ( float84lt PGUID 11 f t f 2 f 16 "701 700" 100 0 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 308 ( float84le PGUID 11 f t f 2 f 16 "701 700" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 309 ( float84gt PGUID 11 f t f 2 f 16 "701 700" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 310 ( float84ge PGUID 11 f t f 2 f 16 "701 700" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 311 ( ftod PGUID 11 f t f 1 f 701 "700" 100 0 0 100 foo bar )); DESCR("convert"); @@ -855,9 +855,9 @@ DESCR("less-than"); DATA(insert OID = 470 ( int8gt PGUID 11 f t f 2 f 16 "20 20" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 471 ( int8le PGUID 11 f t f 2 f 16 "20 20" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 472 ( int8ge PGUID 11 f t f 2 f 16 "20 20" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 474 ( int84eq PGUID 11 f t f 2 f 16 "20 23" 100 0 0 100 foo bar )); DESCR("equal"); @@ -868,9 +868,9 @@ DESCR("less-than"); DATA(insert OID = 477 ( int84gt PGUID 11 f t f 2 f 16 "20 23" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 478 ( int84le PGUID 11 f t f 2 f 16 "20 23" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 479 ( int84ge PGUID 11 f t f 2 f 16 "20 23" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 480 ( int84 PGUID 11 f t f 1 f 23 "20" 100 0 0 100 foo bar )); DESCR("convert int8 to int4"); @@ -896,11 +896,11 @@ DESCR("(internal)"); DATA(insert OID = 655 ( namelt PGUID 11 f t f 2 f 16 "19 19" 100 0 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 656 ( namele PGUID 11 f t f 2 f 16 "19 19" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 657 ( namegt PGUID 11 f t f 2 f 16 "19 19" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 658 ( namege PGUID 11 f t f 2 f 16 "19 19" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 659 ( namene PGUID 11 f t f 2 f 16 "19 19" 100 0 0 100 foo bar )); DESCR("not equal"); @@ -910,7 +910,7 @@ DATA(insert OID = 669 ( varchar PGUID 11 f t f 2 f 1043 "1043 23" 100 0 0 1 DATA(insert OID = 682 ( mktinterval PGUID 11 f t f 2 f 704 "702 702" 100 0 0 100 foo bar )); DESCR("convert to interval"); DATA(insert OID = 683 ( oid8eq PGUID 11 f t f 2 f 16 "30 30" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); /* OIDS 700 - 799 */ DATA(insert OID = 710 ( getpgusername PGUID 11 f t f 0 f 19 "0" 100 0 0 100 foo bar )); @@ -922,9 +922,9 @@ DESCR("random"); DATA(insert OID = 715 ( oidsrand PGUID 11 f t f 1 f 16 "23" 100 0 0 100 foo bar )); DESCR("seed random number generator"); DATA(insert OID = 716 ( oideqint4 PGUID 11 f t f 2 f 16 "26 23" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 717 ( int4eqoid PGUID 11 f t f 2 f 16 "23 26" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 720 ( byteaGetSize PGUID 11 f t f 1 f 23 "17" 100 0 0 100 foo bar )); DESCR(""); @@ -954,14 +954,14 @@ DESCR(""); DATA(insert OID = 740 ( text_lt PGUID 11 f t f 2 f 16 "25 25" 100 0 0 0 foo bar )); DESCR("less-than"); DATA(insert OID = 741 ( text_le PGUID 11 f t f 2 f 16 "25 25" 100 0 0 0 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 742 ( text_gt PGUID 11 f t f 2 f 16 "25 25" 100 0 0 0 foo bar )); DESCR("greater-than"); DATA(insert OID = 743 ( text_ge PGUID 11 f t f 2 f 16 "25 25" 100 0 0 0 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 744 ( array_eq PGUID 11 f t f 2 f 16 "0 0" 100 0 0 100 foo bar)); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 745 ( array_assgn PGUID 11 f t f 8 f 23 "0 23 0 0 0 23 23 0" 100 0 0 100 foo bar)); DESCR("array"); DATA(insert OID = 746 ( array_clip PGUID 11 f t f 7 f 23 "0 23 0 0 23 23 0" 100 0 0 100 foo bar)); @@ -1032,7 +1032,7 @@ DATA(insert OID = 782 ( gistbuild PGUID 11 f t f 9 f 23 "0" 100 0 0 100 fo DESCR("gist(internal)"); DATA(insert OID = 784 ( intervaleq PGUID 11 f t f 2 f 16 "704 704" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 785 ( intervalne PGUID 11 f t f 2 f 16 "704 704" 100 0 0 100 foo bar )); DESCR("not equal"); DATA(insert OID = 786 ( intervallt PGUID 11 f t f 2 f 16 "704 704" 100 0 0 100 foo bar )); @@ -1040,9 +1040,9 @@ DESCR("less-than"); DATA(insert OID = 787 ( intervalgt PGUID 11 f t f 2 f 16 "704 704" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 788 ( intervalle PGUID 11 f t f 2 f 16 "704 704" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 789 ( intervalge PGUID 11 f t f 2 f 16 "704 704" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); /* OIDS 800 - 899 */ @@ -1060,11 +1060,11 @@ DESCR("(internal)"); DATA(insert OID = 822 ( oidint2lt PGUID 11 f t f 2 f 16 "810 810" 100 0 0 100 foo bar)); DESCR("less-than"); DATA(insert OID = 823 ( oidint2le PGUID 11 f t f 2 f 16 "810 810" 100 0 0 100 foo bar)); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 824 ( oidint2eq PGUID 11 f t f 2 f 16 "810 810" 100 0 0 100 foo bar)); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 825 ( oidint2ge PGUID 11 f t f 2 f 16 "810 810" 100 0 0 100 foo bar)); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 826 ( oidint2gt PGUID 11 f t f 2 f 16 "810 810" 100 0 0 100 foo bar)); DESCR("greater-than"); DATA(insert OID = 827 ( oidint2ne PGUID 11 f t f 2 f 16 "810 810" 100 0 0 100 foo bar)); @@ -1101,9 +1101,9 @@ DESCR("less-than"); DATA(insert OID = 855 ( int48gt PGUID 11 f t f 2 f 16 "21 20" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 856 ( int48le PGUID 11 f t f 2 f 16 "21 20" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 857 ( int48ge PGUID 11 f t f 2 f 16 "21 20" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 860 ( char_bpchar PGUID 11 f t f 1 f 1042 "18" 100 0 0 100 foo bar )); DESCR("convert to bpchar"); @@ -1130,17 +1130,17 @@ DESCR("(internal)"); DATA(insert OID = 1273 ( cash_words_out PGUID 11 f t f 1 f 25 "790" 100 0 0 100 foo bar )); DESCR("output amount as words"); DATA(insert OID = 888 ( cash_eq PGUID 11 f t f 2 f 16 "790 790" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 889 ( cash_ne PGUID 11 f t f 2 f 16 "790 790" 100 0 0 100 foo bar )); DESCR("not equal"); DATA(insert OID = 890 ( cash_lt PGUID 11 f t f 2 f 16 "790 790" 100 0 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 891 ( cash_le PGUID 11 f t f 2 f 16 "790 790" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 892 ( cash_gt PGUID 11 f t f 2 f 16 "790 790" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 893 ( cash_ge PGUID 11 f t f 2 f 16 "790 790" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 894 ( cash_pl PGUID 11 f t f 2 f 790 "790 790" 100 0 0 100 foo bar )); DESCR("addition"); DATA(insert OID = 895 ( cash_mi PGUID 11 f t f 2 f 790 "790 790" 100 0 0 100 foo bar )); @@ -1166,11 +1166,11 @@ DESCR("(internal)"); DATA(insert OID = 922 ( oidint4lt PGUID 11 f t f 2 f 16 "910 910" 100 0 0 100 foo bar)); DESCR("less-than"); DATA(insert OID = 923 ( oidint4le PGUID 11 f t f 2 f 16 "910 910" 100 0 0 100 foo bar)); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 924 ( oidint4eq PGUID 11 f t f 2 f 16 "910 910" 100 0 0 100 foo bar)); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 925 ( oidint4ge PGUID 11 f t f 2 f 16 "910 910" 100 0 0 100 foo bar)); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 926 ( oidint4gt PGUID 11 f t f 2 f 16 "910 910" 100 0 0 100 foo bar)); DESCR("greater-than"); DATA(insert OID = 927 ( oidint4ne PGUID 11 f t f 2 f 16 "910 910" 100 0 0 100 foo bar)); @@ -1197,11 +1197,11 @@ DESCR("(internal)"); DATA(insert OID = 942 ( oidnamelt PGUID 11 f t f 2 f 16 "911 911" 100 0 0 100 foo bar)); DESCR("less-than"); DATA(insert OID = 943 ( oidnamele PGUID 11 f t f 2 f 16 "911 911" 100 0 0 100 foo bar)); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 944 ( oidnameeq PGUID 11 f t f 2 f 16 "911 911" 100 0 0 100 foo bar)); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 945 ( oidnamege PGUID 11 f t f 2 f 16 "911 911" 100 0 0 100 foo bar)); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 946 ( oidnamegt PGUID 11 f t f 2 f 16 "911 911" 100 0 0 100 foo bar)); DESCR("greater-than"); DATA(insert OID = 947 ( oidnamene PGUID 11 f t f 2 f 16 "911 911" 100 0 0 100 foo bar)); @@ -1266,11 +1266,11 @@ DESCR("less-than"); DATA(insert OID = 983 ( path_n_gt PGUID 11 f t f 2 f 16 "602 602" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 984 ( path_n_eq PGUID 11 f t f 2 f 16 "602 602" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 985 ( path_n_le PGUID 11 f t f 2 f 16 "602 602" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 986 ( path_n_ge PGUID 11 f t f 2 f 16 "602 602" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 987 ( path_length PGUID 11 f t f 1 f 701 "602" 100 0 1 0 foo bar )); DESCR("sum of path segments"); DATA(insert OID = 988 ( point_ne PGUID 11 f t f 2 f 16 "600 600" 100 0 0 100 foo bar )); @@ -1296,7 +1296,7 @@ DESCR("is vertical"); DATA(insert OID = 998 ( lseg_horizontal PGUID 11 f t f 1 f 16 "601" 100 0 0 100 foo bar )); DESCR("is horizontal"); DATA(insert OID = 999 ( lseg_eq PGUID 11 f t f 2 f 16 "601 601" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); /* OIDS 1000 - 1999 */ @@ -1325,27 +1325,27 @@ DESCR("(internal)"); DATA(insert OID = 1047 ( varcharout PGUID 11 f t f 1 f 23 "0" 100 0 0 100 foo bar )); DESCR("(internal)"); DATA(insert OID = 1048 ( bpchareq PGUID 11 f t f 2 f 16 "1042 1042" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 1049 ( bpcharlt PGUID 11 f t f 2 f 16 "1042 1042" 100 0 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 1050 ( bpcharle PGUID 11 f t f 2 f 16 "1042 1042" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 1051 ( bpchargt PGUID 11 f t f 2 f 16 "1042 1042" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 1052 ( bpcharge PGUID 11 f t f 2 f 16 "1042 1042" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 1053 ( bpcharne PGUID 11 f t f 2 f 16 "1042 1042" 100 0 0 100 foo bar )); DESCR("not equal"); DATA(insert OID = 1070 ( varchareq PGUID 11 f t f 2 f 16 "1043 1043" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 1071 ( varcharlt PGUID 11 f t f 2 f 16 "1043 1043" 100 0 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 1072 ( varcharle PGUID 11 f t f 2 f 16 "1043 1043" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 1073 ( varchargt PGUID 11 f t f 2 f 16 "1043 1043" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 1074 ( varcharge PGUID 11 f t f 2 f 16 "1043 1043" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 1075 ( varcharne PGUID 11 f t f 2 f 16 "1043 1043" 100 0 0 100 foo bar )); DESCR("not equal"); DATA(insert OID = 1078 ( bpcharcmp PGUID 11 f t f 2 f 23 "1042 1042" 100 0 0 100 foo bar )); @@ -1362,15 +1362,15 @@ DESCR("(internal)"); DATA(insert OID = 1085 ( date_out PGUID 11 f t f 1 f 23 "0" 100 0 0 100 foo bar )); DESCR("(internal)"); DATA(insert OID = 1086 ( date_eq PGUID 11 f t f 2 f 16 "1082 1082" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 1087 ( date_lt PGUID 11 f t f 2 f 16 "1082 1082" 100 0 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 1088 ( date_le PGUID 11 f t f 2 f 16 "1082 1082" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 1089 ( date_gt PGUID 11 f t f 2 f 16 "1082 1082" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 1090 ( date_ge PGUID 11 f t f 2 f 16 "1082 1082" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 1091 ( date_ne PGUID 11 f t f 2 f 16 "1082 1082" 100 0 0 100 foo bar )); DESCR("not equal"); DATA(insert OID = 1092 ( date_cmp PGUID 11 f t f 2 f 23 "1082 1082" 100 0 0 100 foo bar )); @@ -1381,11 +1381,11 @@ DESCR("less-equal-greater"); DATA(insert OID = 1102 ( time_lt PGUID 11 f t f 2 f 16 "1083 1083" 100 0 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 1103 ( time_le PGUID 11 f t f 2 f 16 "1083 1083" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 1104 ( time_gt PGUID 11 f t f 2 f 16 "1083 1083" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 1105 ( time_ge PGUID 11 f t f 2 f 16 "1083 1083" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 1106 ( time_ne PGUID 11 f t f 2 f 16 "1083 1083" 100 0 0 100 foo bar )); DESCR("not equal"); DATA(insert OID = 1107 ( time_cmp PGUID 11 f t f 2 f 23 "1083 1083" 100 0 0 100 foo bar )); @@ -1405,7 +1405,7 @@ DESCR("(internal)"); DATA(insert OID = 1144 ( time_out PGUID 11 f t f 1 f 23 "0" 100 0 0 100 foo bar )); DESCR("(internal)"); DATA(insert OID = 1145 ( time_eq PGUID 11 f t f 2 f 16 "1083 1083" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 1146 ( circle_add_pt PGUID 11 f t f 2 f 718 "718 600" 100 0 0 100 foo bar )); DESCR("addition"); @@ -1421,15 +1421,15 @@ DESCR("(internal)"); DATA(insert OID = 1151 ( datetime_out PGUID 11 f t f 1 f 23 "0" 100 0 0 100 foo bar )); DESCR("(internal)"); DATA(insert OID = 1152 ( datetime_eq PGUID 11 f t f 2 f 16 "1184 1184" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 1153 ( datetime_ne PGUID 11 f t f 2 f 16 "1184 1184" 100 0 0 100 foo bar )); DESCR("not equal"); DATA(insert OID = 1154 ( datetime_lt PGUID 11 f t f 2 f 16 "1184 1184" 100 0 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 1155 ( datetime_le PGUID 11 f t f 2 f 16 "1184 1184" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 1156 ( datetime_ge PGUID 11 f t f 2 f 16 "1184 1184" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 1157 ( datetime_gt PGUID 11 f t f 2 f 16 "1184 1184" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 1158 ( datetime_finite PGUID 11 f t f 1 f 16 "1184" 100 0 0 100 foo bar )); @@ -1442,15 +1442,15 @@ DESCR("(internal)"); DATA(insert OID = 1161 ( timespan_out PGUID 11 f t f 1 f 23 "0" 100 0 0 100 foo bar )); DESCR("(internal)"); DATA(insert OID = 1162 ( timespan_eq PGUID 11 f t f 2 f 16 "1186 1186" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 1163 ( timespan_ne PGUID 11 f t f 2 f 16 "1186 1186" 100 0 0 100 foo bar )); DESCR("not equal"); DATA(insert OID = 1164 ( timespan_lt PGUID 11 f t f 2 f 16 "1186 1186" 100 0 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 1165 ( timespan_le PGUID 11 f t f 2 f 16 "1186 1186" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 1166 ( timespan_ge PGUID 11 f t f 2 f 16 "1186 1186" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 1167 ( timespan_gt PGUID 11 f t f 2 f 16 "1186 1186" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 1168 ( timespan_um PGUID 11 f t f 1 f 1186 "1186" 100 0 0 100 foo bar )); @@ -1576,7 +1576,7 @@ DESCR("current transaction time"); /* OIDS 1300 - 1399 */ DATA(insert OID = 1306 ( timestampeq PGUID 11 f t f 2 f 16 "1296 1296" 100 0 0 100 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 1307 ( timestampne PGUID 11 f t f 2 f 16 "1296 1296" 100 0 0 100 foo bar )); DESCR("not equal"); DATA(insert OID = 1308 ( timestamplt PGUID 11 f t f 2 f 16 "1296 1296" 100 0 0 100 foo bar )); @@ -1584,9 +1584,9 @@ DESCR("less-than"); DATA(insert OID = 1309 ( timestampgt PGUID 11 f t f 2 f 16 "1296 1296" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 1310 ( timestample PGUID 11 f t f 2 f 16 "1296 1296" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 1311 ( timestampge PGUID 11 f t f 2 f 16 "1296 1296" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 1314 ( datetime_cmp PGUID 11 f t f 2 f 23 "1184 1184" 100 0 0 100 foo bar )); DESCR("less-equal-greater"); DATA(insert OID = 1315 ( timespan_cmp PGUID 11 f t f 2 f 23 "1186 1186" 100 0 0 100 foo bar )); @@ -1849,7 +1849,7 @@ DESCR("is below"); DATA(insert OID = 1461 ( circle_above PGUID 11 f t f 2 f 16 "718 718" 100 0 1 0 foo bar )); DESCR("is above"); DATA(insert OID = 1462 ( circle_eq PGUID 11 f t f 2 f 16 "718 718" 100 0 1 0 foo bar )); -DESCR("equals"); +DESCR("equal"); DATA(insert OID = 1463 ( circle_ne PGUID 11 f t f 2 f 16 "718 718" 100 0 1 0 foo bar )); DESCR("not equal"); DATA(insert OID = 1464 ( circle_lt PGUID 11 f t f 2 f 16 "718 718" 100 0 1 0 foo bar )); @@ -1857,9 +1857,9 @@ DESCR("less-than"); DATA(insert OID = 1465 ( circle_gt PGUID 11 f t f 2 f 16 "718 718" 100 0 1 0 foo bar )); DESCR("greater-than"); DATA(insert OID = 1466 ( circle_le PGUID 11 f t f 2 f 16 "718 718" 100 0 1 0 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 1467 ( circle_ge PGUID 11 f t f 2 f 16 "718 718" 100 0 1 0 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 1468 ( circle_area PGUID 11 f t f 1 f 701 "718" 100 0 1 0 foo bar )); DESCR("area"); DATA(insert OID = 1469 ( circle_diameter PGUID 11 f t f 1 f 701 "718" 100 0 1 0 foo bar )); @@ -1895,11 +1895,11 @@ DESCR("not equal"); DATA(insert OID = 1483 ( lseg_lt PGUID 11 f t f 2 f 16 "601 601" 100 0 0 100 foo bar )); DESCR("less-than"); DATA(insert OID = 1484 ( lseg_le PGUID 11 f t f 2 f 16 "601 601" 100 0 0 100 foo bar )); -DESCR("less-than-or-equals"); +DESCR("less-than-or-equal"); DATA(insert OID = 1485 ( lseg_gt PGUID 11 f t f 2 f 16 "601 601" 100 0 0 100 foo bar )); DESCR("greater-than"); DATA(insert OID = 1486 ( lseg_ge PGUID 11 f t f 2 f 16 "601 601" 100 0 0 100 foo bar )); -DESCR("greater-than-or-equals"); +DESCR("greater-than-or-equal"); DATA(insert OID = 1487 ( lseg_length PGUID 11 f t f 1 f 701 "601" 100 0 1 0 foo bar )); DESCR("distance between endpoints"); DATA(insert OID = 1488 ( close_ls PGUID 11 f t f 2 f 600 "628 601" 100 0 10 100 foo bar )); diff --git a/src/include/commands/variable.h b/src/include/commands/variable.h index ebf6390116d..c727dc027bb 100644 --- a/src/include/commands/variable.h +++ b/src/include/commands/variable.h @@ -2,7 +2,7 @@ * Headers for handling of 'SET var TO', 'SHOW var' and 'RESET var' * statements * - * $Id: variable.h,v 1.3 1998/06/16 07:29:40 momjian Exp $ + * $Id: variable.h,v 1.4 1998/07/18 18:34:21 momjian Exp $ * */ #ifndef VARIABLE_H @@ -54,7 +54,7 @@ extern bool set_geqo(void); extern bool show_geqo(void); extern bool reset_geqo(void); extern bool parse_geqo(const char *); -#ifdef MB +#ifdef MULTIBYTE extern bool show_client_encoding(void); extern bool reset_client_encoding(void); extern bool parse_client_encoding(const char *); diff --git a/src/include/libpq/libpq.h b/src/include/libpq/libpq.h index 6f53b6b5b56..4b2f95056ba 100644 --- a/src/include/libpq/libpq.h +++ b/src/include/libpq/libpq.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: libpq.h,v 1.18 1998/07/13 16:34:53 momjian Exp $ + * $Id: libpq.h,v 1.19 1998/07/18 18:34:23 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -270,7 +270,7 @@ extern void pq_putint(int i, int b); extern int pq_getinaddr(struct sockaddr_in * sin, char *host, int port); extern int pq_getinserv(struct sockaddr_in * sin, char *host, char *serv); -#ifdef MB +#ifdef MULTIBYTE extern void pq_putncharlen(char *s, int n); #endif diff --git a/src/include/regex/pg_wchar.h b/src/include/regex/pg_wchar.h index bfbd8ba37bb..a37c253e1f2 100644 --- a/src/include/regex/pg_wchar.h +++ b/src/include/regex/pg_wchar.h @@ -1,4 +1,4 @@ -/* $Id: pg_wchar.h,v 1.3 1998/06/16 07:29:43 momjian Exp $ */ +/* $Id: pg_wchar.h,v 1.4 1998/07/18 18:34:24 momjian Exp $ */ #ifndef PG_WCHAR_H #define PG_WCHAR_H @@ -19,8 +19,8 @@ /* followings are for client encoding only */ #define SJIS 16 /* Shift JIS */ -#ifdef MB -# if LATIN1 <= MB && MB <= LATIN5 +#ifdef MULTIBYTE +# if LATIN1 <= MULTIBYTE && MULTIBYTE <= LATIN5 typedef unsigned char pg_wchar; # else typedef unsigned int pg_wchar; @@ -65,7 +65,7 @@ typedef unsigned int pg_wchar; #define LC_CNS11643_6 0xf9 /* CNS 11643-1992 Plane 6 */ #define LC_CNS11643_7 0xfa /* CNS 11643-1992 Plane 7 */ -#ifdef MB +#ifdef MULTIBYTE extern void pg_mb2wchar(const unsigned char *, pg_wchar *); extern void pg_mb2wchar_with_len(const unsigned char *, pg_wchar *, int); extern int pg_char_and_wchar_strcmp(const char *, const pg_wchar *); diff --git a/src/include/regex/regex.h b/src/include/regex/regex.h index f0c9876fe06..672ed2a382f 100644 --- a/src/include/regex/regex.h +++ b/src/include/regex/regex.h @@ -52,7 +52,7 @@ typedef struct size_t re_nsub; /* number of parenthesized subexpressions */ const pg_wchar *re_endp; /* end pointer for REG_PEND */ struct re_guts *re_g; /* none of your business :-) */ -#ifdef MB +#ifdef MULTIBYTE pg_wchar *patsave; /* mee too :-) */ #endif diff --git a/src/include/regex/regex2.h b/src/include/regex/regex2.h index 4590862486c..3bd1469750d 100644 --- a/src/include/regex/regex2.h +++ b/src/include/regex/regex2.h @@ -127,7 +127,7 @@ typedef struct { uch *ptr; /* -> uch [csetsize] */ uch mask; /* bit within array */ -#ifdef MB +#ifdef MULTIBYTE pg_wchar hash; /* hash code */ unsigned int lc; /* leading character (character-set) */ #else @@ -138,7 +138,7 @@ typedef struct } cset; /* note that CHadd and CHsub are unsafe, and CHIN doesn't yield 0/1 */ -#ifdef MB +#ifdef MULTIBYTE #define CHlc(c) (((unsigned)(c)&0xff0000)>>16) #define CHadd(cs, c) ((cs)->ptr[(unsigned)(c)&0xffff] |= (cs)->mask, (cs)->hash += (unsigned)(c)&0xffff,\ (cs)->lc = CHlc(c)) @@ -196,12 +196,12 @@ struct re_guts }; /* misc utilities */ -#ifdef MB -# if MB == MULE_INTERNAL +#ifdef MULTIBYTE +# if MULTIBYTE == MULE_INTERNAL # define OUT (16777216+1) /* 16777216 == 2^24 == 3 bytes */ -# elif MB == EUC_JP || MB == EUC_CN || MB == EUC_KR || MB == EUC_TW +# elif MULTIBYTE == EUC_JP || MULTIBYTE == EUC_CN || MULTIBYTE == EUC_KR || MULTIBYTE == EUC_TW # define OUT (USHRT_MAX+1) /* 2 bytes */ -# elif MB == UNICODE +# elif MULTIBYTE == UNICODE # define OUT (USHRT_MAX+1) /* 2 bytes. assuming UCS-2 */ # else # define OUT (UCHAR_MAX+1) /* other codes. assuming 1 byte */ @@ -210,7 +210,7 @@ struct re_guts # define OUT (CHAR_MAX+1) /* a non-character value */ #endif -#ifdef MB +#ifdef MULTIBYTE #define ISWORD(c) ((c >= 0 && c <= UCHAR_MAX) && \ (isalnum(c) || (c) == '_')) #else diff --git a/src/include/regex/utils.h b/src/include/regex/utils.h index 6f02759aa14..e6f169065fb 100644 --- a/src/include/regex/utils.h +++ b/src/include/regex/utils.h @@ -43,7 +43,7 @@ #define DUPMAX 100000000 /* xxx is this right? */ #define INFINITY (DUPMAX + 1) -#ifdef MB +#ifdef MULTIBYTE #define NC (SHRT_MAX - SHRT_MIN + 1) #else #define NC (CHAR_MAX - CHAR_MIN + 1) diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 7d161763064..7833f635ac0 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.74 1998/07/09 03:32:10 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.75 1998/07/18 18:34:30 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -124,7 +124,7 @@ struct EnvironmentOptions { "PGTZ", "timezone" }, -#ifdef MB +#ifdef MULTIBYTE { "PGCLIENTENCODING", "client_encoding" }, diff --git a/src/interfaces/libpq/fe-print.c b/src/interfaces/libpq/fe-print.c index 586ec370aa4..be1983ad773 100644 --- a/src/interfaces/libpq/fe-print.c +++ b/src/interfaces/libpq/fe-print.c @@ -9,7 +9,7 @@ * didn't really belong there. * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.6 1998/07/03 04:24:15 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.7 1998/07/18 18:34:33 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -35,7 +35,7 @@ #endif #endif /* WIN32 */ -#ifdef MB +#ifdef MULTIBYTE #include "regex/pg_wchar.h" #include "commands/variable.h" #endif @@ -494,7 +494,7 @@ PQprintTuples(PGresult *res, } } -#ifdef MB +#ifdef MULTIBYTE /* * returns the byte length of the word beginning s. * Client side encoding is determined by the environment variable @@ -512,7 +512,7 @@ int PQmblen(unsigned char *s) encoding = pg_char_to_encoding(str); } if (encoding < 0) { - encoding = MB; + encoding = MULTIBYTE; } return(pg_encoding_mblen(encoding, s)); } @@ -551,7 +551,7 @@ do_field(PQprintOpt *po, PGresult *res, if (!skipit) { -#ifdef MB +#ifdef MULTIBYTE int len; for (p = pval, o = buf; *p; diff --git a/src/interfaces/libpq/libpq-fe.h b/src/interfaces/libpq/libpq-fe.h index 5cff4a6317a..d0265762e13 100644 --- a/src/interfaces/libpq/libpq-fe.h +++ b/src/interfaces/libpq/libpq-fe.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: libpq-fe.h,v 1.35 1998/07/14 02:41:25 momjian Exp $ + * $Id: libpq-fe.h,v 1.36 1998/07/18 18:34:34 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -368,7 +368,7 @@ extern "C" * 0, use variable width */ ); -#ifdef MB +#ifdef MULTIBYTE extern int PQmblen(unsigned char *s); #endif -- GitLab