Re: [HACKERS] allowed user/db variables - Mailing list pgsql-patches

From Joe Conway
Subject Re: [HACKERS] allowed user/db variables
Date
Msg-id 3EFA3089.9020801@joeconway.com
Whole thread Raw
Responses Re: [HACKERS] allowed user/db variables
List pgsql-patches
(moved to PATCHES)

Tom Lane wrote:
> I agree with this plan also.  I'm not sure if the RH guys had intended
> to get around to this or not --- it's not on their shortlist of stuff
> they need for their tools.
>
> The proposed patch from RH includes addition of descriptions to the
> variables' table entries in guc.c.  It might make sense to include these
> as a column in pg_settings as well; but if we do then changing the view
> would have to wait till that patch is submitted and accepted.  (I was
> offline yesterday but it doesn't look like anything's been done; I will
> remind 'em that feature freeze is hard upon us.)

Here is a patch to expand pg_settings. I included more than discussed
because it was easy and I thought it might be useful. Let me know if you
want some of them removed.

Passes all regression tests.

I'll send in a documentation patch once I'm sure what new columns we are
actually going to add (i.e. this patch, descriptions, or some
combination thereof).

If there are no objections, please apply.

Joe

p.s. here is some sample (expanded) output:

regression=# select * from pg_settings;
-[ RECORD 1 ]----+--------------------------------------
name             | add_missing_from
setting          | on
context          | user
vartype          | bool
reset_source     | default
session_source   | default
tentative_source | default
source           | default
boot_val         |
reset_val        | on
session_val      | on
tentative_val    | off
min_val          |
max_val          |

[ ... ]

-[ RECORD 14 ]---+--------------------------------------
name             | DateStyle
setting          | ISO with US (NonEuropean) conventions
context          | user
vartype          | string
reset_source     | default
session_source   | default
tentative_source | default
source           | default
boot_val         | ISO, US
reset_val        | ISO, US
session_val      | ISO, US
tentative_val    |
min_val          |
max_val          |
-[ RECORD 15 ]---+--------------------------------------
name             | db_user_namespace
setting          | off
context          | sighup
vartype          | bool
reset_source     | default
session_source   | default
tentative_source | default
source           | default
boot_val         |
reset_val        | off
session_val      | off
tentative_val    | off
min_val          |
max_val          |

[ ... ]

-[ RECORD 26 ]---+--------------------------------------
name             | effective_cache_size
setting          | 1000
context          | user
vartype          | real
reset_source     | default
session_source   | default
tentative_source | default
source           | default
boot_val         |
reset_val        | 1000
session_val      | 1000
tentative_val    | 0
min_val          | 0
max_val          | 1.79769e+308

[ ... ]

-[ RECORD 55 ]---+--------------------------------------
name             | log_duration
setting          | off
context          | super-user
vartype          | bool
reset_source     | default
session_source   | default
tentative_source | default
source           | default
boot_val         |
reset_val        | off
session_val      | off
tentative_val    | off
min_val          |
max_val          |

[ ... ]

-[ RECORD 83 ]---+--------------------------------------
name             | shared_buffers
setting          | 64
context          | postmaster
vartype          | integer
reset_source     | default
session_source   | default
tentative_source | default
source           | default
boot_val         |
reset_val        | 64
session_val      | 64
tentative_val    | 0
min_val          | 16
max_val          | 2147483647
Index: src/backend/utils/misc/guc.c
===================================================================
RCS file: /opt/src/cvs/pgsql-server/src/backend/utils/misc/guc.c,v
retrieving revision 1.131
diff -c -r1.131 guc.c
*** src/backend/utils/misc/guc.c    11 Jun 2003 22:13:22 -0000    1.131
--- src/backend/utils/misc/guc.c    25 Jun 2003 23:25:31 -0000
***************
*** 159,168 ****
   */
  enum config_type
  {
!     PGC_BOOL,
!     PGC_INT,
!     PGC_REAL,
!     PGC_STRING
  };

  /* Generic fields applicable to all types of variables */
--- 159,208 ----
   */
  enum config_type
  {
!     PGC_BOOL = 0,
!     PGC_INT = 1,
!     PGC_REAL = 2,
!     PGC_STRING = 3
! };
!
! /*
!  * Used for pg_settings. Keep in sync with config_type enum above
!  */
! static char *config_type_name[] =
! {
!     "bool",
!     "integer",
!     "real",
!     "string"
! };
!
! /*
!  * Used for pg_settings. Keep in sync with GucContext enum in guc.h
!  */
! static char *GucContextName[] =
! {
!     "internal",
!     "postmaster",
!     "sighup",
!     "backend",
!     "super-user",
!     "user"
! };
!
! /*
!  * Used for pg_settings. Keep in sync with GucSource enum in guc.h
!  */
! static char *GucSourceName[] =
! {
!     "default",
!     "environment variable",
!     "configuration file",
!     "command line",
!     "database",
!     "user",
!     "client",
!     "override",
!     "session"
  };

  /* Generic fields applicable to all types of variables */
***************
*** 2617,2639 ****
   * Return GUC variable value by variable number; optionally return canonical
   * form of name.  Return value is palloc'd.
   */
! char *
! GetConfigOptionByNum(int varnum, const char **varname, bool *noshow)
  {
!     struct config_generic *conf;

      /* check requested variable number valid */
      Assert((varnum >= 0) && (varnum < num_guc_variables));

      conf = guc_variables[varnum];

-     if (varname)
-         *varname = conf->name;
-
      if (noshow)
          *noshow = (conf->flags & GUC_NO_SHOW_ALL) ? true : false;

!     return _ShowOption(conf);
  }

  /*
--- 2657,2826 ----
   * Return GUC variable value by variable number; optionally return canonical
   * form of name.  Return value is palloc'd.
   */
! void
! GetConfigOptionByNum(int varnum, const char **values, bool *noshow)
  {
!     char                    buffer[256];
!     struct config_generic  *conf;

      /* check requested variable number valid */
      Assert((varnum >= 0) && (varnum < num_guc_variables));

      conf = guc_variables[varnum];

      if (noshow)
          *noshow = (conf->flags & GUC_NO_SHOW_ALL) ? true : false;

!     /* first get the generic attributes */
!
!     /* name */
!     values[0] = conf->name;
!
!     /* setting : use _ShowOption in order to avoid duplicating the logic */
!     values[1] = _ShowOption(conf);
!
!     /* context */
!     values[2] = GucContextName[conf->context];
!
!     /* vartype */
!     values[3] = config_type_name[conf->vartype];
!
!     /* reset_source */
!     values[4] = GucSourceName[conf->reset_source];
!
!     /* session_source */
!     values[5] = GucSourceName[conf->session_source];
!
!     /* tentative_source */
!     values[6] = GucSourceName[conf->tentative_source];
!
!     /* source */
!     values[7] = GucSourceName[conf->source];
!
!     /* now get the type specifc attributes */
!     switch (conf->vartype)
!     {
!         case PGC_BOOL:
!             {
!                 struct config_bool *lconf = (struct config_bool *) conf;
!
!                 /* boot_val */
!                 values[8] = NULL;
!
!                 /* reset_val */
!                 values[9] = lconf->reset_val ? "on" : "off";
!
!                 /* session_val */
!                 values[10] = lconf->session_val ? "on" : "off";
!
!                 /* tentative_val */
!                 values[11] = lconf->tentative_val ? "on" : "off";
!
!                 /* min_val */
!                 values[12] = NULL;
!
!                 /* max_val */
!                 values[13] = NULL;
!             }
!             break;
!
!         case PGC_INT:
!             {
!                 struct config_int *lconf = (struct config_int *) conf;
!
!                 /* boot_val */
!                 values[8] = NULL;
!
!                 /* reset_val */
!                 snprintf(buffer, sizeof(buffer), "%d", lconf->reset_val);
!                 values[9] = pstrdup(buffer);
!
!                 /* session_val */
!                 snprintf(buffer, sizeof(buffer), "%d", lconf->session_val);
!                 values[10] = pstrdup(buffer);
!
!                 /* tentative_val */
!                 snprintf(buffer, sizeof(buffer), "%d", lconf->tentative_val);
!                 values[11] = pstrdup(buffer);
!
!                 /* min_val */
!                 snprintf(buffer, sizeof(buffer), "%d", lconf->min);
!                 values[12] = pstrdup(buffer);
!
!                 /* max_val */
!                 snprintf(buffer, sizeof(buffer), "%d", lconf->max);
!                 values[13] = pstrdup(buffer);
!             }
!             break;
!
!         case PGC_REAL:
!             {
!                 struct config_real *lconf = (struct config_real *) conf;
!
!                 /* boot_val */
!                 values[8] = NULL;
!
!                 /* reset_val */
!                 snprintf(buffer, sizeof(buffer), "%g", lconf->reset_val);
!                 values[9] = pstrdup(buffer);
!
!                 /* session_val */
!                 snprintf(buffer, sizeof(buffer), "%g", lconf->session_val);
!                 values[10] = pstrdup(buffer);
!
!                 /* tentative_val */
!                 snprintf(buffer, sizeof(buffer), "%g", lconf->tentative_val);
!                 values[11] = pstrdup(buffer);
!
!                 /* min_val */
!                 snprintf(buffer, sizeof(buffer), "%g", lconf->min);
!                 values[12] = pstrdup(buffer);
!
!                 /* max_val */
!                 snprintf(buffer, sizeof(buffer), "%g", lconf->max);
!                 values[13] = pstrdup(buffer);
!             }
!             break;
!
!         case PGC_STRING:
!             {
!                 struct config_string *lconf = (struct config_string *) conf;
!
!                 /* boot_val */
!                 values[8] = lconf->boot_val;
!
!                 /* reset_val */
!                 values[9] = lconf->reset_val;
!
!                 /* session_val */
!                 values[10] = lconf->session_val;
!
!                 /* tentative_val */
!                 values[11] = lconf->tentative_val;
!
!                 /* min_val */
!                 values[12] = NULL;
!
!                 /* max_val */
!                 values[13] = NULL;
!             }
!             break;
!
!         default:
!             {
!                 /*
!                  * should never get here, but in case we do, set 'em
!                  * all to NULL
!                  */
!                 values[8] = NULL;
!                 values[9] = NULL;
!                 values[10] = NULL;
!                 values[11] = NULL;
!                 values[12] = NULL;
!                 values[13] = NULL;
!             }
!             break;
!     }
  }

  /*
***************
*** 2673,2678 ****
--- 2860,2867 ----
   * show_all_settings - equiv to SHOW ALL command but implemented as
   * a Table Function.
   */
+ #define NUM_PG_SETTINGS_ATTS    14
+
  Datum
  show_all_settings(PG_FUNCTION_ARGS)
  {
***************
*** 2696,2707 ****
           */
          oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);

!         /* need a tuple descriptor representing two TEXT columns */
!         tupdesc = CreateTemplateTupleDesc(2, false);
          TupleDescInitEntry(tupdesc, (AttrNumber) 1, "name",
                             TEXTOID, -1, 0, false);
          TupleDescInitEntry(tupdesc, (AttrNumber) 2, "setting",
                             TEXTOID, -1, 0, false);

          /* allocate a slot for a tuple with this tupdesc */
          slot = TupleDescGetSlot(tupdesc);
--- 2885,2923 ----
           */
          oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);

!         /*
!          * need a tuple descriptor representing NUM_PG_SETTINGS_ATTS columns
!          * of the appropriate types
!          */
!         tupdesc = CreateTemplateTupleDesc(NUM_PG_SETTINGS_ATTS, false);
          TupleDescInitEntry(tupdesc, (AttrNumber) 1, "name",
                             TEXTOID, -1, 0, false);
          TupleDescInitEntry(tupdesc, (AttrNumber) 2, "setting",
                             TEXTOID, -1, 0, false);
+         TupleDescInitEntry(tupdesc, (AttrNumber) 3, "context",
+                            TEXTOID, -1, 0, false);
+         TupleDescInitEntry(tupdesc, (AttrNumber) 4, "vartype",
+                            TEXTOID, -1, 0, false);
+         TupleDescInitEntry(tupdesc, (AttrNumber) 5, "reset_source",
+                            TEXTOID, -1, 0, false);
+         TupleDescInitEntry(tupdesc, (AttrNumber) 6, "session_source",
+                            TEXTOID, -1, 0, false);
+         TupleDescInitEntry(tupdesc, (AttrNumber) 7, "tentative_source",
+                            TEXTOID, -1, 0, false);
+         TupleDescInitEntry(tupdesc, (AttrNumber) 8, "source",
+                            TEXTOID, -1, 0, false);
+         TupleDescInitEntry(tupdesc, (AttrNumber) 9, "boot_val",
+                            TEXTOID, -1, 0, false);
+         TupleDescInitEntry(tupdesc, (AttrNumber) 10, "reset_val",
+                            TEXTOID, -1, 0, false);
+         TupleDescInitEntry(tupdesc, (AttrNumber) 11, "session_val",
+                            TEXTOID, -1, 0, false);
+         TupleDescInitEntry(tupdesc, (AttrNumber) 12, "tentative_val",
+                            TEXTOID, -1, 0, false);
+         TupleDescInitEntry(tupdesc, (AttrNumber) 13, "min_val",
+                            TEXTOID, -1, 0, false);
+         TupleDescInitEntry(tupdesc, (AttrNumber) 14, "max_val",
+                            TEXTOID, -1, 0, false);

          /* allocate a slot for a tuple with this tupdesc */
          slot = TupleDescGetSlot(tupdesc);
***************
*** 2732,2740 ****

      if (call_cntr < max_calls)    /* do when there is more left to send */
      {
!         char       *values[2];
!         char       *varname;
!         char       *varval;
          bool        noshow;
          HeapTuple    tuple;
          Datum        result;
--- 2948,2954 ----

      if (call_cntr < max_calls)    /* do when there is more left to send */
      {
!         char       *values[NUM_PG_SETTINGS_ATTS];
          bool        noshow;
          HeapTuple    tuple;
          Datum        result;
***************
*** 2744,2758 ****
           */
          do
          {
!             varval = GetConfigOptionByNum(call_cntr,
!                                           (const char **) &varname,
!                                           &noshow);
              if (noshow)
              {
-                 /* varval is a palloc'd copy, so free it */
-                 if (varval != NULL)
-                     pfree(varval);
-
                  /* bump the counter and get the next config setting */
                  call_cntr = ++funcctx->call_cntr;

--- 2958,2966 ----
           */
          do
          {
!             GetConfigOptionByNum(call_cntr, (const char **) values, &noshow);
              if (noshow)
              {
                  /* bump the counter and get the next config setting */
                  call_cntr = ++funcctx->call_cntr;

***************
*** 2762,2784 ****
              }
          } while (noshow);

-         /*
-          * Prepare a values array for storage in our slot. This should be
-          * an array of C strings which will be processed later by the
-          * appropriate "in" functions.
-          */
-         values[0] = varname;
-         values[1] = varval;
-
          /* build a tuple */
          tuple = BuildTupleFromCStrings(attinmeta, values);

          /* make the tuple into a datum */
          result = TupleGetDatum(slot, tuple);
-
-         /* Clean up */
-         if (varval != NULL)
-             pfree(varval);

          SRF_RETURN_NEXT(funcctx, result);
      }
--- 2970,2980 ----
Index: src/bin/initdb/initdb.sh
===================================================================
RCS file: /opt/src/cvs/pgsql-server/src/bin/initdb/initdb.sh,v
retrieving revision 1.192
diff -c -r1.192 initdb.sh
*** src/bin/initdb/initdb.sh    2 Jun 2003 19:00:29 -0000    1.192
--- src/bin/initdb/initdb.sh    25 Jun 2003 23:34:45 -0000
***************
*** 971,977 ****

  CREATE VIEW pg_settings AS \
      SELECT * \
!     FROM pg_show_all_settings() AS A(name text, setting text);

  CREATE RULE pg_settings_u AS \
      ON UPDATE TO pg_settings \
--- 971,981 ----

  CREATE VIEW pg_settings AS \
      SELECT * \
!     FROM pg_show_all_settings() AS A \
!     (name text, setting text, context text, vartype text, reset_source text, \
!      session_source text, tentative_source text, source text, boot_val text, \
!      reset_val text, session_val text, tentative_val text, min_val text, \
!      max_val text);

  CREATE RULE pg_settings_u AS \
      ON UPDATE TO pg_settings \
Index: src/include/utils/guc.h
===================================================================
RCS file: /opt/src/cvs/pgsql-server/src/include/utils/guc.h,v
retrieving revision 1.32
diff -c -r1.32 guc.h
*** src/include/utils/guc.h    11 Jun 2003 18:01:14 -0000    1.32
--- src/include/utils/guc.h    25 Jun 2003 21:03:26 -0000
***************
*** 49,63 ****
   * we don't yet know if the user is a superuser.
   *
   * USERSET options can be set by anyone any time.
   */
  typedef enum
  {
!     PGC_INTERNAL,
!     PGC_POSTMASTER,
!     PGC_SIGHUP,
!     PGC_BACKEND,
!     PGC_SUSET,
!     PGC_USERSET
  } GucContext;

  /*
--- 49,65 ----
   * we don't yet know if the user is a superuser.
   *
   * USERSET options can be set by anyone any time.
+  *
+  * Keep in sync with GucContextName in guc.c
   */
  typedef enum
  {
!     PGC_INTERNAL = 0,
!     PGC_POSTMASTER = 1,
!     PGC_SIGHUP = 2,
!     PGC_BACKEND = 3,
!     PGC_SUSET = 4,
!     PGC_USERSET = 5
  } GucContext;

  /*
***************
*** 69,74 ****
--- 71,78 ----
   * Sources <= PGC_S_OVERRIDE will set the default used by RESET, as well
   * as the current value.  Note that source == PGC_S_OVERRIDE should be
   * used when setting a PGC_INTERNAL option.
+  *
+  * Keep in sync with GucSourceName in guc.c
   */
  typedef enum
  {
***************
*** 83,89 ****
      PGC_S_SESSION = 8            /* SET command */
  } GucSource;

-
  /* GUC vars that are actually declared in guc.c, rather than elsewhere */
  extern bool log_statement;
  extern bool log_duration;
--- 87,92 ----
***************
*** 123,129 ****
  extern void ShowGUCConfigOption(const char *name, DestReceiver *dest);
  extern void ShowAllGUCConfig(DestReceiver *dest);
  extern char *GetConfigOptionByName(const char *name, const char **varname);
! extern char *GetConfigOptionByNum(int varnum, const char **varname, bool *noshow);
  extern int    GetNumConfigOptions(void);

  extern void SetPGVariable(const char *name, List *args, bool is_local);
--- 126,132 ----
  extern void ShowGUCConfigOption(const char *name, DestReceiver *dest);
  extern void ShowAllGUCConfig(DestReceiver *dest);
  extern char *GetConfigOptionByName(const char *name, const char **varname);
! extern void GetConfigOptionByNum(int varnum, const char **values, bool *noshow);
  extern int    GetNumConfigOptions(void);

  extern void SetPGVariable(const char *name, List *args, bool is_local);
Index: src/test/regress/expected/rangefuncs.out
===================================================================
RCS file: /opt/src/cvs/pgsql-server/src/test/regress/expected/rangefuncs.out,v
retrieving revision 1.7
diff -c -r1.7 rangefuncs.out
*** src/test/regress/expected/rangefuncs.out    13 Feb 2003 20:45:22 -0000    1.7
--- src/test/regress/expected/rangefuncs.out    25 Jun 2003 23:32:50 -0000
***************
*** 1,4 ****
! SELECT * FROM pg_settings WHERE name LIKE 'enable%';
         name       | setting
  ------------------+---------
   enable_hashagg   | on
--- 1,4 ----
! SELECT name, setting FROM pg_settings WHERE name LIKE 'enable%';
         name       | setting
  ------------------+---------
   enable_hashagg   | on
Index: src/test/regress/expected/rules.out
===================================================================
RCS file: /opt/src/cvs/pgsql-server/src/test/regress/expected/rules.out,v
retrieving revision 1.75
diff -c -r1.75 rules.out
*** src/test/regress/expected/rules.out    26 May 2003 00:11:28 -0000    1.75
--- src/test/regress/expected/rules.out    25 Jun 2003 23:38:24 -0000
***************
*** 1273,1279 ****
   pg_indexes               | SELECT n.nspname AS schemaname, c.relname AS tablename, i.relname AS indexname,
pg_get_indexdef(i.oid)AS indexdef FROM (((pg_index x JOIN pg_class c ON ((c.oid = x.indrelid))) JOIN pg_class i ON
((i.oid= x.indexrelid))) LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) WHERE ((c.relkind = 'r'::"char") AND
(i.relkind= 'i'::"char")); 
   pg_locks                 | SELECT l.relation, l."database", l."transaction", l.pid, l."mode", l.granted FROM
pg_lock_status()l(relation oid, "database" oid, "transaction" xid, pid integer, "mode" text, granted boolean); 
   pg_rules                 | SELECT n.nspname AS schemaname, c.relname AS tablename, r.rulename, pg_get_ruledef(r.oid)
ASdefinition FROM ((pg_rewrite r JOIN pg_class c ON ((c.oid = r.ev_class))) LEFT JOIN pg_namespace n ON ((n.oid =
c.relnamespace)))WHERE (r.rulename <> '_RETURN'::name); 
!  pg_settings              | SELECT a.name, a.setting FROM pg_show_all_settings() a(name text, setting text);
   pg_stat_activity         | SELECT d.oid AS datid, d.datname, pg_stat_get_backend_pid(s.backendid) AS procpid,
pg_stat_get_backend_userid(s.backendid)AS usesysid, u.usename, pg_stat_get_backend_activity(s.backendid) AS
current_query,pg_stat_get_backend_activity_start(s.backendid) AS query_start FROM pg_database d, (SELECT
pg_stat_get_backend_idset()AS backendid) s, pg_shadow u WHERE ((pg_stat_get_backend_dbid(s.backendid) = d.oid) AND
(pg_stat_get_backend_userid(s.backendid)= u.usesysid)); 
   pg_stat_all_indexes      | SELECT c.oid AS relid, i.oid AS indexrelid, n.nspname AS schemaname, c.relname, i.relname
ASindexrelname, pg_stat_get_numscans(i.oid) AS idx_scan, pg_stat_get_tuples_returned(i.oid) AS idx_tup_read,
pg_stat_get_tuples_fetched(i.oid)AS idx_tup_fetch FROM (((pg_class c JOIN pg_index x ON ((c.oid = x.indrelid))) JOIN
pg_classi ON ((i.oid = x.indexrelid))) LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) WHERE (c.relkind =
'r'::"char");
   pg_stat_all_tables       | SELECT c.oid AS relid, n.nspname AS schemaname, c.relname, pg_stat_get_numscans(c.oid) AS
seq_scan,pg_stat_get_tuples_returned(c.oid) AS seq_tup_read, sum(pg_stat_get_numscans(i.indexrelid)) AS idx_scan,
sum(pg_stat_get_tuples_fetched(i.indexrelid))AS idx_tup_fetch, pg_stat_get_tuples_inserted(c.oid) AS n_tup_ins,
pg_stat_get_tuples_updated(c.oid)AS n_tup_upd, pg_stat_get_tuples_deleted(c.oid) AS n_tup_del FROM ((pg_class c LEFT
JOINpg_index i ON ((c.oid = i.indrelid))) LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) WHERE (c.relkind =
'r'::"char")GROUP BY c.oid, n.nspname, c.relname; 
--- 1273,1279 ----
   pg_indexes               | SELECT n.nspname AS schemaname, c.relname AS tablename, i.relname AS indexname,
pg_get_indexdef(i.oid)AS indexdef FROM (((pg_index x JOIN pg_class c ON ((c.oid = x.indrelid))) JOIN pg_class i ON
((i.oid= x.indexrelid))) LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) WHERE ((c.relkind = 'r'::"char") AND
(i.relkind= 'i'::"char")); 
   pg_locks                 | SELECT l.relation, l."database", l."transaction", l.pid, l."mode", l.granted FROM
pg_lock_status()l(relation oid, "database" oid, "transaction" xid, pid integer, "mode" text, granted boolean); 
   pg_rules                 | SELECT n.nspname AS schemaname, c.relname AS tablename, r.rulename, pg_get_ruledef(r.oid)
ASdefinition FROM ((pg_rewrite r JOIN pg_class c ON ((c.oid = r.ev_class))) LEFT JOIN pg_namespace n ON ((n.oid =
c.relnamespace)))WHERE (r.rulename <> '_RETURN'::name); 
!  pg_settings              | SELECT a.name, a.setting, a.context, a.vartype, a.reset_source, a.session_source,
a.tentative_source,a.source, a.boot_val, a.reset_val, a.session_val, a.tentative_val, a.min_val, a.max_val FROM
pg_show_all_settings()a(name text, setting text, context text, vartype text, reset_source text, session_source text,
tentative_sourcetext, source text, boot_val text, reset_val text, session_val text, tentative_val text, min_val text,
max_valtext); 
   pg_stat_activity         | SELECT d.oid AS datid, d.datname, pg_stat_get_backend_pid(s.backendid) AS procpid,
pg_stat_get_backend_userid(s.backendid)AS usesysid, u.usename, pg_stat_get_backend_activity(s.backendid) AS
current_query,pg_stat_get_backend_activity_start(s.backendid) AS query_start FROM pg_database d, (SELECT
pg_stat_get_backend_idset()AS backendid) s, pg_shadow u WHERE ((pg_stat_get_backend_dbid(s.backendid) = d.oid) AND
(pg_stat_get_backend_userid(s.backendid)= u.usesysid)); 
   pg_stat_all_indexes      | SELECT c.oid AS relid, i.oid AS indexrelid, n.nspname AS schemaname, c.relname, i.relname
ASindexrelname, pg_stat_get_numscans(i.oid) AS idx_scan, pg_stat_get_tuples_returned(i.oid) AS idx_tup_read,
pg_stat_get_tuples_fetched(i.oid)AS idx_tup_fetch FROM (((pg_class c JOIN pg_index x ON ((c.oid = x.indrelid))) JOIN
pg_classi ON ((i.oid = x.indexrelid))) LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) WHERE (c.relkind =
'r'::"char");
   pg_stat_all_tables       | SELECT c.oid AS relid, n.nspname AS schemaname, c.relname, pg_stat_get_numscans(c.oid) AS
seq_scan,pg_stat_get_tuples_returned(c.oid) AS seq_tup_read, sum(pg_stat_get_numscans(i.indexrelid)) AS idx_scan,
sum(pg_stat_get_tuples_fetched(i.indexrelid))AS idx_tup_fetch, pg_stat_get_tuples_inserted(c.oid) AS n_tup_ins,
pg_stat_get_tuples_updated(c.oid)AS n_tup_upd, pg_stat_get_tuples_deleted(c.oid) AS n_tup_del FROM ((pg_class c LEFT
JOINpg_index i ON ((c.oid = i.indrelid))) LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) WHERE (c.relkind =
'r'::"char")GROUP BY c.oid, n.nspname, c.relname; 
Index: src/test/regress/sql/rangefuncs.sql
===================================================================
RCS file: /opt/src/cvs/pgsql-server/src/test/regress/sql/rangefuncs.sql,v
retrieving revision 1.4
diff -c -r1.4 rangefuncs.sql
*** src/test/regress/sql/rangefuncs.sql    30 Aug 2002 19:56:49 -0000    1.4
--- src/test/regress/sql/rangefuncs.sql    25 Jun 2003 23:32:34 -0000
***************
*** 1,4 ****
! SELECT * FROM pg_settings WHERE name LIKE 'enable%';

  CREATE TABLE foo2(fooid int, f2 int);
  INSERT INTO foo2 VALUES(1, 11);
--- 1,4 ----
! SELECT name, setting FROM pg_settings WHERE name LIKE 'enable%';

  CREATE TABLE foo2(fooid int, f2 int);
  INSERT INTO foo2 VALUES(1, 11);

pgsql-patches by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Runtime.SGML diff ... please expedite!
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] allowed user/db variables