Commit Graph

1131 Commits

Author SHA1 Message Date
Tom Lane c77f363384 Ensure that close() and fclose() are checked for errors, at least in
cases involving writes.  Per recent discussion about the possibility
of close-time failures on some filesystems.  There is a TODO item for
this, too.
2004-01-26 22:35:32 +00:00
Jan Wieck d77b63b17c Added GUC variable bgwriter_flush_method controlling the action
done by the background writer between writing dirty blocks and
napping.

    none (default)   no action
	sync             bgwriter calls smgrsync() causing a sync(2)

A global sync() is only good on dedicated database servers, so
more flush methods should be added in the future.

Jan
2004-01-24 20:00:46 +00:00
Tom Lane 3969f2924b Revise GEQO planner to make use of some heuristic knowledge about SQL, namely
that it's good to join where there are join clauses rather than where there
are not.  Also enable it to generate bushy plans at need, so that it doesn't
fail in the presence of multiple IN clauses containing sub-joins.  These
changes appear to improve the behavior enough that we can substantially reduce
the default pool size and generations count, thereby decreasing the runtime,
and yet get as good or better plans as we were getting in 7.4.  Consequently,
adjust the default GEQO parameters.  I also modified the way geqo_effort is
used so that it affects both population size and number of generations;
it's now useful as a single control to adjust the GEQO runtime-vs-plan-quality
tradeoff.  Bump geqo_threshold to 12, since even with these changes GEQO
seems to be slower than the regular planner at 11 relations.
2004-01-23 23:54:21 +00:00
Tom Lane 672a807028 Repair error apparently introduced in the initial coding of GUC: the
default value for geqo_effort is supposed to be 40, not 1.  The actual
'genetic' component of the GEQO algorithm has been practically disabled
since 7.1 because of this mistake.  Improve documentation while at it.
2004-01-21 23:33:34 +00:00
Tom Lane 9bd681a522 Repair problem identified by Olivier Prenant: ALTER DATABASE SET search_path
should not be too eager to reject paths involving unknown schemas, since
it can't really tell whether the schemas exist in the target database.
(Also, when reading pg_dumpall output, it could be that the schemas
don't exist yet, but eventually will.)  ALTER USER SET has a similar issue.
So, reduce the normal ERROR to a NOTICE when checking search_path values
for these commands.  Supporting this requires changing the API for GUC
assign_hook functions, which causes the patch to touch a lot of places,
but the changes are conceptually trivial.
2004-01-19 19:04:40 +00:00
Neil Conway bc028beb16 Make the 'wal_debug' GUC variable a boolean (rather than an integer), and
hide it behind #ifdef WAL_DEBUG blocks.
2004-01-06 17:26:23 +00:00
Joe Conway 66989aa2d6 Added new group of read-only GUC variables to allow simple access
to certain compile-time options (FUNC_MAX_ARGS, INDEX_MAX_KEYS,
NAMEDATALEN, BLCKSZ, HAVE_INT64_TIMESTAMP). Also added "category",
"short_desc", and "extra_desc" to the pg_settings view. Per recent
discussion here:
http://archives.postgresql.org/pgsql-patches/2003-11/msg00363.php
2003-12-03 18:52:00 +00:00
Bruce Momjian 7ce9b7c0d8 This patch adds a new GUC var, "default_with_oids", which follows the
proposal for eventually deprecating OIDs on user tables that I posted
earlier to pgsql-hackers. pg_dump now always specifies WITH OIDS or
WITHOUT OIDS when dumping a table. The documentation has been updated.

Neil Conway
2003-12-01 22:08:02 +00:00
Bruce Momjian 64e5a85625 Seems there are three GUC variables that are defined as "Shows ..."
while you can actually set them with SET.

This applied patch changes the wording from "Show" to "Set".
2003-12-01 03:55:21 +00:00
PostgreSQL Daemon 969685ad44 $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00
Jan Wieck cfeca62148 Background writer process
This first part of the background writer does no syncing at all.
It's only purpose is to keep the LRU heads clean so that regular
backends seldom to never have to call write().

Jan
2003-11-19 15:55:08 +00:00
Jan Wieck 1f45555892 Changed parameter name for shared cache status report interval to
debug_shared_buffers = <seconds>

as per previous discussion.


Jan
2003-11-16 16:41:01 +00:00
Jan Wieck 6b86d62b00 2nd try for the ARC strategy.
I added a couple more Assertions while tracking down the exact
cause of the former bug.

All 93 regression tests pass now.

Jan
2003-11-13 14:57:15 +00:00
Jan Wieck 923e994d79 ARC strategy backed out ... sorry
Jan
2003-11-13 05:34:58 +00:00
Jan Wieck 48adc0b34b Replacement of the buffer replacement strategy with an ARC
algorithm adopted for PostgreSQL.

Jan
2003-11-13 00:40:02 +00:00
Tom Lane 7e4a629492 zero_damaged_pages must absolutely NOT be marked GUC_DISALLOW_IN_FILE,
else it cannot be used to handle failures detected during WAL replay.
Fortunately this flag isn't actually enforced yet, but get it right.
2003-11-07 21:27:38 +00:00
Peter Eisentraut 96889392e9 Implement isolation levels read uncommitted and repeatable read as acting
like the next higher one.
2003-11-06 22:08:15 +00:00
Peter Eisentraut 9d77708d83 Cleanup on --help-config: Now called --describe-config, no further options,
machine readable, without headers, not sorted.  Parameter descriptions
adjusted to fit first sentence + rest convention.
2003-10-18 22:59:09 +00:00
Bruce Momjian b8382c2688 Have log_min_duration_statement = 0 always print duration/statement.
Change log line to be "duration:  ms  query:"

Indent multi-line queries with a tab in the server logs.
2003-10-08 03:49:38 +00:00
Tom Lane 15c194c1d5 Add GUC parameter check_function_bodies to control whether validation
of function bodies is done at CREATE FUNCTION time.  This is normally
true but can be set false to avoid problems with forward references,
wrong schema search path, etc.  This is just the backend patch, still
need to adjust pg_dump to make use of it.
2003-10-03 19:26:49 +00:00
Peter Eisentraut 7438af96fa More message editing, some suggested by Alvaro Herrera 2003-09-29 00:05:25 +00:00
Peter Eisentraut d84b6ef56b Various message fixes, among those fixes for the previous round of fixes 2003-09-26 15:27:37 +00:00
Peter Eisentraut feb4f44d29 Message editing: remove gratuitous variations in message wording, standardize
terms, add some clarifications, fix some untranslatable attempts at dynamic
message building.
2003-09-25 06:58:07 +00:00
Tom Lane daed6f4b94 Improve a couple of error messages per suggestions from Alvaro Herrera. 2003-09-15 22:28:58 +00:00
Bruce Momjian 188eda0df2 Consistenly lowercase GUC variable names, in docs and error messages. 2003-09-11 18:30:39 +00:00
Tom Lane 48beecda7c Remove geqo_random_seed parameter. Having geqo reset the global random()
sequence every time it's called is bogus --- it interferes with user
control over the seed, and actually decreases randomness overall
(because a seed based on time(NULL) is pretty predictable).  If you really
want a reproducible result from geqo, do 'set seed = 0' before planning
a query.
2003-09-07 15:26:54 +00:00
Bruce Momjian 6d239ee4b4 Allow non-super users to set log_duration to true, then false, when the
administrator has not turned it on, and fix other PGC_USERLIMIT
variables.
2003-09-04 05:11:20 +00:00
Peter Eisentraut 29a20145fd Pass session_authorization to the client and make psql update its prompt
accordingly.
2003-09-03 22:05:09 +00:00
Peter Eisentraut 5f65345a57 Do not pass server_encoding to the client.
libpq, talking to an old server, should assume SQL_ASCII as the default
client encoding, because that is what the server will actually use (not
the server encoding).
2003-09-01 23:04:49 +00:00
Bruce Momjian 11c2f1900a Rename DoIt to changeVar, for clarity. 2003-09-01 04:15:51 +00:00
Tom Lane f63cbccac7 Mop-up for previous change to determine default shared_buffers and
max_connections at initdb time.  Get rid of DEF_NBUFFERS and DEF_MAXBACKENDS
macros, which aren't doing anything useful anymore, and put more likely
defaults into postgresql.conf.sample.
2003-08-26 15:38:25 +00:00
Tom Lane c771838106 Somebody forgot to include any actual documentation for ADD_MISSING_FROM. 2003-08-17 22:19:15 +00:00
Tom Lane 302f1a86dc Rewriter and planner should use only resno, not resname, to identify
target columns in INSERT and UPDATE targetlists.  Don't rely on resname
to be accurate in ruleutils, either.  This fixes bug reported by
Donald Fraser, in which renaming a column referenced in a rule did not
work very well.
2003-08-11 23:04:50 +00:00
Tom Lane 2f9c859ea1 Fix some copyright notices that weren't updated. Improve copyright tool
so it won't miss 'em again.
2003-08-04 23:59:41 +00:00
Bruce Momjian 089003fb46 pgindent run. 2003-08-04 00:43:34 +00:00
Tom Lane 30f665d745 Fix my own mistake in GUC variable annotation. 2003-08-01 01:23:11 +00:00
Tom Lane c4cf7fb814 Adjust 'permission denied' messages to be more useful and consistent. 2003-08-01 00:15:26 +00:00
Tom Lane 9c2a7c2269 Apply (a somewhat revised version of) Greg Mullane's patch to eliminate
heuristic determination of day vs month in date/time input.  Add the
ability to specify that input is interpreted as yy-mm-dd order (which
formerly worked, but only for yy greater than 31).  DateStyle's input
component now has the preferred spellings DMY, MDY, or YMD; the older
keywords European and US are now aliases for the first two of these.
Per recent discussions on pgsql-general.
2003-07-29 00:03:19 +00:00
Tom Lane 2baf4efe09 Code review for recent GUC changes --- try to make it less obvious that
these things were added at different times by different people ;-).
Includes Aizaz Ahmed's patch to remove duplicate array in help_config.c.
2003-07-28 19:31:32 +00:00
Bruce Momjian 1c241545e3 There was enough code drift since this patch, that a couple of bugs
materialized.

New items have been added to GucContext and GucSource enums, but of
course they were not added to the corresponding GucContextName[] and
GucSourceName[] arrays in the patch. Here's a new patch to fix the
resulting bugs.

Joe Conway
2003-07-28 16:22:16 +00:00
Tom Lane 81b5c8a136 A visit from the message-style police ... 2003-07-28 00:09:16 +00:00
Bruce Momjian 38fb906f93 > Joe Conway <mail@joeconway.com> writes:
>>ISTM that "source" is worth knowing.
>
> Hm, possibly.  Any other opinions?

This version has the seven fields I proposed, including "source". Here's
an example that shows why I think it's valuable:

regression=# \x
Expanded display is on.
regression=# select * from pg_settings where name = 'enable_seqscan';
-[ RECORD 1 ]-----------
name    | enable_seqscan
setting | on
context | user
vartype | bool
source  | default
min_val |
max_val |

regression=# update pg_settings set setting = 'off' where name =
'enable_seqscan';
-[ RECORD 1 ]---
set_config | off

regression=# select * from pg_settings where name = 'enable_seqscan';
-[ RECORD 1 ]-----------
name    | enable_seqscan
setting | off
context | user
vartype | bool
source  | session
min_val |
max_val |

regression=# alter user postgres set enable_seqscan to 'off';
ALTER USER

(log out and then back in again)

regression=# \x
Expanded display is on.
regression=# select * from pg_settings where name = 'enable_seqscan';
-[ RECORD 1 ]-----------
name    | enable_seqscan
setting | off
context | user
vartype | bool
source  | user
min_val |
max_val |

In the first case, enable_seqscan is set to its default value. After
setting it to off, it is obvious that the value has been changed for the
session only. In the third case, you can see that the value has been set
specifically for the user.

Joe Conway
2003-07-27 04:35:54 +00:00
Tom Lane 689eb53e47 Error message editing in backend/utils (except /adt). 2003-07-25 20:18:01 +00:00
Bruce Momjian a0cc9f3cb9 Add GUC parameter to control rendezvous name. 2003-07-22 20:29:13 +00:00
Tom Lane cfa6999d3b Cause SHOW DATESTYLE to produce a string that will be accepted by SET
DATESTYLE, for instance 'SQL, European' instead of
'SQL with European conventions'.  Per gripe a month or two back from
Barry Lind.
2003-07-15 19:19:56 +00:00
Bruce Momjian 0ecc8ac425 Add special checks for non-super-user setting LOG_MIN_DURATION_STATEMENT
to zero.
2003-07-09 08:51:19 +00:00
Bruce Momjian bf889e649a Add new USERLIMIT GUC source level so certain options can be disabled
or increased only by super-users.

This fixes problems caused by making certain variables SUSET for
security reasons.
2003-07-09 06:47:34 +00:00
Tom Lane b700a672fe Add --help-config facility to dump information about GUC parameters
without needing a running backend.  Reorder postgresql.conf.sample
to match new layout of runtime.sgml.  This commit re-adds work lost
in Wednesday's crash.
2003-07-04 16:41:22 +00:00
Tom Lane 219e29784d Add GUC option log_error_verbosity to control which fields of error
reports get put into the postmaster log.  Options are TERSE, DEFAULT,
VERBOSE, with the same behavior as implemented on the client side in
libpq.
2003-06-30 16:47:02 +00:00
Tom Lane ea886339b8 Add is_superuser parameter reporting, soon to be used by psql. 2003-06-27 19:08:38 +00:00
Bruce Momjian 240dc5cddc Add add_missing_from GUC variable.
Nigel J. Andrews
2003-06-11 22:13:22 +00:00
Bruce Momjian a24c5a7b12 Make "log_min_duration_statement" SUSET --- will be adjusted with new
USERLIMIT patch.
2003-06-11 18:49:00 +00:00
Bruce Momjian b952d61c54 Add log_min_duration_statement.
Christopher Kings-Lynne
2003-06-11 18:01:14 +00:00
Bruce Momjian b83f711dec Remove lock* GUC variables from postgresql.conf.
Document why certain GUC variables aren't in postgresql.conf.
2003-06-11 05:04:51 +00:00
Tom Lane 4df52b28f0 Fix things so that an error occuring during standalone-backend processing
in initdb will result in exit(1), allowing the initdb script to realize
that there's something wrong.
2003-05-28 18:19:09 +00:00
Bruce Momjian aea0270c23 Make log_ GUC settings controllable only by super-users, so non-super
users can't turn it off.
2003-05-27 17:55:50 +00:00
Bruce Momjian 98b6f37e47 Make debug_ GUC varables output DEBUG1 rather than LOG, and mention in
docs that CLIENT/LOG_MIN_MESSAGES now controls debug_* output location.
Doc changes included.
2003-05-27 17:49:47 +00:00
Tom Lane f85f43dfb5 Backend support for autocommit removed, per recent discussions. The
only remnant of this failed experiment is that the server will take
SET AUTOCOMMIT TO ON.  Still TODO: provide some client-side autocommit
logic in libpq.
2003-05-14 03:26:03 +00:00
Tom Lane 79913910d4 Restructure command destination handling so that we pass around
DestReceiver pointers instead of just CommandDest values.  The DestReceiver
is made at the point where the destination is selected, rather than
deep inside the executor.  This cleans up the original kluge implementation
of tstoreReceiver.c, and makes it easy to support retrieving results
from utility statements inside portals.  Thus, you can now do fun things
like Bind and Execute a FETCH or EXPLAIN command, and it'll all work
as expected (e.g., you can Describe the portal, or use Execute's count
parameter to suspend the output partway through).  Implementation involves
stuffing the utility command's output into a Tuplestore, which would be
kind of annoying for huge output sets, but should be quite acceptable
for typical uses of utility commands.
2003-05-06 20:26:28 +00:00
Bruce Momjian 36fa297497 SECOND ATTEMPT
Dump/read non-default GUC values for use by exec'ed backend, for Win32.
2003-05-02 22:02:47 +00:00
Bruce Momjian 9f0d69f527 Back out second part of patch. 2003-05-02 22:01:51 +00:00
Bruce Momjian a2e038fbee Back out last commit --- wrong patch. 2003-05-02 21:59:31 +00:00
Tom Lane 9cbaf72177 In the continuing saga of FE/BE protocol revisions, add reporting of
initial values and runtime changes in selected parameters.  This gets
rid of the need for an initial 'select pg_client_encoding()' query in
libpq, bringing us back to one message transmitted in each direction
for a standard connection startup.  To allow server version to be sent
using the same GUC mechanism that handles other parameters, invent the
concept of a never-settable GUC parameter: you can 'show server_version'
but it's not settable by any GUC input source.  Create 'lc_collate' and
'lc_ctype' never-settable parameters so that people can find out these
settings without need for pg_controldata.  (These side ideas were all
discussed some time ago in pgsql-hackers, but not yet implemented.)
2003-04-25 19:45:10 +00:00
Tom Lane fd42262836 Add code to apply some simple sanity checks to the header fields of a
page when it's read in, per pghackers discussion around 17-Feb.  Add a
GUC variable zero_damaged_pages that causes the response to be a WARNING
followed by zeroing the page, rather than the normal ERROR; this is per
Hiroshi's suggestion that there needs to be a way to get at the data
in the rest of the table.
2003-03-28 20:17:13 +00:00
Bruce Momjian 15ce2d2e4a > I can see a couple possible downsides: (a) the library might have some
> weird behavior across fork boundaries; (b) the additional memory space
> that has to be duplicated into child processes will cost something per
> child launch, even if the child never uses it.  But these are only
> arguments that it might not *always* be a prudent thing to do, not that
> we shouldn't give the DBA the tool to do it if he wants.  So fire away.

Here is a patch for the above, including a documentation update. It
creates a new GUC variable "preload_libraries", that accepts a list in
the form:

   preload_libraries = '$libdir/mylib1:initfunc,$libdir/mylib2'

If ":initfunc" is omitted or not found, no initialization function is
executed, but the library is still preloaded. If "$libdir/mylib" isn't
found, the postmaster refuses to start.

In my testing with PL/R, it reduces the first call to a PL/R function
(after connecting) from almost 2 seconds, down to about 8 ms.

Joe Conway
2003-03-20 04:51:44 +00:00
Tom Lane 391eb5e5b6 Reimplement free-space-map management as per recent discussions.
Adjustable threshold is gone in favor of keeping track of total requested
page storage and doling out proportional fractions to each relation
(with a minimum amount per relation, and some quantization of the results
to avoid thrashing with small changes in page counts).  Provide special-
case code for indexes so as not to waste space storing useless page
free space counts.  Restructure internal data storage to be a flat array
instead of list-of-chunks; this may cost a little more work in data
copying when reorganizing, but allows binary search to be used during
lookup_fsm_page_entry().
2003-03-04 21:51:22 +00:00
Tom Lane 3981f2195f Remove no-longer-used FixBTree GUC variable. 2003-02-23 23:27:21 +00:00
Tom Lane 77ede8900d Create a GUC variable REGEX_FLAVOR to control the type of regular
expression accepted by the regex operators, per discussion yesterday.

Along the way, reduce deadlock_timeout from PGC_POSTMASTER to PGC_SIGHUP
category.  It is probably best to insist that all backends share the same
setting, but that doesn't mean it has to be frozen at startup.
2003-02-06 20:25:33 +00:00
Tom Lane c0276244b1 Convert variable name to canonical spelling before checking for matches
in GUCArrayAdd/GUCArrayDelete.  This prevents the multiple-entry bug
exhibited by Frank Lupo 28-Jan-2003.
2003-01-28 18:04:02 +00:00
Bruce Momjian bd175cc9fb Set log_min_error_messages to the proper and agreed-upon default, PANIC (off).
Backpatch to 7.3.X.
2003-01-27 23:55:38 +00:00
Tom Lane 9f5f212475 Allow the planner to collapse explicit inner JOINs together, rather than
necessarily following the JOIN syntax to develop the query plan.  The old
behavior is still available by setting GUC variable JOIN_COLLAPSE_LIMIT
to 1.  Also create a GUC variable FROM_COLLAPSE_LIMIT to control the
similar decision about when to collapse sub-SELECT lists into their parent
lists.  (This behavior existed already, but the limit was always
GEQO_THRESHOLD/2; now it's separately adjustable.)
2003-01-25 23:10:30 +00:00
Peter Eisentraut b65cd56240 Read-only transactions, as defined in SQL. 2003-01-10 22:03:30 +00:00
Bruce Momjian 9a39ba4b0f Trivial patch to increase max_fsm_pages as per earlier discussion.
Philip Warner
2002-12-27 14:06:34 +00:00
Tom Lane 2802668159 Repair core dump when trying to delete an entry from an already-NULL
datconfig or useconfig field.  Per report from Dustin Sallings.
2002-12-02 05:20:47 +00:00
Tom Lane 6c1d4662af Finish implementation of hashed aggregation. Add enable_hashagg GUC
parameter to allow it to be forced off for comparison purposes.
Add ORDER BY clauses to a bunch of regression test queries that will
otherwise produce randomly-ordered output in the new regime.
2002-11-21 00:42:20 +00:00
Bruce Momjian 2986aa6a66 Add checkpoint_warning to warn of excessive checkpoints caused by too
few WAL files.
2002-11-15 02:44:57 +00:00
Bruce Momjian c948a3f4b8 Rename hostname_lookup to log_hostname. 2002-11-15 01:57:28 +00:00
Bruce Momjian aead49667b Rename show_source_port to log_source_port. 2002-11-15 01:40:20 +00:00
Bruce Momjian 559b6c7ced Rename show_btree_build_stats to log_btree_build_stats 2002-11-15 01:26:09 +00:00
Bruce Momjian d36aa2e885 Rename:
! #show_parser_stats = false
! #show_planner_stats = false
! #show_executor_stats = false
! #show_statement_stats = false

TO:

! #log_parser_stats = false
! #log_planner_stats = false
! #log_executor_stats = false
! #log_statement_stats = false
2002-11-15 00:47:22 +00:00
Bruce Momjian 001d5a7aa5 Rename server_min_messages to log_min_messages. Part of consolidation
of log_ settings.
2002-11-14 23:53:27 +00:00
Tom Lane d2c744aa56 Add extra_float_digits GUC parameter to allow adjustment of displayed
precision for float4, float8, and geometric types.  Set it in pg_dump
so that float data can be dumped/reloaded exactly (at least on platforms
where the float I/O support is properly implemented).  Initial patch by
Pedro Ferreira, some additional work by Tom Lane.
2002-11-08 17:37:52 +00:00
Tom Lane cab9437a43 Arrange to compile flex output files as inclusions into other files
(usually bison output files), not as standalone files.  This hack
works around flex's insistence on including <stdio.h> before we are
able to include postgres.h; postgres.h will already be read before
the compiler starts to read the flex output file.  Needed for largefile
support on some platforms.
2002-11-01 22:52:34 +00:00
Tom Lane 55e4ef138c Code review for statement_timeout patch. Fix some race conditions
between signal handler and enable/disable code, avoid accumulation of
timing error due to trying to maintain remaining-time instead of
absolute-end-time, disable timeout before commit not after.
2002-10-31 21:34:17 +00:00
Bruce Momjian c74c7e604c Turn GUC log_min_error_statement off by default by setting it to PANIC. 2002-10-02 16:27:57 +00:00
Tom Lane 0b620e33db server_min_messages and friends should have valid values at bootup. 2002-09-22 19:52:38 +00:00
Tom Lane 2b0319869a Avoid misleading error message when SET/RESET target variable name
doesn't match any known variable.
2002-09-12 14:03:45 +00:00
Tom Lane 94d8a798fa Powerup defaults for LC_foo GUC variables should match what main.c does. 2002-09-10 16:09:02 +00:00
Bruce Momjian e50f52a074 pgindent run. 2002-09-04 20:31:48 +00:00
Bruce Momjian 9fd842c4b2 Add GUC variable to print original query to the server logs when there
is an error, warning, etc.

Gavin Sherry
2002-09-02 05:42:54 +00:00
Tom Lane c7a165adc6 Code review for HeapTupleHeader changes. Add version number to page headers
(overlaying low byte of page size) and add HEAP_HASOID bit to t_infomask,
per earlier discussion.  Simplify scheme for overlaying fields in tuple
header (no need for cmax to live in more than one place).  Don't try to
clear infomask status bits in tqual.c --- not safe to do it there.  Don't
try to force output table of a SELECT INTO to have OIDs, either.  Get rid
of unnecessarily complex three-state scheme for TupleDesc.tdhasoids, which
has already caused one recent failure.  Improve documentation.
2002-09-02 01:05:06 +00:00
Bruce Momjian 548d646e65 Add log_duration to GUC/postgresql.conf.
Rename debug_print_query to log_statement and rename show_query_stats to
show_statement_stats.
2002-09-01 23:26:06 +00:00
Tom Lane 26993b2918 AUTOCOMMIT mode is now an available backend GUC variable; setting it
to false provides more SQL-spec-compliant behavior than we had before.
I am not sure that setting it false is actually a good idea yet; there
is a lot of client-side code that will probably be broken by turning
autocommit off.  But it's a start.

Loosely based on a patch by David Van Wie.
2002-08-30 22:18:07 +00:00
Bruce Momjian 63653f7ffa Complete TODO item:
* Remove wal_files postgresql.conf option because WAL files are
	  now recycled
2002-08-30 16:50:50 +00:00
Bruce Momjian 626eca697c This patch reserves the last superuser_reserved_connections slots for
connections by the superuser only.

This patch replaces the last patch I sent a couple of days ago.

It closes a connection that has not been authorised by a superuser if it would
leave less than the GUC variable ReservedBackends
(superuser_reserved_connections in postgres.conf) backend process slots free
in the SISeg. This differs to the first patch which only reserved the last
ReservedBackends slots in the procState array. This has made the free slot
test more expensive due to the use of a lock.

After thinking about a comment on the first patch I've also made it a fatal
error if the number of reserved slots is not less than the maximum number of
connections.

Nigel J. Andrews
2002-08-29 21:02:12 +00:00
Tom Lane e4186762ff Adjust nodeFunctionscan.c to reset transient memory context between calls
to the table function, thus preventing memory leakage accumulation across
calls.  This means that SRFs need to be careful to distinguish permanent
and local storage; adjust code and documentation accordingly.  Patch by
Joe Conway, very minor tweaks by Tom Lane.
2002-08-29 17:14:33 +00:00
Tom Lane 64505ed58b Code review for standalone composite types, query-specified composite
types, SRFs.  Not happy with memory management yet, but I'll commit these
other changes.
2002-08-29 00:17:06 +00:00
Tom Lane 5cabcfccce Modify array operations to include array's element type OID in the
array header, and to compute sizing and alignment of array elements
the same way normal tuple access operations do --- viz, using the
tupmacs.h macros att_addlength and att_align.  This makes the world
safe for arrays of cstrings or intervals, and should make it much
easier to write array-type-polymorphic functions; as examples see
the cleanups of array_out and contrib/array_iterator.  By Joe Conway
and Tom Lane.
2002-08-26 17:54:02 +00:00
Bruce Momjian 2c6b34d959 Add db-local user names, per discussion on hackers. 2002-08-18 03:03:26 +00:00
Bruce Momjian 45e2544584 As discussed on several occasions previously, the new anonymous
composite type capability makes it possible to create a system view
based on a table function in a way that is hopefully palatable to
everyone. The attached patch takes advantage of this, moving
show_all_settings() from contrib/tablefunc into the backend (renamed
all_settings(). It is defined as a builtin returning type RECORD. During
initdb a system view is created to expose the same information presently
available through SHOW ALL. For example:

test=# select * from pg_settings where name like '%debug%';
          name          | setting
-----------------------+---------
  debug_assertions      | on
  debug_pretty_print    | off
  debug_print_parse     | off
  debug_print_plan      | off
  debug_print_query     | off
  debug_print_rewritten | off
  wal_debug             | 0
(7 rows)


Additionally during initdb two rules are created which make it possible
to change settings by updating the system view -- a "virtual table" as
Tom put it. Here's an example:

Joe Conway
2002-08-15 02:51:27 +00:00
Tom Lane dc8705531d Really truly enable encrypted passwords by default. 2002-08-14 23:02:59 +00:00
Bruce Momjian b20f80f0b3 Enable encrypted passwords by default. 2002-08-14 22:07:56 +00:00
Tom Lane 77a7e9968b Change memory-space accounting mechanism in tuplesort.c and tuplestore.c
to make a reasonable attempt at accounting for palloc overhead, not just
the requested size of each memory chunk.  Since in many scenarios this
will make for a significant reduction in the amount of space acquired,
partially compensate by doubling the default value of SORT_MEM to 1Mb.
Per discussion in pgsql-general around 9-Jun-2002..
2002-08-12 00:36:12 +00:00
Tom Lane dfef56a92f Improve 'failed to initialize' messages. 2002-08-07 17:26:24 +00:00
Tom Lane ce7565ab91 Instead of having a configure-time DEFAULT_ATTSTATTARGET, store -1 in
attstattarget to indicate 'use the default'.  The default is now a GUC
variable default_statistics_target, and so may be changed on the fly.  Along
the way we gain the ability to have pg_dump dump the per-column statistics
target when it's not the default.  Patch by Neil Conway, with some kibitzing
from Tom Lane.
2002-07-31 17:19:54 +00:00
Bruce Momjian 23a8b77d42 Here are two patches. The guc_and_tablefunc patch addresses the two
changes mentioned above, and also adds a new function to the tablefunc
API. The tablefunc API change adds the following function:

* Oid foidGetTypeId(Oid foid) - Get a function's typeid given the
* function Oid. Use this together with TypeGetTupleDesc() to get a
* TupleDesc which is derived from the function's declared return type.

In the next post I'll send the contrib/tablefunc patch, which
illustrates the usage of this new function. Also attached is a doc patch
for this change. The doc patch also adds a function that I failed to
document previously.

Joe Conway
2002-07-30 16:20:03 +00:00
Tom Lane c33a6343cd Code review for SHOW output changes; fix horology expected files for
new SHOW output format.
2002-07-20 15:12:56 +00:00
Bruce Momjian 63cfc6a8e8 Fix problems caused by code drift of API for without-oids. 2002-07-20 06:17:43 +00:00
Bruce Momjian 1ce03603cc > 2. This patch includes the same Table Function API fixes that I
>    submitted on July 9:
>
>    http://archives.postgresql.org/pgsql-patches/2002-07/msg00056.php
>
>    Please disregard that one *if* this one is applied. If this one is
>    rejected please go ahead with the July 9th patch.

The July 9th Table Function API patch mentioned above is now in CVS, so
here is an updated version of the guc patch which should apply cleanly
against CVS tip.

Joe Conway
2002-07-20 05:49:28 +00:00
Tatsuo Ishii eb335a034b I have committed many support files for CREATE CONVERSION. Default
conversion procs and conversions are added in initdb. Currently
supported conversions are:

UTF-8(UNICODE) <--> SQL_ASCII, ISO-8859-1 to 16, EUC_JP, EUC_KR,
		    EUC_CN, EUC_TW, SJIS, BIG5, GBK, GB18030, UHC,
		    JOHAB, TCVN

EUC_JP <--> SJIS
EUC_TW <--> BIG5
MULE_INTERNAL <--> EUC_JP, SJIS, EUC_TW, BIG5

Note that initial contents of pg_conversion system catalog are created
in the initdb process. So doing initdb required is ideal, it's
possible to add them to your databases by hand, however. To accomplish
this:

psql -f your_postgresql_install_path/share/conversion_create.sql your_database

So I did not bump up the version in cataversion.h.

TODO:
Add more conversion procs
Add [CASCADE|RESTRICT] to DROP CONVERSION
Add tuples to pg_depend
Add regression tests
Write docs
Add SQL99 CONVERT command?
--
Tatsuo Ishii
2002-07-18 02:02:30 +00:00
Bruce Momjian 4db8718e84 Add SET statement_timeout capability. Timeout is in ms. A value of
zero turns off the timer.
2002-07-13 01:02:14 +00:00
Bruce Momjian 0dbfea39f3 Remove KSQO from GUC and move file to _deadcode. 2002-06-16 00:09:12 +00:00
Tom Lane 5f21560ae8 Dept. of second thoughts: interaction between DoIt and makeDepend
in set_config_option wasn't quite right.  Also clean up a couple other
things that could have been done better.
2002-05-17 20:32:29 +00:00
Tom Lane f0811a74b3 Merge the last few variable.c configuration variables into the generic
GUC support.  It's now possible to set datestyle, timezone, and
client_encoding from postgresql.conf and per-database or per-user
settings.  Also, implement rollback of SET commands that occur in a
transaction that later fails.  Create a SET LOCAL var = value syntax
that sets the variable only for the duration of the current transaction.
All per previous discussions in pghackers.
2002-05-17 01:19:19 +00:00
Peter Eisentraut 5c4e5aa3ff Make regression tests locale-proof by setting some locale categories
to C at run-time, and providing alternative output files for different
sort orders.
2002-05-14 13:05:43 +00:00
Tatsuo Ishii ad201b8d18 Remove --enable-syslog option 2002-04-21 00:22:52 +00:00
Peter Eisentraut 867901db9e Locale support is on by default. The choice of locale is done in initdb
and/or with GUC variables.
2002-04-03 05:39:33 +00:00
Tom Lane 838fe25a95 Create a new GUC variable search_path to control the namespace search
path.  The default behavior if no per-user schemas are created is that
all users share a 'public' namespace, thus providing behavior backwards
compatible with 7.2 and earlier releases.  Probably the semantics and
default setting will need to be fine-tuned, but this is a start.
2002-04-01 03:34:27 +00:00
Tom Lane 10d3995057 EXPLAIN output now comes out as a query result, not a NOTICE message.
Also, fix debug logging of parse/plan trees so that the messages actually
go through elog(), not directly to stdout.
2002-03-24 04:31:09 +00:00
Bruce Momjian 92288a1cf9 Change made to elog:
o  Change all current CVS messages of NOTICE to WARNING.  We were going
to do this just before 7.3 beta but it has to be done now, as you will
see below.

o Change current INFO messages that should be controlled by
client_min_messages to NOTICE.

o Force remaining INFO messages, like from EXPLAIN, VACUUM VERBOSE, etc.
to always go to the client.

o Remove INFO from the client_min_messages options and add NOTICE.

Seems we do need three non-ERROR elog levels to handle the various
behaviors we need for these messages.

Regression passed.
2002-03-06 06:10:59 +00:00
Bruce Momjian a033daf566 Commit to match discussed elog() changes. Only update is that LOG is
now just below FATAL in server_min_messages.  Added more text to
highlight ordering difference between it and client_min_messages.

---------------------------------------------------------------------------

REALLYFATAL => PANIC
STOP => PANIC
New INFO level the prints to client by default
New LOG level the prints to server log by default
Cause VACUUM information to print only to the client
NOTICE => INFO where purely information messages are sent
DEBUG => LOG for purely server status messages
DEBUG removed, kept as backward compatible
DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1 added
DebugLvl removed in favor of new DEBUG[1-5] symbols
New server_min_messages GUC parameter with values:
        DEBUG[5-1], INFO, NOTICE, ERROR, LOG, FATAL, PANIC
New client_min_messages GUC parameter with values:
        DEBUG[5-1], LOG, INFO, NOTICE, ERROR, FATAL, PANIC
Server startup now logged with LOG instead of DEBUG
Remove debug_level GUC parameter
elog() numbers now start at 10
Add test to print error message if older elog() values are passed to elog()
Bootstrap mode now has a -d that requires an argument, like postmaster
2002-03-02 21:39:36 +00:00
Peter Eisentraut 1aac2c852a User and database-specific session defaults for run-time configuration
variables.  New commands ALTER DATABASE ... SET and ALTER USER ... SET.
2002-03-01 22:45:19 +00:00
Peter Eisentraut 51f195580f Save source of GUC settings, allowing different sources to be processed in
any order without affecting results.
2002-02-23 01:31:37 +00:00
Bruce Momjian c41b6b1b9c Fix small problem Tom Lane found with pgindent run. 2001-10-30 05:38:56 +00:00
Bruce Momjian 6783b2372e Another pgindent run. Fixes enum indenting, and improves #endif
spacing.  Also adds space for one-line comments.
2001-10-28 06:26:15 +00:00
Bruce Momjian b81844b173 pgindent run on all C files. Java run to follow. initdb/regression
tests pass.
2001-10-25 05:50:21 +00:00
Tom Lane f00da6d841 Allow the postmaster to accept changes in PGC_BACKEND GUC variables
from the config file, so that these changes will propagate to backends
started later.  Already-started backends continue to ignore changes
in these variables.
2001-09-30 20:16:21 +00:00
Tom Lane f9f258281e Create a GUC parameter max_files_per_process that is a configurable
upper limit on what we will believe from sysconf(_SC_OPEN_MAX).  The
default value is 1000, so that under ordinary conditions it won't
affect the behavior.  But on platforms where the kernel promises far
more than it can deliver, this can be used to prevent running out of
file descriptors.  See numerous past discussions, eg, pgsql-hackers
around 23-Dec-2000.
2001-09-30 18:57:45 +00:00
Tom Lane 499abb0c0f Implement new 'lightweight lock manager' that's intermediate between
existing lock manager and spinlocks: it understands exclusive vs shared
lock but has few other fancy features.  Replace most uses of spinlocks
with lightweight locks.  All remaining uses of spinlocks have very short
lock hold times (a few dozen instructions), so tweak spinlock backoff
code to work efficiently given this assumption.  All per my proposal on
pghackers 26-Sep-01.
2001-09-29 04:02:27 +00:00
Peter Eisentraut c0a9283742 Rename collect_* options to more user-friendly names. 2001-09-23 21:52:36 +00:00
Tom Lane 35b7601b04 Add an overall timeout on the client authentication cycle, so that
a hung client or lost connection can't indefinitely block a postmaster
child (not to mention the possibility of deliberate DoS attacks).
Timeout is controlled by new authentication_timeout GUC variable,
which I set to 60 seconds by default ... does that seem reasonable?
2001-09-21 17:06:12 +00:00
Tom Lane c969fed7ec Give VACUUM its own GUC parameter for memory usage, rather than
piggybacking on SortMem.  Add documentation for some recently-added
GUC parameters that had so far escaped it.
2001-09-21 03:32:36 +00:00
Peter Eisentraut a1ee06625c Provide tunable knob for x = NULL -> x IS NULL transformation, default to off. 2001-09-20 14:20:28 +00:00
Peter Eisentraut dfdbf6898f max_locks_per_transaction seems to be a more consistent name than
max_locks_per_xact.
2001-09-12 14:06:37 +00:00
Tom Lane 863aceb54f Get rid of PID entries in shmem hash table; there is no longer any need
for them, and making them just wastes time during backend startup/shutdown.
Also, remove compile-time MAXBACKENDS limit per long-ago proposal.
You can now set MaxBackends as high as your kernel can stand without
any reconfiguration/recompilation.
2001-09-07 00:27:30 +00:00
Bruce Momjian 38bb1abcda Use MD5 for wire protocol encryption for >= 7.2 client/server.
Allow pg_shadow to be MD5 encrypted.
Add ENCRYPTED/UNENCRYPTED option to CREATE/ALTER user.
Add password_encryption postgresql.conf option.
Update wire protocol version to 2.1.
2001-08-15 18:42:16 +00:00
Jan Wieck 6497a7fd71 Added GUC configuration options to control access statistics.
Jan
2001-07-05 15:19:40 +00:00
Peter Eisentraut 10e9cd2299 Allow default transaction isolation level (a.k.a. set session
characteristics) to be set through GUC.
2001-06-30 22:03:26 +00:00
Tom Lane e0c9301c87 Install infrastructure for shared-memory free space map. Doesn't actually
do anything yet, but it has the necessary connections to initialization
and so forth.  Make some gestures towards allowing number of blocks in
a relation to be BlockNumber, ie, unsigned int, rather than signed int.
(I doubt I got all the places that are sloppy about it, yet.)  On the
way, replace the hardwired NLOCKS_PER_XACT fudge factor with a GUC
variable.
2001-06-27 23:31:40 +00:00
Bruce Momjian 6a7f23c213 > Marko Kreen <marko@l-t.ee> writes:
> > secure_ctx changes too.  it will be PGC_BACKEND after '-p'.
>
> Oh, okay, I missed that part.  Could we see the total state of the
> patch --- ie, a diff against current CVS, not a bunch of deltas?
> I've gotten confused about what's in and what's out.

Ok, here it is.  Cleared the ctx comment too - after -p
it will be PGC_BACKEND in any case.

Marko Kreen
2001-06-23 22:23:49 +00:00
Bruce Momjian 2e81f3d204 Back out SET ALL patch because it is breaking things. 2001-06-19 23:40:10 +00:00
Bruce Momjian 3709a5ada7 RESET ALL secondary patch:
Here is Tomified version of my 2 pending patches.
Dropped the set_.._real change as it is not needed.
Desc would be:

* use GUC for settings from cmdline

Marko Kreen
2001-06-18 23:42:32 +00:00
Bruce Momjian 7dac778561 Add GUC setting for Australian timezones. Uses new GUC boolean callback
functions to clear date cache.  Allow regression tests to pass when
timezone set.
2001-06-18 16:14:44 +00:00
Tom Lane 2938eec7fe Extend GUC concepts of parse_hook and assign_hook to all four supported
datatypes, not only strings.  parse_hook is useless for bool, I suppose,
but it seems possibly useful for int and double to apply variable-specific
constraints that are more complex than simple range limits.  assign_hook
is definitely useful for all datatypes --- we need it right now for bool
to support date cache reset when changing Australian timezone rule setting.
Also, clean up some residual problems with the reset all/show all patch,
including memory leaks and mistaken reset of PostPortNumber.  It seems
best that RESET ALL not touch variables that don't have SUSET or
USERSET context.
2001-06-12 22:54:06 +00:00
Bruce Momjian 4ee76ad884 reset all: command line and .conf options change defaults
on RESET ALL those are restored.

show all: GUC + non-GUC.

SHOW ALL, RESET ALL

Marko Kreen
2001-06-07 04:50:57 +00:00
Peter Eisentraut 761a0bb69b Add dynamic_library_path parameter and automatic appending of shared
library extension.
2001-05-17 17:44:18 +00:00
Tom Lane b32cac8055 Fix Joubert's complaint that int8-sized numeric literals are mishandled
on Alpha (because parser mistakenly assumes that a nonoverflow result
from strtol means the value will fit into int4).  A scan for other uses
of strtol and strtoul found a couple other places with the same mistake;
fix them too.  The changes are all conditional on HAVE_LONG_INT_64 to
avoid complaints from compilers that think x != x is a silly test
(cf. pg_atoi).
2001-03-22 17:41:47 +00:00
Bruce Momjian 9e1552607a pgindent run. Make it all clean. 2001-03-22 04:01:46 +00:00
Tom Lane 9d645fd84c Support syncing WAL log to disk using either fsync(), fdatasync(),
O_SYNC, or O_DSYNC (as available on a given platform).  Add GUC parameter
to control sync method.
Also, add defense to XLogWrite to prevent it from going nuts if passed
a target write position that's past the end of the buffers so far filled
by XLogInsert.
2001-03-16 05:44:33 +00:00
Tom Lane 4d14fe0048 XLOG (and related) changes:
* Store two past checkpoint locations, not just one, in pg_control.
  On startup, we fall back to the older checkpoint if the newer one
  is unreadable.  Also, a physical copy of the newest checkpoint record
  is kept in pg_control for possible use in disaster recovery (ie,
  complete loss of pg_xlog).  Also add a version number for pg_control
  itself.  Remove archdir from pg_control; it ought to be a GUC
  parameter, not a special case (not that it's implemented yet anyway).

* Suppress successive checkpoint records when nothing has been entered
  in the WAL log since the last one.  This is not so much to avoid I/O
  as to make it actually useful to keep track of the last two
  checkpoints.  If the things are right next to each other then there's
  not a lot of redundancy gained...

* Change CRC scheme to a true 64-bit CRC, not a pair of 32-bit CRCs
  on alternate bytes.  Polynomial borrowed from ECMA DLT1 standard.

* Fix XLOG record length handling so that it will work at BLCKSZ = 32k.

* Change XID allocation to work more like OID allocation.  (This is of
  dubious necessity, but I think it's a good idea anyway.)

* Fix a number of minor bugs, such as off-by-one logic for XLOG file
  wraparound at the 4 gig mark.

* Add documentation and clean up some coding infelicities; move file
  format declarations out to include files where planned contrib
  utilities can get at them.

* Checkpoint will now occur every CHECKPOINT_SEGMENTS log segments or
  every CHECKPOINT_TIMEOUT seconds, whichever comes first.  It is also
  possible to force a checkpoint by sending SIGUSR1 to the postmaster
  (undocumented feature...)

* Defend against kill -9 postmaster by storing shmem block's key and ID
  in postmaster.pid lockfile, and checking at startup to ensure that no
  processes are still connected to old shmem block (if it still exists).

* Switch backends to accept SIGQUIT rather than SIGUSR1 for emergency
  stop, for symmetry with postmaster and xlog utilities.  Clean up signal
  handling in bootstrap.c so that xlog utilities launched by postmaster
  will react to signals better.

* Standalone bootstrap now grabs lockfile in target directory, as added
  insurance against running it in parallel with live postmaster.
2001-03-13 01:17:06 +00:00
Tom Lane 9c9936587c Implement COMMIT_SIBLINGS parameter to allow pre-commit delay to occur
only if at least N other backends currently have open transactions.  This
is not a great deal of intelligence about whether a delay might be
profitable ... but it beats no intelligence at all.  Note that the default
COMMIT_DELAY is still zero --- this new code does nothing unless that
setting is changed.
Also, mark ENABLEFSYNC as a system-wide setting.  It's no longer safe to
allow that to be set per-backend, since we may be relying on some other
backend's fsync to have synced the WAL log.
2001-02-26 00:50:08 +00:00
Tom Lane 57e0847180 Change default commit_delay to zero, update documentation. 2001-02-18 04:50:43 +00:00
Vadim B. Mikheev 608ddb7503 FixBTree flag still exists and may be used to turn
runtime recovery OFF.
2001-02-07 23:36:22 +00:00
Bruce Momjian 7df3bb50f0 Add all possible config file options. 2001-01-24 18:37:31 +00:00
Vadim B. Mikheev 4b59366e57 1. Checkpoint.undo may be after checkpoint itself:
- no more elog(STOP) in StartupXLOG();
   - both checkpoint' undo & redo are used to define
     oldest on-line log file.
2. Ability to pre-allocate a few log files at checkpoint time
   (wal_files option). Off by default.
2001-01-09 06:24:33 +00:00
Peter Eisentraut 13dbd0276a Final(?) GUC clean-up. Update psql tab completion. 2000-12-03 14:36:47 +00:00
Vadim B. Mikheev 741510521c XLOG stuff for sequences.
CommitDelay in guc.c
2000-11-30 01:47:33 +00:00
Tom Lane 792b0f4666 Get rid of not-very-portable fcntl(F_SETLK) mechanism for locking the Unix
socket file, in favor of having an ordinary lockfile beside the socket file.
Clean up a few robustness problems in the lockfile code.  If postmaster is
going to reject a connection request based on database state, it will now
tell you so before authentication exchange not after.  (Of course, a failure
after is still possible if conditions change meanwhile, but this makes life
easier for a yet-to-be-written pg_ping utility.)
2000-11-29 20:59:54 +00:00
Bruce Momjian 9d5098ca78 Rename GUC name from unixsocket to unix_socket_directory 2000-11-25 04:13:18 +00:00
Vadim B. Mikheev a221d95f28 Compile WAL by default. 2000-11-20 05:18:40 +00:00
Peter Eisentraut 76920de895 Rename parameter "hostname" to "virtual_host". Seemed very ambiguous... 2000-11-15 18:36:06 +00:00
Peter Eisentraut 0937bf9544 Small polishing of syslog facility and ident settings. Only allow setting
at postmaster start, rename syslog_progid to syslog_ident, since syslog
itself uses that term, fix doc markup.
2000-11-14 19:13:27 +00:00
Bruce Momjian 026643a6e7 Rename PortName to PortNumber. 2000-11-14 01:15:06 +00:00
Bruce Momjian d63a762f79 Ok, You guys are probably tired of me, BUT, here is another one, that
adds the facility to set the program name used in syslog.
(this includes the other ones).

One gotcha, the parser doesn't like special characters in strings.
For example, i tried to use pg-test, and if failed the parse coming
from the postgresql.conf file.

I don't think it's a showstopper..

Larry Rosenman
2000-11-13 21:35:03 +00:00
Bruce Momjian 2150c2edf1 UUNET is looking into offering PostgreSQL as a part of a managed web
hosting product, on both shared and dedicated machines.  We currently
offer Oracle and MySQL, and it would be a nice middle-ground.
However, as shipped, PostgreSQL lacks the following features we need
that MySQL has:

1. The ability to listen only on a particular IP address.  Each
   hosting customer has their own IP address, on which all of their
   servers (http, ftp, real media, etc.) run.
2. The ability to place the Unix-domain socket in a mode 700 directory.
   This allows us to automatically create an empty database, with an
   empty DBA password, for new or upgrading customers without having
   to interactively set a DBA password and communicate it to (or from)
   the customer.  This in turn cuts down our install and upgrade times.
3. The ability to connect to the Unix-domain socket from within a
   change-rooted environment.  We run CGI programs chrooted to the
   user's home directory, which is another reason why we need to be
   able to specify where the Unix-domain socket is, instead of /tmp.
4. The ability to, if run as root, open a pid file in /var/run as
   root, and then setuid to the desired user.  (mysqld -u can almost
   do this; I had to patch it, too).

The patch below fixes problem 1-3.  I plan to address #4, also, but
haven't done so yet.  These diffs are big enough that they should give
the PG development team something to think about in the meantime :-)
Also, I'm about to leave for 2 weeks' vacation, so I thought I'd get
out what I have, which works (for the problems it tackles), now.

With these changes, we can set up and run PostgreSQL with scripts the
same way we can with apache or proftpd or mysql.

In summary, this patch makes the following enhancements:

1. Adds an environment variable PGUNIXSOCKET, analogous to MYSQL_UNIX_PORT,
   and command line options -k --unix-socket to the relevant programs.
2. Adds a -h option to postmaster to set the hostname or IP address to
   listen on instead of the default INADDR_ANY.
3. Extends some library interfaces to support the above.
4. Fixes a few memory leaks in PQconnectdb().

The default behavior is unchanged from stock 7.0.2; if you don't use
any of these new features, they don't change the operation.

David J. MacKenzie
2000-11-13 15:18:15 +00:00
Vadim B. Mikheev b0299c5d37 Auto checkpoint creation. 2000-11-09 11:26:00 +00:00
Peter Eisentraut d1bfa6c72e Add runtime configuration options to control permission bits and group
owner of unix socket.
2000-11-01 21:14:03 +00:00
Bruce Momjian 3d45543698 Oops, back out my unintended changes. 2000-10-11 17:58:01 +00:00
Bruce Momjian 5e38665f8a Update make_mkid 2000-10-11 17:55:34 +00:00
Tatsuo Ishii 2af8b963f1 Add runtime configuration option "silent_mode".
This is equivalent to postmaster's -S option.
2000-10-08 09:25:38 +00:00
Peter Eisentraut ffd9aaa0a9 A bit of cleanup after SSL patch. Add it to config file, improve
documentation.
2000-09-06 19:54:52 +00:00
Peter Eisentraut 3ce5c6f4d8 Maybe "shared_buffers" is a slightly better name than "shmem_buffers" for -B. 2000-08-28 11:57:41 +00:00
Peter Eisentraut 996832caee Make the location of the Kerberos server key file run time configurable
(rather than compile time). For libpq, even when Kerberos support is
compiled in, the default user name should still fall back to geteuid()
if it can't be determined via the Kerberos system.

A couple of fixes for string type configuration parameters, now that there
is one.
2000-08-25 10:00:35 +00:00
Tom Lane 7090c3e858 Make debug_assertions default to ON, when compiled in at all, for
backwards compatibility with old behavior.
2000-08-11 18:31:10 +00:00
Thomas G. Lockhart be703cd9e8 Implement nested block comments in the backend and in psql.
Include updates for the comment.sql regression test.
Implement SET SESSION CHARACTERISTICS and SET DefaultXactIsoLevel.
Implement SET SESSION CHARACTERISTICS TRANSACTION COMMIT
 and SET AutoCommit in the parser only.
 Need to add code to actually do something.
Implement WITHOUT TIME ZONE type qualifier.
Define SCHEMA keyword, along with stubbed-out grammar.
Implement "[IN|INOUT|OUT] [varname] type" function arguments
 in parser only; INOUT and OUT throws an elog(ERROR).
Add PATH as a type-specific token, since PATH is in SQL99
 to support schema resource search and resolution.
2000-07-14 15:43:57 +00:00
Peter Eisentraut 648677c3a2 Add assert checking to GUC ("debug_assertions")
Rename settings net_server to tcpip_socket, max_backends to max_connections
Add --help and --version to postmaster, reformat help output
2000-07-12 17:38:53 +00:00
Peter Eisentraut e2d3932e0e Move PGPORT envar handling to ResetAllOptions(). Improve long options
parsing to not clobber the optarg string -- so that we can bring
SetOptsFile() up to speed.
2000-07-03 20:46:10 +00:00
Peter Eisentraut c446509565 Second pass over run-time configuration system. Adjust priorities on some
option settings. Sort out SIGHUP vs BACKEND -- there is no total ordering
here, so make explicit checks. Add comments explaining all of this.
Removed permissions check on SHOW command.

Add examine_subclass to the game, rename to SQL_inheritance to fit the
official data model better. Adjust documentation.

Standalone backend needs to reset all options before it starts. To
facilitate that, have IsUnderPostmaster be set by the postmaster itself,
don't wait for the magic -p switch.

Also make sure that all environment variables and argv's survive
init_ps_display(). Use strdup where necessary.

Have initdb make configuration files (postgresql.conf, pg_hba.conf) mode
0600 -- having configuration files is no fun if you can't edit them.
2000-06-22 22:31:24 +00:00
Bruce Momjian 946e80c435 Final #include cleanup. 2000-06-15 04:10:30 +00:00
Peter Eisentraut 0a54de8faf Removed ELOG_TIMESTAMPS #define in favor of two run-time
configuration options `Log_timestamp' and `Log_pid'.
2000-06-04 15:06:34 +00:00
Peter Eisentraut 6a68f42648 The heralded `Grand Unified Configuration scheme' (GUC)
That means you can now set your options in either or all of $PGDATA/configuration,
some postmaster option (--enable-fsync=off), or set a SET command. The list of
options is in backend/utils/misc/guc.c, documentation will be written post haste.

pg_options is gone, so is that pq_geqo config file. Also removed were backend -K,
-Q, and -T options (no longer applicable, although -d0 does the same as -Q).

Added to configure an --enable-syslog option.

changed all callers from TPRINTF to elog(DEBUG)
2000-05-31 00:28:42 +00:00