1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +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:
Bruce Momjian
1998-07-18 18:34:34 +00:00
parent 550f209797
commit 7b2b779a2a
26 changed files with 452 additions and 392 deletions

View File

@@ -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()

View File

@@ -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
},