mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
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.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user