Commit Graph

14170 Commits

Author SHA1 Message Date
Neil Conway fe7015f5e8 Change the return value of HeapTupleSatisfiesUpdate() to be an enum,
rather than an integer, and fix the associated fallout. From Alvaro
Herrera.
2005-03-20 23:40:34 +00:00
Tom Lane 9e0dd84596 On Windows, use QueryPerformanceCounter instead of gettimeofday for
EXPLAIN ANALYZE instrumentation.  Magnus Hagander
2005-03-20 22:27:52 +00:00
Tom Lane 354049c709 Remove unnecessary calls of FlushRelationBuffers: there is no need
to write out data that we are about to tell the filesystem to drop.
smgr_internal_unlink already had a DropRelFileNodeBuffers call to
get rid of dead buffers without a write after it's no longer possible
to roll back the deleting transaction.  Adding a similar call in
smgrtruncate simplifies callers and makes the overall division of
labor clearer.  This patch removes the former behavior that VACUUM
would write all dirty buffers of a relation unconditionally.
2005-03-20 22:00:54 +00:00
Bruce Momjian 683f60da3d Add mention of why malloc() has to be used in snprintf.c. 2005-03-20 13:54:53 +00:00
Bruce Momjian 8c72526fe9 Department of second thoughts. Remove FRONTEND from snprintf.c because
snprintf is called before the memory system is started.  We have to just
malloc/free.  There are no elogs in the code so we should be fine.
2005-03-20 03:53:39 +00:00
Bruce Momjian 169adfcf74 Fix typo in Makefile. 2005-03-20 02:44:45 +00:00
Bruce Momjian 83ebbfac75 Another change for FRONTEND snprintf.c. 2005-03-20 02:40:28 +00:00
Bruce Momjian 614fcbeba7 Mark snprintf.c as a file that uses FRONTEND and needs to a version in
the server-side port library.  Somehow I missed that change when I added
memory allocation to snprintf.c.
2005-03-20 02:39:33 +00:00
Tom Lane 91728fa26c Add temp_buffers GUC variable to allow users to determine the size
of the local buffer arena for temporary table access.
2005-03-19 23:27:11 +00:00
Tom Lane d65522aeb6 Upgrade localbuf.c to use a hash table instead of linear search to
find already-allocated local buffers.  This is the last obstacle
in the way of setting NLocBuffer to something reasonably large.
2005-03-19 17:39:43 +00:00
Tom Lane 2e629080f7 Put 'dump complete' message in the right place, so it comes out where
it's supposed to when --file option is used.
2005-03-18 17:32:55 +00:00
Tom Lane 88164799ce Need to reset local buffer pin counts, not only shared buffer pins,
before we attempt any file deletions in ShutdownPostgres.  Per Tatsuo.
2005-03-18 16:16:09 +00:00
Michael Meskes 1f418555cf Added patch by Christof Petig <christof@petig-baender.de> to work around gcc bug on powerpc and amd64. 2005-03-18 10:00:43 +00:00
Tom Lane cef01c3355 Avoid infinite loop in InvalidateBuffer if we ourselves are holding
a pin on the victim buffer.
2005-03-18 05:25:23 +00:00
Tom Lane afb66ad8dd Need to release buffer pins before attempting to drop files during
backend exit.  Per report from Bruce.
2005-03-18 05:24:13 +00:00
Tom Lane 7a969cad2e Treat EPERM as a non-error case when checking to see if old postmaster
is still alive.  This improves our odds of not getting fooled by an
unrelated process when checking a stale lock file.  Other checks already
in place, plus one newly added in checkDataDir(), ensure that we cannot
attempt to usurp the place of a postmaster belonging to a different userid,
so there is no need to error out.  Add comments indicating the importance
of these other checks.
2005-03-18 03:48:49 +00:00
Neil Conway d344505d1b This patch moves some code for preprocessing FOR UPDATE from
grouping_planner() to preprocess_targetlist(), according to a comment
in grouping_planner(). I think the refactoring makes sense, and moves
some extraneous details out of grouping_planner().
2005-03-17 23:45:09 +00:00
Tom Lane 57fdb2b0d8 Update obsolete comment. 2005-03-17 15:25:51 +00:00
Neil Conway 72cbc5982d Trivial comment tweak. 2005-03-17 05:47:01 +00:00
Bruce Momjian 7111a14fba Factor duplicate snprintf code into functions. 2005-03-17 03:18:14 +00:00
Neil Conway d663d3ba3a This patch makes \d on tables and views sort fk constraints, triggers
and rules alphabetically in the output.  This makes it the same as
for indexes and stops the irritating random or reverse ordering it
currently has.

Chris KL
2005-03-16 23:52:18 +00:00
Bruce Momjian f402125926 Force initdb cause of encoding additions. 2005-03-16 22:59:42 +00:00
Tom Lane f97aebd162 Revise TupleTableSlot code to avoid unnecessary construction and disassembly
of tuples when passing data up through multiple plan nodes.  A slot can now
hold either a normal "physical" HeapTuple, or a "virtual" tuple consisting
of Datum/isnull arrays.  Upper plan levels can usually just copy the Datum
arrays, avoiding heap_formtuple() and possible subsequent nocachegetattr()
calls to extract the data again.  This work extends Atsushi Ogawa's earlier
patch, which provided the key idea of adding Datum arrays to TupleTableSlots.
(I believe however that something like this was foreseen way back in Berkeley
days --- see the old comment on ExecProject.)  A test case involving many
levels of join of fairly wide tables (about 80 columns altogether) showed
about 3x overall speedup, though simple queries will probably not be
helped very much.

I have also duplicated some code in heaptuple.c in order to provide versions
of heap_formtuple and friends that use "bool" arrays to indicate null
attributes, instead of the old convention of "char" arrays containing either
'n' or ' '.  This provides a better match to the convention used by
ExecEvalExpr.  While I have not made a concerted effort to get rid of uses
of the old routines, I think they should be deprecated and eventually removed.
2005-03-16 21:38:10 +00:00
Bruce Momjian 712f053587 Add sprintf support, that were were missing.
Add support for snprintf '+', 'h', and %* length settings.
2005-03-16 21:27:23 +00:00
Bruce Momjian ca66797308 pgindent snprintf.c for consistency. 2005-03-16 15:12:18 +00:00
Bruce Momjian 2306f63dea Fix snprintf for %*$. 2005-03-16 15:11:43 +00:00
Bruce Momjian fb7d212fbe Add CVS \r\n regression tests.
Andrew Dunstan
2005-03-16 06:05:53 +00:00
Bruce Momjian 888271ed15 Fix snprintf to handle %$ properly by storing and reordering the
arguments.

Nicolai Tufar
2005-03-16 06:00:58 +00:00
Bruce Momjian 83e87e6f2e Add missing include for new lc_ctype_is_c() function.
Per Neil.
2005-03-16 01:49:10 +00:00
Bruce Momjian 494f30c953 Prevent locale-aware handling of upper, lower, and initcap when the
locale is C.

Backpatch to 8.0.X because some operating systems were throwing errors
for such operations, rather than ignoring the locale when it was C.
2005-03-16 00:02:49 +00:00
Neil Conway 963ffe4cc4 Wrap the implementation of fork_process() inside #ifndef WIN32 -- this
should hopefully unbreak the Win32 build. Apologies for breaking it in
the first place.
2005-03-16 00:02:39 +00:00
Bruce Momjian 2c4dea126a Issue free space notices to both the user and the server log file. 2005-03-14 20:15:09 +00:00
Tom Lane 28bcc344b5 Make pg_dump emit a useful error message, instead of just dumping core,
if it finds a pg_rewrite entry for which there is no pg_class entry.
Per report from Andrew Slobodyanyk.
2005-03-14 18:57:33 +00:00
Bruce Momjian e7fb9f18bf Add support for Win1252 encoding.
Roland Volkmann
2005-03-14 18:31:25 +00:00
Bruce Momjian 2b0bb797ec Bump minor version numbers for 8.1 compared to 8.0. 2005-03-14 17:27:50 +00:00
Tom Lane a9b05bdc83 Avoid O(N^2) overhead in repeated nocachegetattr calls when columns of
a tuple are being accessed via ExecEvalVar and the attcacheoff shortcut
isn't usable (due to nulls and/or varlena columns).  To do this, cache
Datums extracted from a tuple in the associated TupleTableSlot.
Also some code cleanup in and around the TupleTable handling.
Atsushi Ogawa with some kibitzing by Tom Lane.
2005-03-14 04:41:13 +00:00
Neil Conway c069655441 Allow ALTER FUNCTION to change a function's strictness, volatility, and
whether or not it is a security definer. Changing a function's strictness
is required by SQL2003, and the other capabilities make sense. Also, allow
an optional RESTRICT noise word to be specified, for SQL conformance.

Some trivial regression tests added and the documentation has been
updated.
2005-03-14 00:19:37 +00:00
Bruce Momjian 41e2a80f57 Update comments for new encoding names. 2005-03-14 00:19:13 +00:00
Tom Lane bb4c88c29a Add missing identification comment, remove entirely inappropriate include
of postgres.h.
2005-03-13 23:32:26 +00:00
Tom Lane db5ea2c5cb Add some missing #includes. 2005-03-13 23:27:38 +00:00
Tom Lane dffbbb3e55 Forgot that I had intended to replace division by masking in hash calculation. 2005-03-13 19:59:40 +00:00
Neil Conway ff02d0a052 Make default_with_oids default to false -- user-created tables will now
no longer include OIDs, unless WITH OIDS is specified or the
default_with_oids configuration parameter is enabled. Update the docs
accordingly.
2005-03-13 09:36:31 +00:00
Neil Conway 9423383748 Update obsolete comment. 2005-03-13 05:19:26 +00:00
Bruce Momjian ee1bd33dd0 Document aliases for our supported encodings.
Add a few encodings that were not documented.
2005-03-13 01:26:30 +00:00
Tom Lane 78a572bf0c When cloning template0 (or other fully-frozen databases), set the new
database's datallowconn and datfrozenxid to the current transaction ID
instead of copying the source database's values.  This is OK because we
assume the source DB contains no normal transaction IDs whatsoever.
This keeps VACUUM from immediately starting to complain about unvacuumed
databases in the situation where we are more than 2 billion transactions
out from the XID stamp of template0.  Per discussion with Milen Radev
(although his complaint turned out to be due to something else, but the
problem is real anyway).
2005-03-12 21:33:55 +00:00
Tom Lane c7bbe99452 Fix ALTER DATABASE RENAME to allow the operation if user is a superuser
who for some reason isn't marked usecreatedb.  Per report from Alexander
Pravking.  Also fix sloppy coding in have_createdb_privilege().
2005-03-12 21:11:50 +00:00
Tom Lane fa5e44017a Adjust the API for aggregate function calls so that a C-coded function
can tell whether it is being used as an aggregate or not.  This allows
such a function to avoid re-pallocing a pass-by-reference transition
value; normally it would be unsafe for a function to scribble on an input,
but in the aggregate case it's safe to reuse the old transition value.
Make int8inc() do this.  This gets a useful improvement in the speed of
COUNT(*), at least on narrow tables (it seems to be swamped by I/O when
the table rows are wide).  Per a discussion in early December with
Neil Conway.  I also fixed int_aggregate.c to check this, thereby
turning it into something approaching a supportable technique instead
of being a crude hack.
2005-03-12 20:25:06 +00:00
Bruce Momjian 5fdd9418ee Handle carriage returns and line feeds in COPY CSV mode.
Andrew Dunstan
2005-03-12 05:41:34 +00:00
Bruce Momjian 45905425a0 Add warning about the need to increase "max_fsm_relations" and
"max_fsm_relations" for vacuums.  Also improve VACUUM VERBOSE final
message text.

Ron Mayer
2005-03-12 05:21:52 +00:00
Bruce Momjian c82f76e1ac Fix snprintf() to properly handle precision specification for %f. 2005-03-12 04:00:56 +00:00