Commit 8dec0c1b authored by Bruce Momjian's avatar Bruce Momjian

lease find enclosed a patch that matches the PL/Perl documentation

(fairly closely, I hope) to the current PL/Perl implementation.

David Fetter
parent 83997560
This diff is collapsed.
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# $PostgreSQL: pgsql/src/backend/Makefile,v 1.101 2004/07/19 17:03:56 tgl Exp $ # $PostgreSQL: pgsql/src/backend/Makefile,v 1.102 2004/07/21 20:22:58 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -29,13 +29,13 @@ endif ...@@ -29,13 +29,13 @@ endif
########################################################################## ##########################################################################
all: submake-libpgport postgres $(POSTGRES_IMP) all: submake-libpgport submake-libpq postgres $(POSTGRES_IMP)
ifneq ($(PORTNAME), cygwin) ifneq ($(PORTNAME), cygwin)
ifneq ($(PORTNAME), win32) ifneq ($(PORTNAME), win32)
postgres: $(OBJS) postgres: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $^ $(LIBS) -o $@ $(CC) $(CFLAGS) $(LDFLAGS) -I $(libpq_srcdir) $(export_dynamic) $^ $(LIBS) $(libpq) -o $@
endif endif
endif endif
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.187 2004/07/17 03:28:37 tgl Exp $ * $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.188 2004/07/21 20:22:58 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "libpq/pqsignal.h" #include "libpq/pqsignal.h"
#include "miscadmin.h" #include "miscadmin.h"
#include "postmaster/bgwriter.h" #include "postmaster/bgwriter.h"
#include "postmaster/pg_autovacuum.h"
#include "storage/freespace.h" #include "storage/freespace.h"
#include "storage/ipc.h" #include "storage/ipc.h"
#include "storage/pg_shmem.h" #include "storage/pg_shmem.h"
...@@ -355,6 +356,9 @@ BootstrapMain(int argc, char *argv[]) ...@@ -355,6 +356,9 @@ BootstrapMain(int argc, char *argv[])
case BS_XLOG_BGWRITER: case BS_XLOG_BGWRITER:
statmsg = "writer process"; statmsg = "writer process";
break; break;
case BS_XLOG_AUTOVAC:
statmsg = "auto vacuum process";
break;
default: default:
statmsg = "??? process"; statmsg = "??? process";
break; break;
...@@ -391,6 +395,9 @@ BootstrapMain(int argc, char *argv[]) ...@@ -391,6 +395,9 @@ BootstrapMain(int argc, char *argv[])
case BS_XLOG_BGWRITER: case BS_XLOG_BGWRITER:
InitDummyProcess(DUMMY_PROC_BGWRITER); InitDummyProcess(DUMMY_PROC_BGWRITER);
break; break;
case BS_XLOG_AUTOVAC:
InitDummyProcess(DUMMY_PROC_AUTOVAC);
break;
default: default:
InitDummyProcess(DUMMY_PROC_DEFAULT); InitDummyProcess(DUMMY_PROC_DEFAULT);
...@@ -427,6 +434,12 @@ BootstrapMain(int argc, char *argv[]) ...@@ -427,6 +434,12 @@ BootstrapMain(int argc, char *argv[])
BackgroundWriterMain(); BackgroundWriterMain();
proc_exit(1); /* should never return */ proc_exit(1); /* should never return */
case BS_XLOG_AUTOVAC:
/* don't set signals, autovac has its own agenda */
InitXLOGAccess();
AutoVacMain();
proc_exit(1); /* should never return */
default: default:
elog(PANIC, "unrecognized XLOG op: %d", xlogop); elog(PANIC, "unrecognized XLOG op: %d", xlogop);
proc_exit(1); proc_exit(1);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# Makefile for backend/catalog # Makefile for backend/catalog
# #
# $PostgreSQL: pgsql/src/backend/catalog/Makefile,v 1.51 2004/06/18 06:13:19 tgl Exp $ # $PostgreSQL: pgsql/src/backend/catalog/Makefile,v 1.52 2004/07/21 20:22:59 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -32,7 +32,7 @@ POSTGRES_BKI_SRCS := $(addprefix $(top_srcdir)/src/include/catalog/,\ ...@@ -32,7 +32,7 @@ POSTGRES_BKI_SRCS := $(addprefix $(top_srcdir)/src/include/catalog/,\
pg_language.h pg_largeobject.h pg_aggregate.h pg_statistic.h \ pg_language.h pg_largeobject.h pg_aggregate.h pg_statistic.h \
pg_rewrite.h pg_trigger.h pg_listener.h pg_description.h pg_cast.h \ pg_rewrite.h pg_trigger.h pg_listener.h pg_description.h pg_cast.h \
pg_namespace.h pg_conversion.h pg_database.h pg_shadow.h pg_group.h \ pg_namespace.h pg_conversion.h pg_database.h pg_shadow.h pg_group.h \
pg_tablespace.h pg_depend.h indexing.h \ pg_tablespace.h pg_depend.h pg_autovacuum.h indexing.h \
) )
pg_includes := $(sort -I$(top_srcdir)/src/include -I$(top_builddir)/src/include) pg_includes := $(sort -I$(top_srcdir)/src/include -I$(top_builddir)/src/include)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright 1996-2003, PostgreSQL Global Development Group * Copyright 1996-2003, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/backend/catalog/system_views.sql,v 1.6 2004/04/26 15:24:41 momjian Exp $ * $PostgreSQL: pgsql/src/backend/catalog/system_views.sql,v 1.7 2004/07/21 20:22:59 momjian Exp $
*/ */
CREATE VIEW pg_user AS CREATE VIEW pg_user AS
...@@ -41,22 +41,26 @@ CREATE VIEW pg_tables AS ...@@ -41,22 +41,26 @@ CREATE VIEW pg_tables AS
SELECT SELECT
N.nspname AS schemaname, N.nspname AS schemaname,
C.relname AS tablename, C.relname AS tablename,
T.spcname AS tablespace,
pg_get_userbyid(C.relowner) AS tableowner, pg_get_userbyid(C.relowner) AS tableowner,
C.relhasindex AS hasindexes, C.relhasindex AS hasindexes,
C.relhasrules AS hasrules, C.relhasrules AS hasrules,
(C.reltriggers > 0) AS hastriggers (C.reltriggers > 0) AS hastriggers
FROM pg_class C LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) FROM pg_class C LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
LEFT JOIN pg_tablespace T ON (T.oid = C.reltablespace)
WHERE C.relkind = 'r'; WHERE C.relkind = 'r';
CREATE VIEW pg_indexes AS CREATE VIEW pg_indexes AS
SELECT SELECT
N.nspname AS schemaname, N.nspname AS schemaname,
C.relname AS tablename, C.relname AS tablename,
T.spcname AS tablespace,
I.relname AS indexname, I.relname AS indexname,
pg_get_indexdef(I.oid) AS indexdef pg_get_indexdef(I.oid) AS indexdef
FROM pg_index X JOIN pg_class C ON (C.oid = X.indrelid) FROM pg_index X JOIN pg_class C ON (C.oid = X.indrelid)
JOIN pg_class I ON (I.oid = X.indexrelid) JOIN pg_class I ON (I.oid = X.indexrelid)
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
LEFT JOIN pg_tablespace T ON (T.oid = C.reltablespace)
WHERE C.relkind = 'r' AND I.relkind = 'i'; WHERE C.relkind = 'r' AND I.relkind = 'i';
CREATE VIEW pg_stats AS CREATE VIEW pg_stats AS
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# Makefile for src/backend/postmaster # Makefile for src/backend/postmaster
# #
# IDENTIFICATION # IDENTIFICATION
# $PostgreSQL: pgsql/src/backend/postmaster/Makefile,v 1.16 2004/07/19 02:47:08 tgl Exp $ # $PostgreSQL: pgsql/src/backend/postmaster/Makefile,v 1.17 2004/07/21 20:22:59 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -12,7 +12,7 @@ subdir = src/backend/postmaster ...@@ -12,7 +12,7 @@ subdir = src/backend/postmaster
top_builddir = ../../.. top_builddir = ../../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
OBJS = postmaster.o bgwriter.o pgstat.o pgarch.o OBJS = postmaster.o bgwriter.o pgstat.o pgarch.o pg_autovacuum.o
all: SUBSYS.o all: SUBSYS.o
......
This diff is collapsed.
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>. * Written by Peter Eisentraut <peter_e@gmx.net>.
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.221 2004/07/19 21:39:47 momjian Exp $ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.222 2004/07/21 20:23:01 momjian Exp $
* *
*-------------------------------------------------------------------- *--------------------------------------------------------------------
*/ */
...@@ -43,7 +43,9 @@ ...@@ -43,7 +43,9 @@
#include "optimizer/prep.h" #include "optimizer/prep.h"
#include "parser/parse_expr.h" #include "parser/parse_expr.h"
#include "parser/parse_relation.h" #include "parser/parse_relation.h"
#include "pgstat.h"
#include "postmaster/bgwriter.h" #include "postmaster/bgwriter.h"
#include "postmaster/pg_autovacuum.h"
#include "postmaster/postmaster.h" #include "postmaster/postmaster.h"
#include "storage/bufmgr.h" #include "storage/bufmgr.h"
#include "storage/fd.h" #include "storage/fd.h"
...@@ -55,7 +57,6 @@ ...@@ -55,7 +57,6 @@
#include "utils/builtins.h" #include "utils/builtins.h"
#include "utils/memutils.h" #include "utils/memutils.h"
#include "utils/pg_locale.h" #include "utils/pg_locale.h"
#include "pgstat.h"
char *guc_pgdata; char *guc_pgdata;
char *guc_hbafile; char *guc_hbafile;
...@@ -642,6 +643,14 @@ static struct config_bool ConfigureNamesBool[] = ...@@ -642,6 +643,14 @@ static struct config_bool ConfigureNamesBool[] =
&pgstat_collect_blocklevel, &pgstat_collect_blocklevel,
false, NULL, NULL false, NULL, NULL
}, },
{
{"autovacuum", PGC_SIGHUP, AUTOVACUUM,
gettext_noop("Starts the auto vacuum subprocess."),
NULL
},
&autovacuum_start_daemon,
false, NULL, NULL
},
{ {
{"trace_notify", PGC_USERSET, DEVELOPER_OPTIONS, {"trace_notify", PGC_USERSET, DEVELOPER_OPTIONS,
...@@ -1284,6 +1293,30 @@ static struct config_int ConfigureNamesInt[] = ...@@ -1284,6 +1293,30 @@ static struct config_int ConfigureNamesInt[] =
&block_size, &block_size,
BLCKSZ, BLCKSZ, BLCKSZ, NULL, NULL BLCKSZ, BLCKSZ, BLCKSZ, NULL, NULL
}, },
{
{"autovacuum_vacuum_threshold_base", PGC_SIGHUP, AUTOVACUUM,
gettext_noop("Minimum number of tuple updates or deletes prior to vacuum."),
NULL
},
&autovacuum_vacuum_base,
1000, 0, INT_MAX, NULL, NULL
},
{
{"autovacuum_analyze_threshold_base", PGC_SIGHUP, AUTOVACUUM,
gettext_noop("Minimum number of tuple updates or deletes prior to analyze."),
NULL
},
&autovacuum_analyze_base,
500, 0, INT_MAX, NULL, NULL
},
{
{"autovacuum_naptime", PGC_SIGHUP, AUTOVACUUM,
gettext_noop("Minimum number of tuple updates or deletes prior to analyze."),
NULL
},
&autovacuum_analyze_base,
500, 0, INT_MAX, NULL, NULL
},
/* End-of-list marker */ /* End-of-list marker */
{ {
...@@ -1364,6 +1397,22 @@ static struct config_real ConfigureNamesReal[] = ...@@ -1364,6 +1397,22 @@ static struct config_real ConfigureNamesReal[] =
&phony_random_seed, &phony_random_seed,
0.5, 0.0, 1.0, assign_random_seed, show_random_seed 0.5, 0.0, 1.0, assign_random_seed, show_random_seed
}, },
{
{"autovacuum_vacuum_threshold_sf", PGC_SIGHUP, AUTOVACUUM,
gettext_noop("Numer of tuple updates or deletes prior to vacuum as a factor of reltuples."),
NULL
},
&autovacuum_vacuum_scaling_factor,
2, 0, 100, NULL, NULL
},
{
{"autovacuum_analyze_threshold_sf", PGC_SIGHUP, AUTOVACUUM,
gettext_noop("Numer of tuple updates or deletes prior to analyze as a factor of reltuples."),
NULL
},
&autovacuum_analyze_scaling_factor,
1, 0, 100, NULL, NULL
},
/* End-of-list marker */ /* End-of-list marker */
{ {
......
...@@ -237,6 +237,16 @@ ...@@ -237,6 +237,16 @@
#stats_reset_on_server_start = true #stats_reset_on_server_start = true
#---------------------------------------------------------------------------
# VACUUM DAEMON
#---------------------------------------------------------------------------
#autovacuum = false # requires stats_row_level = true
#autovacuum_vacuum_threshold_base = 1000
#autovacuum_vacuum_threshold_sf = 2
#autovacuum_analyze_threshold_base = 500
#autovacuum_analyze_threshold_sf = 1
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# CLIENT CONNECTION DEFAULTS # CLIENT CONNECTION DEFAULTS
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/bootstrap/bootstrap.h,v 1.35 2004/05/29 22:48:22 tgl Exp $ * $PostgreSQL: pgsql/src/include/bootstrap/bootstrap.h,v 1.36 2004/07/21 20:23:03 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -59,5 +59,6 @@ extern void Int_yyerror(const char *str); ...@@ -59,5 +59,6 @@ extern void Int_yyerror(const char *str);
#define BS_XLOG_BOOTSTRAP 1 #define BS_XLOG_BOOTSTRAP 1
#define BS_XLOG_STARTUP 2 #define BS_XLOG_STARTUP 2
#define BS_XLOG_BGWRITER 3 #define BS_XLOG_BGWRITER 3
#define BS_XLOG_AUTOVAC 4
#endif /* BOOTSTRAP_H */ #endif /* BOOTSTRAP_H */
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.244 2004/07/12 20:23:51 momjian Exp $ * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.245 2004/07/21 20:23:03 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -53,6 +53,6 @@ ...@@ -53,6 +53,6 @@
*/ */
/* yyyymmddN */ /* yyyymmddN */
#define CATALOG_VERSION_NO 200407121 #define CATALOG_VERSION_NO 200407211
#endif #endif
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/postmaster/postmaster.h,v 1.2 2004/05/30 03:50:15 tgl Exp $ * $PostgreSQL: pgsql/src/include/postmaster/postmaster.h,v 1.3 2004/07/21 20:23:04 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -29,6 +29,7 @@ extern char *preload_libraries_string; ...@@ -29,6 +29,7 @@ extern char *preload_libraries_string;
extern bool Log_connections; extern bool Log_connections;
extern bool log_hostname; extern bool log_hostname;
extern char *rendezvous_name; extern char *rendezvous_name;
extern bool autovacuum_start_daemon;
#ifdef WIN32 #ifdef WIN32
extern HANDLE PostmasterHandle; extern HANDLE PostmasterHandle;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.69 2004/07/17 03:31:26 tgl Exp $ * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.70 2004/07/21 20:23:04 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -88,7 +88,8 @@ typedef struct PROC_HDR ...@@ -88,7 +88,8 @@ typedef struct PROC_HDR
#define DUMMY_PROC_DEFAULT 0 #define DUMMY_PROC_DEFAULT 0
#define DUMMY_PROC_BGWRITER 1 #define DUMMY_PROC_BGWRITER 1
#define NUM_DUMMY_PROCS 2 #define DUMMY_PROC_AUTOVAC 2
#define NUM_DUMMY_PROCS 3
/* configurable options */ /* configurable options */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/include/utils/guc_tables.h,v 1.12 2004/07/01 00:51:44 tgl Exp $ * $PostgreSQL: pgsql/src/include/utils/guc_tables.h,v 1.13 2004/07/21 20:23:05 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -71,6 +71,7 @@ enum config_group ...@@ -71,6 +71,7 @@ enum config_group
COMPAT_OPTIONS_CLIENT, COMPAT_OPTIONS_CLIENT,
DEVELOPER_OPTIONS, DEVELOPER_OPTIONS,
COMPILE_OPTIONS, COMPILE_OPTIONS,
AUTOVACUUM,
CUSTOM_OPTIONS CUSTOM_OPTIONS
}; };
......
...@@ -1275,7 +1275,7 @@ SELECT viewname, definition FROM pg_views WHERE schemaname <> 'information_schem ...@@ -1275,7 +1275,7 @@ SELECT viewname, definition FROM pg_views WHERE schemaname <> 'information_schem
viewname | definition viewname | definition
--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
iexit | SELECT ih.name, ih.thepath, interpt_pp(ih.thepath, r.thepath) AS exit FROM ihighway ih, ramp r WHERE (ih.thepath ## r.thepath); iexit | SELECT ih.name, ih.thepath, interpt_pp(ih.thepath, r.thepath) AS exit FROM ihighway ih, ramp r WHERE (ih.thepath ## r.thepath);
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_indexes | SELECT n.nspname AS schemaname, c.relname AS tablename, t.spcname AS "tablespace", 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))) LEFT JOIN pg_tablespace t ON ((t.oid = c.reltablespace))) 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_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) AS definition 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_rules | SELECT n.nspname AS schemaname, c.relname AS tablename, r.rulename, pg_get_ruledef(r.oid) AS definition 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.category, a.short_desc, a.extra_desc, a.context, a.vartype, a.source, a.min_val, a.max_val FROM pg_show_all_settings() a(name text, setting text, category text, short_desc text, extra_desc text, context text, vartype text, source text, min_val text, max_val text); pg_settings | SELECT a.name, a.setting, a.category, a.short_desc, a.extra_desc, a.context, a.vartype, a.source, a.min_val, a.max_val FROM pg_show_all_settings() a(name text, setting text, category text, short_desc text, extra_desc text, context text, vartype text, source text, min_val text, max_val text);
...@@ -1297,7 +1297,7 @@ SELECT viewname, definition FROM pg_views WHERE schemaname <> 'information_schem ...@@ -1297,7 +1297,7 @@ SELECT viewname, definition FROM pg_views WHERE schemaname <> 'information_schem
pg_statio_user_sequences | SELECT pg_statio_all_sequences.relid, pg_statio_all_sequences.schemaname, pg_statio_all_sequences.relname, pg_statio_all_sequences.blks_read, pg_statio_all_sequences.blks_hit FROM pg_statio_all_sequences WHERE (((pg_statio_all_sequences.schemaname <> 'pg_catalog'::name) AND (pg_statio_all_sequences.schemaname <> 'pg_toast'::name)) AND (pg_statio_all_sequences.schemaname <> 'information_schema'::name)); pg_statio_user_sequences | SELECT pg_statio_all_sequences.relid, pg_statio_all_sequences.schemaname, pg_statio_all_sequences.relname, pg_statio_all_sequences.blks_read, pg_statio_all_sequences.blks_hit FROM pg_statio_all_sequences WHERE (((pg_statio_all_sequences.schemaname <> 'pg_catalog'::name) AND (pg_statio_all_sequences.schemaname <> 'pg_toast'::name)) AND (pg_statio_all_sequences.schemaname <> 'information_schema'::name));
pg_statio_user_tables | SELECT pg_statio_all_tables.relid, pg_statio_all_tables.schemaname, pg_statio_all_tables.relname, pg_statio_all_tables.heap_blks_read, pg_statio_all_tables.heap_blks_hit, pg_statio_all_tables.idx_blks_read, pg_statio_all_tables.idx_blks_hit, pg_statio_all_tables.toast_blks_read, pg_statio_all_tables.toast_blks_hit, pg_statio_all_tables.tidx_blks_read, pg_statio_all_tables.tidx_blks_hit FROM pg_statio_all_tables WHERE (((pg_statio_all_tables.schemaname <> 'pg_catalog'::name) AND (pg_statio_all_tables.schemaname <> 'pg_toast'::name)) AND (pg_statio_all_tables.schemaname <> 'information_schema'::name)); pg_statio_user_tables | SELECT pg_statio_all_tables.relid, pg_statio_all_tables.schemaname, pg_statio_all_tables.relname, pg_statio_all_tables.heap_blks_read, pg_statio_all_tables.heap_blks_hit, pg_statio_all_tables.idx_blks_read, pg_statio_all_tables.idx_blks_hit, pg_statio_all_tables.toast_blks_read, pg_statio_all_tables.toast_blks_hit, pg_statio_all_tables.tidx_blks_read, pg_statio_all_tables.tidx_blks_hit FROM pg_statio_all_tables WHERE (((pg_statio_all_tables.schemaname <> 'pg_catalog'::name) AND (pg_statio_all_tables.schemaname <> 'pg_toast'::name)) AND (pg_statio_all_tables.schemaname <> 'information_schema'::name));
pg_stats | SELECT nspname AS schemaname, relname AS tablename, attname, stanullfrac AS null_frac, stawidth AS avg_width, stadistinct AS n_distinct, CASE 1 WHEN stakind1 THEN stavalues1 WHEN stakind2 THEN stavalues2 WHEN stakind3 THEN stavalues3 WHEN stakind4 THEN stavalues4 ELSE NULL::"unknown" END AS most_common_vals, CASE 1 WHEN stakind1 THEN stanumbers1 WHEN stakind2 THEN stanumbers2 WHEN stakind3 THEN stanumbers3 WHEN stakind4 THEN stanumbers4 ELSE NULL::real[] END AS most_common_freqs, CASE 2 WHEN stakind1 THEN stavalues1 WHEN stakind2 THEN stavalues2 WHEN stakind3 THEN stavalues3 WHEN stakind4 THEN stavalues4 ELSE NULL::"unknown" END AS histogram_bounds, CASE 3 WHEN stakind1 THEN stanumbers1[1] WHEN stakind2 THEN stanumbers2[1] WHEN stakind3 THEN stanumbers3[1] WHEN stakind4 THEN stanumbers4[1] ELSE NULL::real END AS correlation FROM (((pg_statistic s JOIN pg_class c ON ((c.oid = s.starelid))) JOIN pg_attribute a ON (((c.oid = a.attrelid) AND (a.attnum = s.staattnum)))) LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) WHERE has_table_privilege(c.oid, 'select'::text); pg_stats | SELECT nspname AS schemaname, relname AS tablename, attname, stanullfrac AS null_frac, stawidth AS avg_width, stadistinct AS n_distinct, CASE 1 WHEN stakind1 THEN stavalues1 WHEN stakind2 THEN stavalues2 WHEN stakind3 THEN stavalues3 WHEN stakind4 THEN stavalues4 ELSE NULL::"unknown" END AS most_common_vals, CASE 1 WHEN stakind1 THEN stanumbers1 WHEN stakind2 THEN stanumbers2 WHEN stakind3 THEN stanumbers3 WHEN stakind4 THEN stanumbers4 ELSE NULL::real[] END AS most_common_freqs, CASE 2 WHEN stakind1 THEN stavalues1 WHEN stakind2 THEN stavalues2 WHEN stakind3 THEN stavalues3 WHEN stakind4 THEN stavalues4 ELSE NULL::"unknown" END AS histogram_bounds, CASE 3 WHEN stakind1 THEN stanumbers1[1] WHEN stakind2 THEN stanumbers2[1] WHEN stakind3 THEN stanumbers3[1] WHEN stakind4 THEN stanumbers4[1] ELSE NULL::real END AS correlation FROM (((pg_statistic s JOIN pg_class c ON ((c.oid = s.starelid))) JOIN pg_attribute a ON (((c.oid = a.attrelid) AND (a.attnum = s.staattnum)))) LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) WHERE has_table_privilege(c.oid, 'select'::text);
pg_tables | SELECT n.nspname AS schemaname, c.relname AS tablename, pg_get_userbyid(c.relowner) AS tableowner, c.relhasindex AS hasindexes, c.relhasrules AS hasrules, (c.reltriggers > 0) AS hastriggers FROM (pg_class c LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) WHERE (c.relkind = 'r'::"char"); pg_tables | SELECT n.nspname AS schemaname, c.relname AS tablename, t.spcname AS "tablespace", pg_get_userbyid(c.relowner) AS tableowner, c.relhasindex AS hasindexes, c.relhasrules AS hasrules, (c.reltriggers > 0) AS hastriggers FROM ((pg_class c LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) LEFT JOIN pg_tablespace t ON ((t.oid = c.reltablespace))) WHERE (c.relkind = 'r'::"char");
pg_user | SELECT pg_shadow.usename, pg_shadow.usesysid, pg_shadow.usecreatedb, pg_shadow.usesuper, pg_shadow.usecatupd, '********'::text AS passwd, pg_shadow.valuntil, pg_shadow.useconfig FROM pg_shadow; pg_user | SELECT pg_shadow.usename, pg_shadow.usesysid, pg_shadow.usecreatedb, pg_shadow.usesuper, pg_shadow.usecatupd, '********'::text AS passwd, pg_shadow.valuntil, pg_shadow.useconfig FROM pg_shadow;
pg_views | SELECT n.nspname AS schemaname, c.relname AS viewname, pg_get_userbyid(c.relowner) AS viewowner, pg_get_viewdef(c.oid) AS definition FROM (pg_class c LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) WHERE (c.relkind = 'v'::"char"); pg_views | SELECT n.nspname AS schemaname, c.relname AS viewname, pg_get_userbyid(c.relowner) AS viewowner, pg_get_viewdef(c.oid) AS definition FROM (pg_class c LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) WHERE (c.relkind = 'v'::"char");
rtest_v1 | SELECT rtest_t1.a, rtest_t1.b FROM rtest_t1; rtest_v1 | SELECT rtest_t1.a, rtest_t1.b FROM rtest_t1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment