Commit Graph

15093 Commits

Author SHA1 Message Date
Tom Lane d7bb412e9c Remove some dead code. 2005-09-22 15:09:51 +00:00
Tom Lane 1128f55659 Fix postgresql.conf lexer to accept doubled single quotes in literal
strings.  This is consistent with SQL conventions, and since Bruce
already changed initdb in a way that assumed it worked like this, seems
we'd better make it work like this.
2005-09-21 20:33:34 +00:00
Tom Lane dbf952860e Suppress database dump item when --table and/or --schema switch was
given, per gripe from Michael Fuhr.
2005-09-21 19:58:02 +00:00
Tom Lane bc9d4ec9a1 optimize_minmax_aggregates() neglected to check for inherited tables.
Per report from Cesar Paipilla.
2005-09-21 19:15:27 +00:00
Bruce Momjian 99bb9c551e Fix interaction between psql \set AUTOCOMMIT and "ON_ERROR_ROLLBACK"
by properly updating transaction state after AUTOCOMMIT.
2005-09-20 21:43:08 +00:00
Bruce Momjian b7159824e6 Return proper value for psql -f filename failure if filename open fails.
Backpatch to 8.0.X.
2005-09-20 18:59:02 +00:00
Bruce Momjian 408c140266 autovacuum setting false -> off, for consistency 2005-09-20 02:38:35 +00:00
Bruce Momjian 658657177e Print proper cause of statement cancel, user interaction or timeout. 2005-09-19 17:21:49 +00:00
Peter Eisentraut bfa47ddc20 Clarify some error messages 2005-09-18 09:48:24 +00:00
Bruce Momjian d5eab81313 Adjust regression for new cancel query message. 2005-09-16 19:39:02 +00:00
Bruce Momjian 098d204a6b Update query cancel message:
errmsg("canceling query due to user request or statement timeout")));
2005-09-16 19:31:04 +00:00
Bruce Momjian 1d734b79a3 Adjust bcc to work for thread changes. 2005-09-16 19:00:05 +00:00
Bruce Momjian eab3e9b80d This correction is required of nmake of Windows.
Hiroshi Saito
2005-09-16 18:58:48 +00:00
Teodor Sigaev f4516f8732 Small fixes 2005-09-16 14:40:54 +00:00
Neil Conway e4d9b69779 Rename pg_complete_relation_size() to pg_total_relation_size(), for the
sake of brevity and clarity.

Make pg_reload_conf(), pg_rotate_logfile(), and pg_cancel_backend()
return a boolean rather than an integer to indicate success or failure.

Along the way, make some minor cleanups to dbsize.c -- in particular,
use elog() rather than ereport() for "shouldn't happen" error
conditions, and remove some of the more flagrant violations of the
Postgres indentation conventions.

Catalog version bumped.
2005-09-16 05:35:41 +00:00
Neil Conway 148c00acbb Update two comments to refer to use the new list API names. 2005-09-16 04:13:18 +00:00
Tom Lane dc06734a72 Force the size and alignment of LWLock array entries to be either 16 or 32
bytes.  This shouldn't make any difference on x86 machines, where the size
happened to be 16 bytes anyway, but on 64-bit machines and machines with
slock_t int or wider, it will speed array indexing and hopefully reduce
SMP cache contention effects.  Per recent experimentation.
2005-09-16 00:30:05 +00:00
Neil Conway 1dd9b09332 Copy-editing for GiST README. 2005-09-15 17:44:27 +00:00
Teodor Sigaev 79fae4a764 Readme about GiST's algorithms 2005-09-15 16:39:15 +00:00
Neil Conway 08dc2af91e Tweak the PL/PgSQL regression tests to catch the recently reported bug
in parsing cursor declarations.
2005-09-14 18:35:38 +00:00
Tom Lane 323f0a6c01 Fix recent breakage of decl_cursor_arglist syntax, per Michael Paesold. 2005-09-14 13:46:47 +00:00
Tom Lane 5b0fa0c28c Fix make_tuple_from_row to support nested rowtypes, per gripe from
Roman Neuhauser.  Update some obsolete comments for exec_eval_datum, too.
2005-09-13 16:16:17 +00:00
Tom Lane f59b05c95d Ensure that any memory leaked during an error inside the bgwriter is
recovered.  I did not see any actual leak while testing this in CVS tip,
but 8.0 definitely has a problem with leaking the space temporarily
palloc'd by BufferSync().  In any case this seems a good idea to forestall
similar problems in future.  Per report from Arjen van der Meijden.
2005-09-12 22:20:16 +00:00
Michael Meskes c959d370bf Fixed transaction command handling to not ignore savepoints and to correctly check for errors. 2005-09-12 11:57:53 +00:00
Tom Lane cc3bda37f7 Tweak TCP-keepalive code so that an invalid setting doesn't cause us
to drop connections unceremoniously.  Also some other marginal cleanups:
don't query getsockopt() repeatedly if it fails, and avoid having the
apparent definition of struct Port depend on which system headers you
might have included or not.  Oliver Jowett and Tom Lane.
2005-09-12 02:26:33 +00:00
Tom Lane c7d1a8d428 Fix some corner-case bugs in _sendSQLLine's parsing of SQL commands
> found in a pg_dump archive.  It had problems with dollar-quote tags
broken across bufferload boundaries (this may explain bug report from
Rod Taylor), also with dollar-quote literals of the form $a$a$...,
and was also confused about the rules for backslash in double quoted
identifiers (ie, they're not special).  Also put in placeholder support
for E'...' literals --- this will need more work later.
2005-09-11 04:10:25 +00:00
Tom Lane e1a7d1b9f3 Avoid changing stdin/stdout to binary mode on Windows unless that is
really the source or destination of the archive.  I think this will
resolve recent complaints that password prompting is broken in pg_restore
on Windows.  Note that password prompting and reading from stdin is an
unworkable combination on Windows ... but that was true anyway.
2005-09-11 00:36:14 +00:00
Tom Lane 35979e6c35 Given its current definition that depends on time(NULL), timetz_zone
is certainly no longer immutable, but must indeed be marked volatile.
I wonder if it should use the value of now() (that is, transaction
start time) so that it could be marked stable.  But it's probably not
important enough to be worth changing the code for ... indeed, I'm not
even going to force an initdb for this catalog change, seeing that we
just did one a few hours ago.
2005-09-09 06:51:12 +00:00
Tom Lane f2ebd01ef0 timestamptz_izone should return the input, not NULL, when the input
is a non-finite timestamp, for consistency with related functions.
In other words: +infinity rotated to a different timezone is still
+infinity.
2005-09-09 06:46:14 +00:00
Tom Lane a239af02c3 Fix the various forms of AT TIME ZONE to accept either timezones found
in the zic database or zone names found in the date token table.  This
preserves the old ability to do AT TIME ZONE 'PST' along with the new
ability to do AT TIME ZONE 'PST8PDT'.  Per gripe from Bricklen Anderson.
Also, fix some inconsistencies in usage of TZ_STRLEN_MAX --- the old
code had the potential for one-byte buffer overruns, though given
alignment considerations it's unlikely there was any real risk.
2005-09-09 02:31:50 +00:00
Tom Lane 48123de717 Create the pg_pltemplate system catalog to hold template information
for procedural languages.  This replaces the hard-wired table I had
originally proposed as a stopgap solution.  For the moment, the initial
contents only include languages shipped with the core distribution.
2005-09-08 20:07:42 +00:00
Tom Lane c18cabe8ab Update regression tests for new USA timezone data. Mea culpa for not
realizing that the regression tests could be affected.
2005-09-08 16:49:04 +00:00
Tom Lane 69d48cefd1 Update timezone data files to release 2005m of the zic database.
Among other changes, this reflects the recently passed change in USA
daylight savings rules.
2005-09-07 21:39:25 +00:00
Tom Lane e0dedd0559 Implement a preliminary 'template' facility for procedural languages,
as per my recent proposal.  For now the template data is hard-wired in
proclang.c --- this should be replaced later by a new shared system
catalog, but we don't want to force initdb during 8.1 beta.  This change
lets us cleanly load existing dump files even if they contain outright
wrong information about a PL's support functions, such as a wrong path
to the shared library or a missing validator function.  Also, we can
revert the recent kluges to make pg_dump dump PL support functions that
are stored in pg_catalog.
While at it, I removed the code in pg_regress that replaced $libdir
with a hardcoded path for temporary installations.  This is no longer
needed given our support for relocatable installations.
2005-09-05 23:50:49 +00:00
Tom Lane e35e6b1c37 Back out prior patch and instead just suppress SubqueryScan elimination
when there are extra resjunk columns in the child node.  I found some
additional cases involving Append nodes that weren't handled by the
prior patch, and it's not clear how to fix them in the same way without
breaking inheritance cases.  So the prudent path seems to be to narrow
the scope of the optimization.
2005-09-05 18:59:38 +00:00
Tom Lane 2da2d34770 Clean up version comparison/display code, per gripe from Michael Fuhr. 2005-09-05 18:05:13 +00:00
Tom Lane 03728942c2 For non-projecting plan node types such as Limit, set_plan_references
has to recopy the input plan node's targetlist if it removes a
SubqueryScan node just below the non-projecting node.  For simplicity
I made it recopy always.  Per bug report from Allan Wang and Michael Fuhr.
2005-09-05 17:25:01 +00:00
Bruce Momjian 656fe39b84 Conditionally output the server version number in psql if it doesn't
exactly match the client version number, and warn about major version
mismatches.
2005-09-05 13:59:08 +00:00
Tom Lane a17dbec893 libpgport routines need nonstandard palloc to work on Windows.
Propagate hack that's in dirmod.c to copydir.c.
2005-09-03 15:55:00 +00:00
Bruce Momjian 11b5c554c2 Add log display label for unnamed server-side portals. 2005-09-02 21:50:54 +00:00
Tom Lane 0802078556 Fix the spelling. 2005-09-02 21:25:30 +00:00
Bruce Momjian 4506ec95cf Update listen_addresses description.
Darcy Buskermolen
2005-09-02 21:00:59 +00:00
Tom Lane 35e9b1cc1e Clean up a couple of ad-hoc computations of the maximum number of tuples
on a page, as suggested by ITAGAKI Takahiro.  Also, change a few places
that were using some other estimates of max-items-per-page to consistently
use MaxOffsetNumber.  This is conservatively large --- we could have used
the new MaxHeapTuplesPerPage macro, or a similar one for index tuples ---
but those places are simply declaring a fixed-size buffer and assuming it
will work, rather than actively testing for overrun.  It seems safer to
size these buffers in a way that can't overflow even if the page is
corrupt.
2005-09-02 19:02:20 +00:00
Tom Lane 962a4bb69f In copy_file, use a palloc'd buffer instead of just a local char array;
a local array isn't guaranteed to have any particular alignment, and
so it could slow down the data transfer.
2005-09-02 18:55:32 +00:00
Tom Lane a635ab46be Short-circuit AllocSetReset if nothing has been palloc'd in the memory
context since the previous AllocSetReset.  Original patch by Atsushi Ogawa,
editorialized on a little bit by Tom Lane.
2005-09-01 18:15:42 +00:00
Tom Lane 14720f7c57 Fix unportable uses of <ctype.h> functions. Per Sergey Koposov. 2005-09-01 15:34:31 +00:00
Bruce Momjian 59b4cef1eb Add regression tests for disabling constraints.
Gavin Sherry
2005-08-30 18:57:48 +00:00
Tom Lane b740be2520 Log send() failures when sending to statistics process (but only in
assert-enabled builds).  This is a temporary measure to see if we can
learn anything about those intermittent stats test failures in the
buildfarm.
2005-08-30 02:47:37 +00:00
Tom Lane 13065c7174 DropTableSpace forgot to remove dependency on tablespace's owner.
Per report from Jaime Casanova.
2005-08-30 01:08:47 +00:00
Tom Lane 139b1f61ce Fix misleading comment. 2005-08-30 01:07:54 +00:00
Tom Lane 78ef2d3feb Update documentation about shared memory sizing to reflect current
reality.
2005-08-30 00:58:48 +00:00
Tom Lane 037709e0b3 Reduce default value of max_prepared_transactions from 50 to 5. This
saves nearly 700kB in the default shared memory segment size, which seems
worthwhile, and it is a feature that many users won't use anyway.  Per
Heikki's argument, there is no point in a compromise value --- those who
are using 2PC at all will probably want it at least equal to max_connections.
But we can't set it to zero by default without breaking the prepared_xacts
regression test.
2005-08-29 21:38:18 +00:00
Tom Lane 8aec77fb9f Fix platform-specific test for path prefix-ness: move it into path.c where
it can be done right.  Allow explicit use of absolute DataDir path.
Per Dave Page.
2005-08-29 19:39:39 +00:00
Tom Lane 6b44d796c7 Fix misspelled error message. 2005-08-29 01:32:00 +00:00
Bruce Momjian 1a6fe83011 Allow Win32 libpq will use it's minimal pthread implementation, and ecpg
will use pthreadGC2.

Dave Page
2005-08-29 00:47:35 +00:00
Tom Lane 2d03390945 Sigh, looks like you need '.set mips2' before you can access MIPS
SYNC instruction.
2005-08-29 00:41:34 +00:00
Tom Lane 46a0eee300 Tweak nodeBitmapAnd to stop evaluating sub-plan scans if it finds it's
got an empty bitmap after any step; the remaining subplans can no longer
affect the result.  Per a suggestion from Ilia Kantor.
2005-08-28 22:47:20 +00:00
Bruce Momjian 75e90bbf69 Fix initdb quoting for Win32 paths in final examples, per Dave Page. 2005-08-28 22:21:46 +00:00
Bruce Momjian 3b85fc3a52 Update pthread_self() on Win32 to return DWORD. 2005-08-28 21:42:28 +00:00
Bruce Momjian 8046c1c7e6 Use GetCurrentThreadId, per Magnus. 2005-08-28 18:49:01 +00:00
Tom Lane 7319ab9a59 Add a SYNC instruction to the S_UNLOCK sequence for MIPS. 2005-08-28 18:26:01 +00:00
Bruce Momjian 0c172b215a Add comment about pthread_self() cast. 2005-08-28 16:37:48 +00:00
Tom Lane 0845538f3a dumpUserConfig failed (in a pretty harmless way, but failed nonetheless)
to cope with a group name when dumping from a pre-8.1 installation.
Per report from Stefan Kaltenbrunner.
2005-08-28 16:31:37 +00:00
Tom Lane 974e3cf30a cost_agg really ought to charge something per output tuple; else there
are cases where it appears to have zero run cost.
2005-08-27 22:37:00 +00:00
Tom Lane 4e5fbb34b3 Change the division of labor between grouping_planner and query_planner
so that the latter estimates the number of groups that grouping will
produce.  This is needed because it is primarily query_planner that
makes the decision between fast-start and fast-finish plans, and in the
original coding it was unable to make more than a crude rule-of-thumb
choice when the query involved grouping.  This revision helps us make
saner choices for queries like SELECT ... GROUP BY ... LIMIT, as in a
recent example from Mark Kirkwood.  Also move the responsibility for
canonicalizing sort_pathkeys and group_pathkeys into query_planner;
this information has to be available anyway to support the first change,
and doing it this way lets us get rid of compare_noncanonical_pathkeys
entirely.
2005-08-27 22:13:44 +00:00
Tom Lane 9e56c5a4cf Windows needs WSAStartup() before getaddrinfo() will work. Andrew Dunstan 2005-08-27 18:44:03 +00:00
Tom Lane 5a7d36973a Fix two separate bugs in setrefs.c. set_subqueryscan_references needs
to copy the whole plan tree before invoking adjust_plan_varnos(); else
if there is any multiply-linked substructure, the latter might increment
some Var's varno twice.  Previously there were some retail copyObject
calls inside adjust_plan_varnos, but it seems a lot safer to just dup the
whole tree first.  Also, set_inner_join_references was trying to avoid
work by not recursing if a BitmapHeapScan's bitmapqualorig contained no
outer references; which was OK at the time the code was written, I think,
but now that create_bitmap_scan_plan removes duplicate clauses from
bitmapqualorig it is possible for that field to be NULL while outer
references still remain in the qpqual and/or contained indexscan nodes.
For safety, always recurse even if the BitmapHeapScan looks to be outer
reference free.  Per reports from Michael Fuhr and Oleg Bartunov.
2005-08-27 18:04:49 +00:00
Tom Lane 5824d02155 Get the MIPS assembler syntax right. Also add a separate sync command;
the reference I consulted yesterday said SC does a SYNC, but apparently
this is not true on newer MIPS processors, so be safe.
2005-08-27 16:22:48 +00:00
Tom Lane 846319db3f Another try at the inlined MIPS spinlock code. Can't test this myself,
but for sure it's not any more broken than the prior version.
2005-08-26 22:04:42 +00:00
Tom Lane a9118fc5a8 The idea of using _strncoll() on Windows doesn't work. Revert to same
code as we use on other platforms when encoding is not UTF8.
2005-08-26 17:40:36 +00:00
Tom Lane 396526d8c3 Adjust m68k spinlock code to avoid duplicate in-line and not-in-line
definitions on recent Linux systems, per Martin Pitt.
2005-08-26 14:47:35 +00:00
Tom Lane a310a1d80c Some more mop-up for Windows IPv6 support. Andrew Dunstan 2005-08-26 03:15:12 +00:00
Tom Lane f26b91761b Arrange for indexes and toast tables to inherit their ownership from
the parent table, even if the command that creates them is executed by
someone else (such as a superuser or a member of the owning role).
Per gripe from Michael Fuhr.
2005-08-26 03:08:15 +00:00
Tom Lane 09a6c90945 Fix bogus freeaddrinfo() call in WIN32 code, extend gai_strerror to
cover more error codes.  Per Petr Jelinek.
2005-08-25 17:51:01 +00:00
Tom Lane 1a33436224 Replace out-of-line tas() assembly code for MIPS with a properly
constrained GCC inline version.  Thiemo Seufer, by way of Martin Pitt.
2005-08-25 17:17:10 +00:00
Tom Lane 2613b74785 Factor out the common subexpression month_remainder * DAYS_PER_MONTH
in interval_mul and interval_div.  This avoids an optimization bug
in A Certain Company's compiler (and given their explanation, I wouldn't
be surprised if other compilers blow it too).  Besides the code seems
more clear this way --- in the original formulation, you had to mentally
recognize the common subexpression in order to understand what was going
on.
2005-08-25 05:01:43 +00:00
Bruce Momjian ca4cf09232 Back out pfrees for justify_hour function calls. 2005-08-25 03:53:22 +00:00
Tom Lane 15df139a8c Original assumption that our own getaddrinfo routine would never support
IPv6 is obsoleted by recent Windows patch.  Perform the runtime test
whenever HAVE_IPV6 is set.  This should be OK since initdb can get
getaddrinfo from libpgport if needed.
2005-08-25 02:22:59 +00:00
Bruce Momjian 4ea18a11fa Fix memory leak when using justify_hours. 2005-08-25 01:30:06 +00:00
Bruce Momjian ded5dd6ed0 Update release checklist. 2005-08-25 00:30:10 +00:00
Tom Lane c3bf8dee0e Add code to use Windows getaddrinfo and friends if they exist. This
has to be tested dynamically if we want to make portable executables.
Chuck McDevitt and Andrew Dunstan.
2005-08-24 22:13:23 +00:00
Tom Lane 41bb3cb7c9 Back off allow_nonpic_in_shlib for FreeBSD builds: only set it on i386.
This might be overly conservative, but we know it does not work on amd64.
Per buildfarm results.
2005-08-24 20:20:38 +00:00
Bruce Momjian 63a67221a1 More beta1 cleanup. 2005-08-24 19:34:34 +00:00
Tom Lane 83ba41f02b Fix SHOW and RESET grammar to accept custom variable names. 2005-08-24 19:34:12 +00:00
Tom Lane 06f4a53941 Make the plperl regression tests pass in 'use_strict' mode, by adding
'my' where appropriate.  Michael Fuhr
2005-08-24 19:24:54 +00:00
Tom Lane 6f64cf592b Get rid of inappropriate use of croak(). Per report from Michael Fuhr. 2005-08-24 19:06:28 +00:00
Tom Lane a62604508f Fix up plperl 'use_strict' so that it can be enabled or disabled on the
fly.  Fix problem with incompletely duplicated setup code.  Andrew Dunstan,
from an idea of Michael Fuhr's.
2005-08-24 18:16:58 +00:00
Tom Lane 767a9021b3 Add small hack to support use of Unicode-based locales on WIN32. This
is not adequately tested yet, but let's get it into beta1 so it can be
tested.  Magnus Hagander and Tom Lane.
2005-08-24 17:50:00 +00:00
Tom Lane a0a0bc02b7 Fix ExecBRDeleteTriggers so that deletion is not suppressed when delete
triggers exist but are all disabled.  Problem noted by Gavin Sherry in
original discussion of enable/disable trigger patch, but was never
addressed.
2005-08-24 17:38:35 +00:00
Michael Meskes f417ebf03a - Check for NULL before checking whether argument is an array.
- Remove stary character from string quoting.
        - Fixed check to report missing varchar pointer implementation.
2005-08-24 10:34:19 +00:00
Tom Lane 188c7c8ccf Add ALTER TABLE ENABLE/DISABLE TRIGGER commands. Change pg_dump to
use these instead of its previous hack of changing pg_class.reltriggers.
Documentation is lacking, will add that later.
Patch by Satoshi Nagayasu, review and some extra work by Tom Lane.
2005-08-23 22:40:47 +00:00
Bruce Momjian 9cf18ee386 Add new file for win32 threading. 2005-08-23 21:11:22 +00:00
Bruce Momjian 43bf3a6bc6 The attached patch updates the thread test program to run stand-alone on
Windows. The test itself is bypassed in configure as discussed, and
libpq has been updated appropriately to allow it to build in thread-safe
mode.

Dave Page
2005-08-23 21:02:05 +00:00
Tom Lane e331404da5 Clean up some very old and crufty code for TID scan planning. Not much
functional difference really, but make use of stuff added to the planner
since this code was touched last.
2005-08-23 20:49:47 +00:00
Bruce Momjian a970a8cb95 Back out incorrect commit. 2005-08-23 20:48:47 +00:00
Bruce Momjian eef7e30cc1 Fix function name. 2005-08-23 20:45:11 +00:00
Tom Lane 0f455b346e Fix broken lrand48() implementation, per Merlin Moncure. 2005-08-23 13:31:11 +00:00
Tom Lane 5f8b22c20d Fix wrong dependency on owner created by ALTER OPCLASS OWNER.
Per Alvaro.
2005-08-23 01:41:30 +00:00
Tom Lane 9052537325 Rewrite gather-write patch into something less obviously bolted on
after the fact.  Fix bug with incorrect test for whether we are at end
of logfile segment.  Arrange for writes triggered by XLogInsert's
is-cache-more-than-half-full test to synchronize with the cache boundaries,
so that in long transactions we tend to write alternating halves of the
cache rather than randomly chosen portions of it; this saves one more
write syscall per cache load.
2005-08-22 23:59:04 +00:00
Bruce Momjian 9bddb5c8c7 Back out incorrect use of E'' escape addition. 2005-08-22 20:25:03 +00:00
Tom Lane 83357da684 Cause ALTER INDEX OWNER to generate a warning and do nothing, rather than
erroring out as it has done for the last couple weeks.  Document that this
form is now ignored because indexes can't usefully have different owners
from their parent tables.  Fix pg_dump to not generate ALTER OWNER commands
for indexes.
2005-08-22 19:40:37 +00:00
Tom Lane bf1e33d24a Fix unwanted denial of ALTER OWNER rights to superusers. There was some
discussion of getting around this by relaxing the checks made for regular
users, but I'm disinclined to toy with the security model right now,
so just special-case it for superusers where needed.
2005-08-22 17:38:20 +00:00
Bruce Momjian a7f49252d2 enable_constraint_exclusion => constraint_exclusion
Also improve wording.
2005-08-22 17:35:03 +00:00
Bruce Momjian 8ad3965a11 Improve xid wraparound message (the server isn't really shut down, just
not accepting queries).

         errmsg("database is not accepting queries to avoid
	 wraparound data loss in database \"%s\"",
         errhint("Stop the postmaster and use a standalone
	 backend to VACUUM database \"%s\".",
2005-08-22 16:59:47 +00:00
Tom Lane f88e8070b7 Use an initdb-time test to see if the local version of getaddrinfo()
chokes on IPv6 addresses, and comment out the IPv6 entry in the default
pg_hba.conf if so.  Per Andrew Dunstan.
2005-08-22 16:27:36 +00:00
Tom Lane d0096a41fa Fix some inconsistent choices of datatypes in xlog.c. Make buffer
indexes all be int, rather than variously int, uint16 and uint32;
add some casts where necessary to support large buffer arrays.
2005-08-22 00:41:28 +00:00
Tom Lane 6fcaaf29da Minor GUC cleanups: document krb_server_hostname and custom_variable_classes
in postgresql.conf.sample, mark custom_variable_classes as SIGHUP not
POSTMASTER to agree with the documentation (I can't see a reason it has
to be POSTMASTER so I think the docs are right).
2005-08-21 03:39:37 +00:00
Tom Lane f39f6b500f Seems that the childXids list would be better based on Oid lists than
integer lists.
2005-08-20 23:45:08 +00:00
Tom Lane 0007490e09 Convert the arithmetic for shared memory size calculation from 'int'
to 'Size' (that is, size_t), and install overflow detection checks in it.
This allows us to remove the former arbitrary restrictions on NBuffers
etc.  It won't make any difference in a 32-bit machine, but in a 64-bit
machine you could theoretically have terabytes of shared buffers.
(How efficiently we could manage 'em remains to be seen.)  Similarly,
num_temp_buffers, work_mem, and maintenance_work_mem can be set above
2Gb on a 64-bit machine.  Original patch from Koichi Suzuki, additional
work by moi.
2005-08-20 23:26:37 +00:00
Tom Lane 2299ceab1c Invoke mksafefunc and mkunsafefunc with :: decoration. This seems a good
idea on consistency grounds, whether or not it really fixes bug #1831.
Michael Fuhr
2005-08-20 19:19:21 +00:00
Tatsuo Ishii ba2fc7eb4b Make GetMultiXactIdMembers() a public function. 2005-08-20 01:29:27 +00:00
Tatsuo Ishii bc3991c185 Add BackendXidGetPid(). 2005-08-20 01:26:36 +00:00
Tom Lane f57e3f4cf3 Repair problems with VACUUM destroying t_ctid chains too soon, and with
insufficient paranoia in code that follows t_ctid links.  (We must do both
because even with VACUUM doing it properly, the intermediate state with
a dangling t_ctid link is visible concurrently during lazy VACUUM, and
could be seen afterwards if either type of VACUUM crashes partway through.)
Also try to improve documentation about what's going on.  Patch is a bit
bulky because passing the XMAX information around required changing the
APIs of some low-level heapam.c routines, but it's not conceptually very
complicated.  Per trouble report from Teodor and subsequent analysis.
This needs to be back-patched, but I'll do that after 8.1 beta is out.
2005-08-20 00:40:32 +00:00
Bruce Momjian 97bb6e89be Fix LRU/ALL description mismatch for GUC parameter. 2005-08-19 18:58:18 +00:00
Bruce Momjian 0c7786bdfc Consistently align comments in postgresql.conf, move some slightly to
the right to stand out.
2005-08-19 01:55:18 +00:00
Tom Lane 77b4bd3b43 Update some obsolete comments --- code is using t_self now, not t_ctid. 2005-08-18 21:34:20 +00:00
Tom Lane dfdf07aab1 Fix up LIMIT/OFFSET planning so that we cope with non-constant LIMIT
or OFFSET clauses by using estimate_expression_value().  The main advantage
of this is that if the expression is a Param and we have a value for the
Param, we'll use that value rather than defaulting.  Also, fix some
thinkos in the logic for combining LIMIT/OFFSET with an externally
supplied tuple fraction (this covers cases like EXISTS(...LIMIT...)).
And make sure the results of all this are shown by EXPLAIN.  Per a
gripe from Merlin Moncure.
2005-08-18 17:51:12 +00:00
Bruce Momjian 7be1b3ba74 Add hint for to_char(interval) invalid format specifications. 2005-08-18 13:43:08 +00:00
Bruce Momjian e20261128d Fix to_char(interval) to return proper year and century values.
Fix to_char(interval) to return large year/month/day/hour values that
are larger than possible timestamp values.
Prevent to_char(interval) format specifications that make no sense, like
Month.
Clean up formatting.c code to more logically handle return lengths.
2005-08-18 04:37:08 +00:00
Tom Lane f8d0a82bf9 Avoid an Assert failure if OuterUserId hasn't been set yet during
AbortTransaction.  This can happen if a backend's InitPostgres transaction
fails (eg, because the given username is invalid).  Per Alvaro.
2005-08-17 22:14:34 +00:00
Bruce Momjian 63f850cd4d More formatting.c cleanups. 2005-08-17 22:06:53 +00:00
Bruce Momjian 9cd3fb172d Small cleanup. 2005-08-17 21:54:50 +00:00
Bruce Momjian 420fc28ac5 Adjust to_char/from_char code to use boolean "is_to_char" rather than
integer with flags.
2005-08-17 21:47:55 +00:00
Tom Lane ff15b3dac5 Fix declaration of dumpacl, per Alvaro. 2005-08-17 19:45:51 +00:00
Bruce Momjian 28d0515d18 Fix FSM warning to mention increasing max_fsm_pages. Was incorrectly
max_fsm_relations.
2005-08-17 03:50:59 +00:00
Bruce Momjian 26b9dcb640 Minor cleanup. 2005-08-17 01:45:20 +00:00
Bruce Momjian e19e382804 Update comments. 2005-08-16 19:29:38 +00:00
Bruce Momjian e7fb5563af Improve comment. 2005-08-16 19:23:31 +00:00
Bruce Momjian f2ad4cadbf Update pgcvslog comment on how to find branch start time.
Run autoconf/autoheader in case someone forgot in the past.
2005-08-16 17:46:57 +00:00
Tom Lane 6629bc79f1 Reject operator names >= NAMEDATALEN characters. These will not work
anyway, and in assert-enabled builds you are likely to get an assertion
failure.  Backpatch as far as 7.3; 7.2 seems not to have the problem.
2005-08-16 00:48:12 +00:00
Bruce Momjian 070a3ad76b Rename pg_stat_file columns to be more consistent. Split apart change
and creation columns to behave for Unix or Win32.
2005-08-15 23:00:14 +00:00
Tom Lane 24bd9447ac Clean up recent patch for PL handler functions in pg_catalog: the patch
caused PL languages and handlers to be dumped ALWAYS, even in the face
of contrary --schema or --table switches.  Adopt a slightly saner
definition.
2005-08-15 21:50:15 +00:00
Tom Lane 9a9328003d Make createlang and droplang proof against weird search_path settings
by forcing search_path to be just pg_catalog.
2005-08-15 21:02:26 +00:00
Tom Lane 866ffc2fe3 array_in() and array_recv() need to be more paranoid about validating
their OID parameter.  It was possible to crash the backend with
select array_in('{123}',0,0); because that would bypass the needed step
of initializing the workspace.  These seem to be the only two places
with a problem, though (record_in and record_recv don't have the issue,
and the other array functions aren't depending on user-supplied input).
Back-patch as far as 7.4; 7.3 does not have the bug.
2005-08-15 19:40:20 +00:00
Tom Lane 87808aef05 Allow the pgstat views to show toast tables as well as regular tables
(the stats system has always collected this info, but the views were
filtering it out).  Modify autovacuum so that over-threshold activity
in a toast table can trigger a VACUUM of the parent table, even if the
parent didn't appear to need vacuuming itself.  Per discussion a month
or so back about "short, wide tables".
2005-08-15 16:25:19 +00:00
Tom Lane 2498d8296e Clean up some stray remaining references to pg_shadow, pg_user, pg_group. 2005-08-15 02:40:36 +00:00
Tom Lane f590ed12f6 Change pg_dump to use pg_roles instead of pg_user on 8.1 and up,
so that it will correctly dump owners of objects owned by non-login roles.
2005-08-15 02:36:30 +00:00
Peter Eisentraut bf86bacb2c Change standard_compliant_strings to standard_conforming_strings. 2005-08-14 22:19:50 +00:00
Tom Lane 8ae0d476a9 Update the createuser utility for the ROLEs world. Alvaro Herrera 2005-08-14 20:16:03 +00:00
Tom Lane e36de18191 Fix psql's \d commands to use pg_roles instead of pg_user, so that
they don't miss owners that are NOLOGIN.
2005-08-14 19:20:45 +00:00
Tom Lane 84ccf7212c Fix up tab completion for ROLEs and add some more completion logic for
other stuff; change \du and \dg to be role-aware (Stefan Kaltenbrunner).
Also make tab completion fetch the list of GUC variables from pg_settings
instead of having a hard-wired copy of the list (Tom Lane).
2005-08-14 18:49:30 +00:00
Tom Lane f60d176a5e Tweak catalog cache management algorithms to reduce cost of
SearchCatCacheList and ReleaseCatCacheList.  Previously, we incremented
and decremented the refcounts of list member tuples along with the list
itself, but that's unnecessary, and very expensive when the list is big.
It's cheaper to change only the list refcount.  When we are considering
deleting a cache entry, we have to check not only its own refcount but
its parent list's ... but it's easy to arrange the code so that this
check is not made in any commonly-used paths, so the cost is really nil.
The bigger gain though is to refrain from DLMoveToFront'ing each individual
member tuple each time the list is referenced.  To keep some semblance
of fair space management, lists are just marked as used or not since the
last cache cleanout search, and we do a MoveToFront pass only when about
to run a cleanout.  In combination, these changes reduce the costs of
SearchCatCacheList and ReleaseCatCacheList from about 4.5% of pgbench
runtime to under 1%, according to my gprof results.
2005-08-13 22:18:07 +00:00
Tom Lane 2af9a44fa9 Make pg_stat_file() use OUT parameters so that the user doesn't have to
remember the output parameter set for himself.  It's a bit of a kluge
but fixing array_in to work in bootstrap mode looks worse.
I removed the separate pg_file_length() function, as it no longer has any
real notational advantage --- you can write (pg_stat_file(...)).length.
2005-08-13 19:02:34 +00:00
Bruce Momjian f810cfb291 Disable strtoul() ERANGE check on Win32, because it isn't thread safe,
and it isn't really required.
2005-08-13 01:34:30 +00:00
Bruce Momjian 27639809d2 Reverse out Assert addition. 2005-08-12 23:13:54 +00:00
Tom Lane 59c016aa9f Pass the type OID as the typioparam for all non-array types, rather than
only composite types as we did in 8.0.  Per discussion with Martijn
van Oosterhout.
2005-08-12 21:49:47 +00:00
Bruce Momjian bb2ffe9acf Back out plpython makefile change. 2005-08-12 21:44:51 +00:00
Bruce Momjian fab177e64f Improve documention on loading large data sets into plperl.
David Fetter
2005-08-12 21:42:53 +00:00
Bruce Momjian ed63689b43 This patch fixes the event type used to log output from the
stderr-in-service or output-from-syslogger-in-service code. Previously
everything was flagged as ERRORs there, which caused all instances to
log "LOG: logger shutting down" as error...

Please apply for 8.1. I'd also like it considered for 8.0 since logging
non-errors as errors can be cause for alarm amongst people who actually
look at their logs...

Magnus Hagander
2005-08-12 21:36:59 +00:00
Tom Lane 65790b9e01 Un-break plperl for non-set case. 2005-08-12 21:26:32 +00:00