Commit Graph

15132 Commits

Author SHA1 Message Date
Tom Lane 1e6201a22c Add an expected case to cover error message as spelled by python 2.2.3.
Per buildfarm results and Michael Fuhr.
2005-10-04 02:50:04 +00:00
Tom Lane 060d13f7c7 COPY's test for read-only transaction was backward; it prohibited COPY TO
where it should prohibit COPY FROM.  Found by Alon Goldshuv.
2005-10-03 23:43:09 +00:00
Tom Lane 53e47cdd79 Add a trace_sort option to help with measuring resource usage of external
sort operations.  Per recent discussion.  Simon Riggs and Tom Lane.
2005-10-03 22:55:56 +00:00
Tom Lane 12992ab37a Separate out the VacRUsage stuff as an independent module, in preparation
for using it for other things besides VACUUM.
2005-10-03 22:52:26 +00:00
Tom Lane f20cad7870 Preserve tuple OIDs during ATRewriteTable. Per gripe from Duncan Crombie. 2005-10-03 02:45:12 +00:00
Tom Lane 64eea6c21d Expand pg_control information so that we can verify that the database
was created on a machine with alignment rules and floating-point format
similar to the current machine.  Per recent discussion, this seems like
a good idea with the increasing prevalence of 32/64 bit environments.
2005-10-03 00:28:43 +00:00
Tom Lane aa731ed843 Change nextval and other sequence functions to specify their sequence
argument as a 'regclass' value instead of a text string.  The frontend
conversion of text string to pg_class OID is now encapsulated as an
implicitly-invocable coercion from text to regclass.  This provides
backwards compatibility to the old behavior when the sequence argument
is explicitly typed as 'text'.  When the argument is just an unadorned
literal string, it will be taken as 'regclass', which means that the
stored representation will be an OID.  This solves longstanding problems
with renaming sequences that are referenced in default expressions, as
well as new-in-8.1 problems with renaming such sequences' schemas or
moving them to another schema.  All per recent discussion.
Along the way, fix some rather serious problems in dbmirror's support
for mirroring sequence operations (int4 vs int8 confusion for instance).
2005-10-02 23:50:16 +00:00
Tom Lane 1b61ee3c69 _SPI_execute_plan failed to return result tuple table to caller in
the ProcessUtility case, resulting in an intratransaction memory leak
if a utility command actually did return any tuples, as reported by
Dmitry Karasik.  Fix this and also make the behavior more consistent
for cases involving nested SPI operations and multiple query trees,
by ensuring that we store the state locally until it is ready to be
returned to the caller.
2005-10-01 18:43:19 +00:00
Peter Eisentraut b4a7213b07 Equalize wordings to avoid redundant translation work. 2005-09-30 09:56:26 +00:00
Peter Eisentraut e5c453edce Clean up the help displays. 2005-09-30 07:58:01 +00:00
Peter Eisentraut 7df9f55f4b Change the option spelling to --connection-limit to be consistent with the
SQL option spelling.
2005-09-30 07:13:54 +00:00
Alvaro Herrera a7084efd2d Fix confusion between relfilenode and Oid.
Also, make pg_total_relation_size include the size of the
TOAST index.
2005-09-29 22:04:36 +00:00
Peter Eisentraut 8928d4d69d Correct spelling 2005-09-29 08:34:50 +00:00
Tom Lane 2e1254e7fa Repair planning bug introduced in 7.4: outer-join ON clauses that referenced
only the inner-side relation would be considered as potential equijoin clauses,
which is wrong because the condition doesn't necessarily hold above the point
of the outer join.  Per test case from Kevin Grittner (bug#1916).
2005-09-28 21:17:02 +00:00
Peter Eisentraut 1c25594549 Improve messages 2005-09-28 13:11:26 +00:00
Tom Lane 1610fcc351 Some marginal tweaks to make 'make installcheck' mostly work when
building contrib with USE_PGXS.  To make it work all the way, the
pg_regress script would need to be included in the installation tree.
2005-09-27 17:43:31 +00:00
Tom Lane 4fc935a5d4 Fix problems with PGXS builds against an installation tree that was
relocated after installation.  We can't trust the installation paths
inserted into Makefile.global by configure, so instead we must get the
paths from pg_config.  This requires extending pg_config to support all
the separately-configurable path names, but that was on TODO anyway.
2005-09-27 17:39:35 +00:00
Bruce Momjian e2d8b79f8b Suppress FAQ and TODO changes in pgcvslog output. 2005-09-27 17:16:08 +00:00
Tom Lane 0b36cb83dc PGXS should be set with := not =, as specified in the documentation,
to avoid useless multiple executions of pg_config.
2005-09-27 17:13:14 +00:00
Bruce Momjian 8ddd22f245 Fix incorrect psql \x memory allocation for numericlocale. Redesign API
to be less error-prone.
2005-09-27 16:30:25 +00:00
Tom Lane 3772975f30 Fix our version of strdup() to adhere to the standard semantics for
out-of-memory --- that is, return NULL rather than dumping core.
Noted by Qingqing Zhou.
2005-09-27 04:53:23 +00:00
Bruce Momjian c23240ecbe Rename variable for clarity. 2005-09-26 18:09:57 +00:00
Peter Eisentraut 7fe1f9a2c2 Don't need gettext calls around debug messages. 2005-09-26 17:49:09 +00:00
Bruce Momjian 72739020c2 Log protocol-excute fetch operatation as fetch, rather than execute,
adjusted from a patch by Simon.
2005-09-26 15:51:12 +00:00
Tom Lane e990b9ce23 The original patch to avoid building a hash join's hashtable when the
outer relation is empty did not work, per test case from Patrick Welche.
It tried to use nodeHashjoin.c's high-level mechanisms for fetching an
outer-relation tuple, but that code expected the hash table to be filled
already.  As patched, the code failed in corner cases such as having no
outer-relation tuples for the first hash batch.  Revert and rewrite.
2005-09-25 19:37:35 +00:00
Tom Lane 303e089df5 Clean up possibly-uninitialized-variable warnings reported by gcc 4.x. 2005-09-24 22:54:44 +00:00
Tom Lane 8889685555 Suppress signed-vs-unsigned-char warnings. 2005-09-24 17:53:28 +00:00
Tom Lane 54a8af058e In a machine where INT64_IS_BUSTED, we can only support 32-bit values
for int8 and related types.  However we might be talking to a client
that has working int64; so pq_getmsgint64 really needs to check the
incoming value and throw an overflow error if we can't represent it
accurately.
2005-09-24 15:34:07 +00:00
Bruce Momjian 9f53cfd9db Add comments explaining clauses used by CREATE ROLE but not ALTER. 2005-09-23 22:25:25 +00:00
Tom Lane 06d70d78a4 Fix typo in comment. 2005-09-23 15:36:57 +00:00
Tom Lane d7e4fd99e5 Fix bug introduced into indexable_outerrelids() by an ill-considered
"optimization".  When we find a potentially useful joinclause, we
have to add all its other required_relids to the result, not only the
other clause_relids.  They are different in the case of a joinclause
whose applicability has to be postponed due to outer join.  We have
to include the extra rels because otherwise, after best_inner_indexscan
masks the join rels with index_outer_relids, it will always fail to
find the joinclause as applicable.  Per report from Husam Tomeh.
2005-09-22 23:25:07 +00:00
Bruce Momjian a5b9e18acc Add instructions. 2005-09-22 21:59:50 +00:00
Bruce Momjian 5d075bb4cc Add "codelines" script to compute number of lines in a releaes. 2005-09-22 21:58:58 +00:00
Bruce Momjian b3364fc81b pgindent new GIST index code, per request from Tom. 2005-09-22 20:44:36 +00:00
Tom Lane 08817bdb76 Adjust GiST error messages to conform to message style guidelines. 2005-09-22 18:49:45 +00:00
Tom Lane a453951dd9 Take exclusive buffer lock in scan_heap() to eliminate some corner cases
in which invalid page data could be transiently written to disk by
concurrent bgwriter activity.  There doesn't seem any risk of loss of
actual user data, but an empty page could possibly be left corrupt if a
crash occurs before the correct data gets written out.  Pointed out by
Alvaro Herrera.
2005-09-22 17:32:58 +00:00
Bruce Momjian 4f915cd377 This patch cleans up the access to members of ItemIdData.
It uses existing macros instead of touching directly.

ITAGAKI Takahiro
2005-09-22 16:46:00 +00:00
Bruce Momjian d7a06c2ac8 Fix psql \x by removing puts().
Greg Sabino Mullane
2005-09-22 15:51:51 +00:00
Bruce Momjian a3b9c6988d Suppress port number for unix domain sockets in log connect/disconnect
messages.
2005-09-22 15:33:36 +00:00
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