Massimo's SET FSYNC and SHOW PG_OPTIONS changes, without SET QUERY_LIMIT.

This commit is contained in:
Bruce Momjian 1999-09-27 20:27:32 +00:00
parent 5a017b96ad
commit d62a7ac6d3
8 changed files with 59 additions and 129 deletions

View File

@ -1,119 +0,0 @@
From owner-pgsql-general@hub.org Fri Oct 9 18:22:09 1998
Received: from hub.org (majordom@hub.org [209.47.148.200])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id SAA04220
for <maillist@candle.pha.pa.us>; Fri, 9 Oct 1998 18:22:08 -0400 (EDT)
Received: from localhost (majordom@localhost)
by hub.org (8.8.8/8.8.8) with SMTP id SAA26960;
Fri, 9 Oct 1998 18:18:29 -0400 (EDT)
(envelope-from owner-pgsql-general@hub.org)
Received: by hub.org (TLB v0.10a (1.23 tibbs 1997/01/09 00:29:32)); Fri, 09 Oct 1998 18:18:07 +0000 (EDT)
Received: (from majordom@localhost)
by hub.org (8.8.8/8.8.8) id SAA26917
for pgsql-general-outgoing; Fri, 9 Oct 1998 18:18:04 -0400 (EDT)
(envelope-from owner-pgsql-general@postgreSQL.org)
X-Authentication-Warning: hub.org: majordom set sender to owner-pgsql-general@postgreSQL.org using -f
Received: from gecko.statsol.com (gecko.statsol.com [198.11.51.133])
by hub.org (8.8.8/8.8.8) with ESMTP id SAA26904
for <pgsql-general@postgresql.org>; Fri, 9 Oct 1998 18:17:46 -0400 (EDT)
(envelope-from statsol@statsol.com)
Received: from gecko (gecko [198.11.51.133])
by gecko.statsol.com (8.9.0/8.9.0) with SMTP id SAA00557
for <pgsql-general@postgresql.org>; Fri, 9 Oct 1998 18:18:00 -0400 (EDT)
Date: Fri, 9 Oct 1998 18:18:00 -0400 (EDT)
From: Steve Doliov <statsol@statsol.com>
X-Sender: statsol@gecko
To: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] Making NULLs visible.
Message-ID: <Pine.GSO.3.96.981009181716.545B-100000@gecko>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-pgsql-general@postgreSQL.org
Precedence: bulk
Status: RO
On Fri, 9 Oct 1998, Bruce Momjian wrote:
> [Charset iso-8859-1 unsupported, filtering to ASCII...]
> > > Yes, \ always outputs as \\, excepts someone changed it last week, and I
> > > am requesting a reversal. Do you like the \N if it is unique?
> >
> > Well, it's certainly clear, but could be confused with \n (newline). Can we
> > have \0 instead?
>
> Yes, but it is uppercase. \0 looks like an octal number to me, and I
> think we even output octals sometimes, don't we?
>
my first suggestion may have been hare-brained, but why not just make the
specifics of the output user-configurable. So if the user chooses \0, so
be it, if the user chooses \N so be it, if the user likes NULL so be it.
but the option would only have one value per database at any given point
in time. so database x could use \N on tuesday and NULL on wednesday, but
database x could never have two references to the characters(s) used to
represent a null value.
steve
From owner-pgsql-general@hub.org Sun Oct 11 17:31:08 1998
Received: from renoir.op.net (root@renoir.op.net [209.152.193.4])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id RAA20043
for <maillist@candle.pha.pa.us>; Sun, 11 Oct 1998 17:31:02 -0400 (EDT)
Received: from hub.org (majordom@hub.org [209.47.148.200]) by renoir.op.net (o1/$ Revision: 1.18 $) with ESMTP id RAA03069 for <maillist@candle.pha.pa.us>; Sun, 11 Oct 1998 17:10:34 -0400 (EDT)
Received: from localhost (majordom@localhost)
by hub.org (8.8.8/8.8.8) with SMTP id QAA10856;
Sun, 11 Oct 1998 16:57:34 -0400 (EDT)
(envelope-from owner-pgsql-general@hub.org)
Received: by hub.org (TLB v0.10a (1.23 tibbs 1997/01/09 00:29:32)); Sun, 11 Oct 1998 16:53:35 +0000 (EDT)
Received: (from majordom@localhost)
by hub.org (8.8.8/8.8.8) id QAA10393
for pgsql-general-outgoing; Sun, 11 Oct 1998 16:53:34 -0400 (EDT)
(envelope-from owner-pgsql-general@postgreSQL.org)
X-Authentication-Warning: hub.org: majordom set sender to owner-pgsql-general@postgreSQL.org using -f
Received: from mail1.panix.com (mail1.panix.com [166.84.0.212])
by hub.org (8.8.8/8.8.8) with ESMTP id QAA10378
for <pgsql-general@postgreSQL.org>; Sun, 11 Oct 1998 16:53:28 -0400 (EDT)
(envelope-from tomg@admin.nrnet.org)
Received: from mailhost.nrnet.org (root@mailhost.nrnet.org [166.84.192.39])
by mail1.panix.com (8.8.8/8.8.8/PanixM1.3) with ESMTP id QAA16311
for <pgsql-general@postgreSQL.org>; Sun, 11 Oct 1998 16:53:24 -0400 (EDT)
Received: from admin.nrnet.org (uucp@localhost)
by mailhost.nrnet.org (8.8.7/8.8.4) with UUCP
id QAA16345 for pgsql-general@postgreSQL.org; Sun, 11 Oct 1998 16:28:47 -0400
Received: from localhost (tomg@localhost)
by admin.nrnet.org (8.8.7/8.8.7) with SMTP id QAA11569
for <pgsql-general@postgreSQL.org>; Sun, 11 Oct 1998 16:28:41 -0400
Date: Sun, 11 Oct 1998 16:28:41 -0400 (EDT)
From: Thomas Good <tomg@admin.nrnet.org>
To: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] Making NULLs visible.
In-Reply-To: <Pine.GSO.3.96.981009181716.545B-100000@gecko>
Message-ID: <Pine.LNX.3.96.981011161908.11556A-100000@admin.nrnet.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-pgsql-general@postgreSQL.org
Precedence: bulk
Status: RO
Watching all this go by...as a guy who has to move alot of data
from legacy dbs to postgres, I've gotten used to \N being a null.
My vote, if I were allowed to cast one, would be to have one null
and that would be the COPY command null. I have no difficulty
distinguishing a null from a newline...
At the pgsql command prompt I would find seeing \N rather reassuring.
I've seen alot of these little guys.
---------- Sisters of Charity Medical Center ----------
Department of Psychiatry
----
Thomas Good <tomg@q8.nrnet.org>
Coordinator, North Richmond C.M.H.C. Information Systems
75 Vanderbilt Ave, Quarters 8 Phone: 718-354-5528
Staten Island, NY 10304 Fax: 718-354-5056

View File

@ -7,7 +7,7 @@
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.67 1999/09/18 19:06:27 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.68 1999/09/27 20:26:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -134,7 +134,6 @@ static char *relname; /* current relation name */
Form_pg_attribute attrtypes[MAXATTR]; /* points to attribute info */
static char *values[MAXATTR]; /* cooresponding attribute values */
int numattr; /* number of attributes for cur. rel */
extern bool disableFsync; /* do not fsync the database */
int DebugMode;
static GlobalMemory nogc = (GlobalMemory) NULL; /* special no-gc mem

View File

@ -2,7 +2,7 @@
* Routines for handling of 'SET var TO',
* 'SHOW var' and 'RESET var' statements.
*
* $Id: variable.c,v 1.25 1999/07/17 20:16:54 momjian Exp $
* $Id: variable.c,v 1.26 1999/09/27 20:27:03 momjian Exp $
*
*/
@ -11,11 +11,13 @@
#include "postgres.h"
#include "access/xact.h"
#include "catalog/pg_shadow.h"
#include "commands/variable.h"
#include "miscadmin.h"
#include "optimizer/internal.h"
#include "utils/builtins.h"
#include "utils/tqual.h"
#include "utils/trace.h"
#ifdef MULTIBYTE
#include "mb/pg_wchar.h"
@ -528,6 +530,36 @@ reset_timezone()
return TRUE;
} /* reset_timezone() */
/*
* Pg_options
*/
static bool
parse_pg_options(const char *value)
{
if (!superuser()) {
elog(ERROR, "Only users with superuser privilege can set pg_options");
}
parse_options((char *) value, TRUE);
return (TRUE);
}
static bool
show_pg_options(void)
{
show_options();
return (TRUE);
}
static bool
reset_pg_options(void)
{
if (!superuser()) {
elog(ERROR, "Only users with superuser privilege can set pg_options");
}
read_pg_options(0);
return (TRUE);
}
/*-----------------------------------------------------------------------*/
struct VariableParsers
@ -568,6 +600,9 @@ struct VariableParsers
{
"XactIsoLevel", parse_XactIsoLevel, show_XactIsoLevel, reset_XactIsoLevel
},
{
"pg_options", parse_pg_options, show_pg_options, reset_pg_options
},
{
NULL, NULL, NULL, NULL
}

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.36 1999/07/17 20:18:08 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.37 1999/09/27 20:27:09 momjian Exp $
*
* NOTES
* Globals used all over the place should be declared here and not
@ -76,7 +76,6 @@ char DateFormat[20] = "%d-%m-%Y"; /* mjl: sizes! or better
* malloc? XXX */
char FloatFormat[20] = "%f";
bool disableFsync = false;
bool allowSystemTableMods = false;
int SortMem = 512;

View File

@ -73,6 +73,7 @@ static char *opt_names[] = {
"lock_debug_relid",
"lock_read_priority", /* lock priority, see lock.c */
"deadlock_timeout", /* deadlock timeout, see proc.c */
"nofsync", /* turn fsync off */
"syslog", /* use syslog for error messages */
"hostlookup", /* enable hostname lookup in ps_status */
"showportnumber", /* show port number in ps_status */
@ -405,6 +406,16 @@ read_pg_options(SIGNAL_ARGS)
close(fd);
}
void
show_options(void)
{
int i;
for (i=0; i<NUM_PG_OPTIONS; i++) {
elog(NOTICE, "%s=%d", opt_names[i], pg_options[i]);
}
}
/*
* Local variables:
* tab-width: 4

View File

@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: psqlHelp.h,v 1.74 1999/09/23 17:11:16 momjian Exp $
* $Id: psqlHelp.h,v 1.75 1999/09/27 20:27:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -296,7 +296,7 @@ static struct _helpStruct QL_HELP[] = {
{"reset",
"set run-time environment back to default",
"\
\tRESET DATESTYLE|COST_HEAP|COST_INDEX|GEQO|KSQO|\n\
\tRESET DATESTYLE|COST_HEAP|COST_INDEX|GEQO|KSQO|PG_OPTIONS|\n\
TIMEZONE|XACTISOLEVEL|CLIENT_ENCODING|SERVER_ENCODING"},
{"revoke",
"revoke access control from a user or group",
@ -329,6 +329,7 @@ TIMEZONE|XACTISOLEVEL|CLIENT_ENCODING|SERVER_ENCODING"},
\tSET COST_INDEX TO #\n\
\tSET GEQO TO 'ON[=#]'|'OFF'\n\
\tSET KSQO TO 'ON'|'OFF'\n\
\tSET PG_OPTIONS TO 'value'\n\
\tSET TIMEZONE TO 'value'\n\
\tSET TRANSACTION ISOLATION LEVEL 'SERIALIZABLE'|'READ COMMITTED'\n\
\tSET CLIENT_ENCODING|NAMES TO 'EUC_JP'|'SJIS'|'EUC_CN'|'EUC_KR'|'EUC_TW'|\n\
@ -340,7 +341,7 @@ TIMEZONE|XACTISOLEVEL|CLIENT_ENCODING|SERVER_ENCODING"},
{"show",
"show current run-time environment",
"\
\tSHOW DATESTYLE|COST_HEAP|COST_INDEX|GEQO|KSQO|\n\
\tSHOW DATESTYLE|COST_HEAP|COST_INDEX|GEQO|KSQO|PG_OPTIONS|\n\
TIMEZONE|XACTISOLEVEL|CLIENT_ENCODING|SERVER_ENCODING"},
{"unlisten",
"stop listening for notification on a condition name",

View File

@ -11,7 +11,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: miscadmin.h,v 1.41 1999/09/24 00:25:16 tgl Exp $
* $Id: miscadmin.h,v 1.42 1999/09/27 20:27:26 momjian Exp $
*
* NOTES
* some of the information in this file will be moved to
@ -22,6 +22,8 @@
#ifndef MISCADMIN_H
#define MISCADMIN_H
#include "utils/trace.h"
/*****************************************************************************
* globals.h -- *
*****************************************************************************/
@ -93,7 +95,7 @@ extern char CTZName[];
extern char FloatFormat[];
extern char DateFormat[];
extern bool disableFsync;
#define disableFsync pg_options[OPT_NOFSYNC]
extern bool allowSystemTableMods;
extern int SortMem;

View File

@ -26,6 +26,7 @@ char *tprintf_timestamp(void);
extern int tprintf(int flag, const char *fmt,...);
extern int eprintf(const char *fmt,...);
extern void write_syslog(int level, char *line);
extern void show_options(void);
extern void parse_options(char *str, bool secure);
extern void read_pg_options(SIGNAL_ARGS);
@ -57,6 +58,7 @@ enum pg_option_enum {
TRACE_LOCKRELATION,
OPT_LOCKREADPRIORITY, /* lock priority, see lock.c */
OPT_DEADLOCKTIMEOUT, /* deadlock timeout, see proc.c */
OPT_NOFSYNC, /* turn fsync off */
OPT_SYSLOG, /* use syslog for error messages */
OPT_HOSTLOOKUP, /* enable hostname lookup in ps_status */
OPT_SHOWPORTNUMBER, /* show port number in ps_status */