Commit Graph

13631 Commits

Author SHA1 Message Date
Bruce Momjian e9ec10494e Use <> not "" for include of pthread.h. 2004-09-26 01:40:55 +00:00
Tom Lane 09a893117a Repair bug that would allow libpq to think a command had succeeded when
it really hadn't, due to double output of previous command's response.
Fix prevents recursive entry to libpq routines.  Found by Jan Wieck.
2004-09-26 00:26:28 +00:00
Tom Lane 26b5d5317b Persuade plpython to build on OS X. 2004-09-24 20:08:42 +00:00
Tom Lane b120485f9c GUC assign hooks that look at external state in deciding whether a
setting is valid must ignore that state and permit the assignment anyway
when source is PGC_S_OVERRIDE.  Otherwise they may disallow a rollback
at transaction abort, which is The Wrong Thing.  Per example from
Michael Fuhr 12-Sep-04.
2004-09-24 19:43:03 +00:00
Neil Conway ae72283816 Cleanup some ancient Ultrix / Alpha code in main() that is intended to
modify how unaligned memory accesses are dealt with. Document that this
is really what is going on, and merge the NOFIXADE and NOPRINTADE code
paths.
2004-09-24 06:29:07 +00:00
Tom Lane 3331180bb4 shmdt takes a void* parameter, per Kris Jurka. 2004-09-24 05:27:35 +00:00
Tom Lane 00b821a11b Fix gratuitous weirdness in function prototype, per Kris Jurka. 2004-09-24 05:16:35 +00:00
Tom Lane 2f132ebff7 Okay, I'm tired of reading gripes from OS X users ... add a regression
variant file to cover OS X 10.3's bizarre minus-zero behavior.
2004-09-24 04:58:46 +00:00
Tom Lane 682598139e Get rid of /*-inside-comment warning. My fault. 2004-09-24 01:48:43 +00:00
Neil Conway be8eafa09d ExecProcAppend() wasn't called ExecAppend() because the latter name was
formerly used in execMain. Since that is no longer the case, this patch
renames ExecProcAppend() to ExecAppend() for the sake of consistency.
2004-09-24 01:36:37 +00:00
Tom Lane 409b38f514 Fix TAS assembly stuff for Solaris/386. (I'm not in a position to
actually test this, but it couldn't be broken any worse than it was...)
2004-09-24 00:21:32 +00:00
Tom Lane 688f0c56dc Fix ALTER TABLE OWNER to adjust the ownership of dependent sequences,
not only indexes.  Alvaro Herrera, with some kibitzing by Tom Lane.
2004-09-23 23:20:24 +00:00
Tom Lane fb147dc30e If we're going to print unrecognized result codes from SSL_get_error
in open_client_SSL, surely we should do it everywhere.  Also make
message formatting conform to style guide.
2004-09-23 20:27:50 +00:00
Bruce Momjian fb755b6dd4 This patch logs the error code in the default case, so that the user
stands a chance of looking it up.  "Unrecognised error" is always
disheartening.  :-)

Dominic Mitchell
2004-09-23 13:20:45 +00:00
Bruce Momjian 31ae87c332 This patch attempts to note the use of the root.crt file in the server.
Given that PostgreSQL will output a message complaining about it's
absence if you're using SSL mode, I feel it's important that it gets a
mention in the documentation at some point.

Dominic Mitchell
2004-09-23 13:16:02 +00:00
Neil Conway 6a84723d7d Minor tweak to pg_controldata usage information, per suggestion from
Dennis Björklund. Also, remove some redundant #include directives.
2004-09-23 00:47:44 +00:00
Tom Lane 9fcbe2af11 Arrange for hash join to skip scanning the outer relation if it detects
that the inner one is completely empty.  Per recent discussion.  Also some
cosmetic cleanups in nearby code.
2004-09-22 19:13:52 +00:00
Tom Lane 5d9f5c20dd Issue a CHECKPOINT just after creating the regression database. Without
this, it's hard to debug core-dump test failures, because WAL replay will
enthusiastically remove the core file (along with the rest of the
regression database directory).  Per recent discussion, not to mention
bitter experience.
2004-09-22 19:11:19 +00:00
Tom Lane bebaf70613 Adjust ExecMakeTableFunctionResult to produce a single all-nulls row
when a function that returns a single tuple (not a setof tuple) returns
NULL.  This seems to be the most consistent behavior.  It would have
taken a bit less code to make it return an empty table (zero rows) but
ISTM a non-SETOF function ought always return exactly one row.  Per
bug report from Ivan-Sun1.
2004-09-22 17:41:51 +00:00
Neil Conway b84788debc Minor cleanup of libpq/LO examples: fix some memory leaks, update a comment
or two.
2004-09-22 05:12:45 +00:00
Neil Conway a94edb4c7b Some improvements for the tab-completion of psql. This should
address all of the items in the todo list and adds some new
things as well. Specifically:

* Add support for ALTER SEQUENCE ...
* Add "RENAME TO" for ALTER TRIGGER xx ON yy
* Pick proper table for ALTER TRIGGER xx ON ...
* Support for ALTER USER xxx ...
* Fix ALTER GROUP xxx DROP ...
* Fix ALTER DOMAIN xxx DROP ...
* Remove "OWNER TO" from ALTER DOMAIN xx DROP ...
* Fix ALTER DOMAIN xx SET DEFAULT ..
* Prevent ALTER INDEX xxx SET TABLESPACE from using "TO"
* Support for ALTER LANGUAGE xxx (RENAME TO)
* More support for ALTER TABLE xxx ALTER COLUMN xxx ...
* More support for COPY

Greg Sabino Mullane
2004-09-22 04:25:16 +00:00
Neil Conway a3c53c834f This patch from Alvaro Herrera adds transaction ID to the list of
log_line_prefix escapes. The escape sequence used for this is %x.
%x previously meant "postmaster et al. stop here" -- this has been
renamed to %q.
2004-09-22 03:55:27 +00:00
Tom Lane 95f20b96d4 Rotate on time boundaries that are sensible per local time rather than GMT.
Also, avoid truncating the file we just wrote into, which might otherwise
easily happen at DST boundaries.  Ed L. and Tom Lane.
2004-09-21 00:21:25 +00:00
Tom Lane 6da0c439ee Change some of the existing plpgsql regression test cases so that they
exercise dollar quoting and named function parameters.  AFAICS we had
no tests of either feature before.
2004-09-20 23:00:12 +00:00
Tom Lane 5b564e5307 Fix some shortcomings in psql's autocommit-off mode concerning detection
of commands for which a transaction block should not be forced.  Recognize
VACUUM and other PreventTransactionChain commands; handle nested /* .. */
comments correctly; handle multibyte encodings correctly.
Michael Paesold with some kibitzing from Tom Lane.
2004-09-20 18:51:19 +00:00
Tom Lane 9332d0baba Documentation improvements, per Josh Berkus. 2004-09-20 17:53:59 +00:00
Peter Eisentraut fbbdfa413e Translation update 2004-09-20 08:15:29 +00:00
Peter Eisentraut 398d4822a4 Translation updates 2004-09-20 07:57:14 +00:00
Peter Eisentraut cb2a8a9e00 Translation updates 2004-09-20 07:49:54 +00:00
Peter Eisentraut fa942e8010 Translation updates 2004-09-20 07:44:42 +00:00
Tom Lane fa8eb8a726 Add defenses against plpython functions being declared to take or return
pseudotypes.  Not sure why I neglected to add these checks at the same
time I added them to the other PLs, but it seems I did.
2004-09-19 23:38:21 +00:00
Tom Lane 84c7cef5eb Fix estimate_num_groups to be able to use expression-index statistics
when there is an expressional index matching a GROUP BY item.
2004-09-18 19:39:50 +00:00
Peter Eisentraut 122016379d Move comment at end of line to a separate line so trailing tabs don't
become part of the make variable value.
2004-09-18 13:28:54 +00:00
Tom Lane 4b9d84d450 Fix memory leak in tokenize_file, per report from Vadim Passynkov. 2004-09-18 01:22:58 +00:00
Peter Eisentraut 152a101f2b Allow WIN1250 as server encoding. 2004-09-17 21:59:57 +00:00
Tom Lane a5713ec427 Hashed LEFT JOIN would miss outer tuples with no inner match if the join
was large enough to be batched and the tuples fell into a batch where
there were no inner tuples at all.  Thanks to Xiaoyu Wang for finding a
test case that exposed this long-standing bug.
2004-09-17 18:28:53 +00:00
Tom Lane 054b78ba38 Now that xmax and cmin are distinct fields again, we should zero xmax when
creating a new tuple.  This is just for debugging sanity, though, since
nothing should be paying any attention to xmax when the HEAP_XMAX_INVALID
bit is set.
2004-09-17 18:09:55 +00:00
Tom Lane 9f6df6c4a6 Fix oversight: there's no reason for PG_TRY to use sigsetjmp(buf,1)
since we don't change the signal mask during normal backend operations.
Use sigsetjmp(buf,0) to avoid many unnecessary kernel calls.
2004-09-16 21:59:17 +00:00
Tom Lane 1cfd2012a6 Remove erroneous Assert, per example from Kris Jurka. 2004-09-16 21:08:12 +00:00
Tom Lane 257cccbe5e Add some marginal tweaks to eliminate memory leakages associated with
subtransactions.  Trivial subxacts (such as a plpgsql exception block
containing no database access) now demonstrably leak zero bytes.
2004-09-16 20:17:49 +00:00
Tom Lane 86fff990b2 RecentXmin is too recent to use as the cutoff point for accessing
pg_subtrans --- what we need is the oldest xmin of any snapshot in use
in the current top transaction.  Introduce a new variable TransactionXmin
to play this role.  Fixes intermittent regression failure reported by
Neil Conway.
2004-09-16 18:35:23 +00:00
Tom Lane 8f9f198603 Restructure subtransaction handling to reduce resource consumption,
as per recent discussions.  Invent SubTransactionIds that are managed like
CommandIds (ie, counter is reset at start of each top transaction), and
use these instead of TransactionIds to keep track of subtransaction status
in those modules that need it.  This means that a subtransaction does not
need an XID unless it actually inserts/modifies rows in the database.
Accordingly, don't assign it an XID nor take a lock on the XID until it
tries to do that.  This saves a lot of overhead for subtransactions that
are only used for error recovery (eg plpgsql exceptions).  Also, arrange
to release a subtransaction's XID lock as soon as the subtransaction
exits, in both the commit and abort cases.  This avoids holding many
unique locks after a long series of subtransactions.  The price is some
additional overhead in XactLockTableWait, but that seems acceptable.
Finally, restructure the state machine in xact.c to have a more orthogonal
set of states for subtransactions.
2004-09-16 16:58:44 +00:00
Neil Conway 6a2869f64e Fix a read of uninitialized memory in array_out(). Perform some minor
cosmetic code cleanup at the same time.
2004-09-16 03:15:54 +00:00
Neil Conway d1b0d965b1 Cosmetic PL/PgSQL fix: declare the second parameter plpgsql_dstring_append
as a const char *, so that we don't need to cast away a const in gram.y
2004-09-14 23:46:46 +00:00
Peter Eisentraut cb66748bdf New translation 2004-09-14 05:50:33 +00:00
Peter Eisentraut e992444faa Translation update 2004-09-14 05:44:40 +00:00
Tom Lane 4f7d3e0faf Win32 compile fix for misc_utils.
Claudio Natoli
2004-09-14 03:50:17 +00:00
Tom Lane 296fb57b20 Make pltcl work on Win32. Magnus Hagander 2004-09-14 03:21:27 +00:00
Neil Conway 65ff0ed455 Fix small memory leak in psql. 2004-09-13 23:07:12 +00:00
Peter Eisentraut adf9a28bb8 Translation update 2004-09-13 20:53:10 +00:00
Tom Lane b2c4071299 Redesign query-snapshot timing so that volatile functions in READ COMMITTED
mode see a fresh snapshot for each command in the function, rather than
using the latest interactive command's snapshot.  Also, suppress fresh
snapshots as well as CommandCounterIncrement inside STABLE and IMMUTABLE
functions, instead using the snapshot taken for the most closely nested
regular query.  (This behavior is only sane for read-only functions, so
the patch also enforces that such functions contain only SELECT commands.)
As per my proposal of 6-Sep-2004; I note that I floated essentially the
same proposal on 19-Jun-2002, but that discussion tailed off without any
action.  Since 8.0 seems like the right place to be taking possibly
nontrivial backwards compatibility hits, let's get it done now.
2004-09-13 20:10:13 +00:00
Peter Eisentraut d69528881a Translation updates 2004-09-13 12:43:27 +00:00
Peter Eisentraut 95c034e311 Translation updates 2004-09-13 12:35:18 +00:00
Peter Eisentraut 77697dcaa3 New translations 2004-09-13 12:20:24 +00:00
Peter Eisentraut b972ab7178 New translation 2004-09-13 12:14:50 +00:00
Peter Eisentraut a67b5bd3b9 Translation updates 2004-09-13 12:11:22 +00:00
Neil Conway 9ffeab55c9 Fix two typos in comments. 2004-09-13 01:45:32 +00:00
Bruce Momjian 409de6be6c Re-add brace removal code but comment it out so we know why we removed
it and have it in case we need it for some special case.
2004-09-12 22:21:30 +00:00
Bruce Momjian 47402a9b00 Remove code that delete braces around single statements. 2004-09-12 22:11:27 +00:00
Tom Lane abc98dcc15 When LockAcquire fails at the stage of creating a proclock object, be
sure to clean up the already-created lock object, if it has no other
references.  Avoids possibly-permanent leak of shared memory.
2004-09-12 18:30:50 +00:00
Tom Lane 493f72606b Renumber SnapshotNow and the other special snapshot codes so that
((Snapshot) NULL) can no longer be confused with a valid snapshot,
as per my recent suggestion.  Define a macro InvalidSnapshot for 0.
Use InvalidSnapshot instead of SnapshotAny as the do-nothing special
case for heap_update and heap_delete crosschecks; this seems a little
cleaner even though the behavior is really the same.
2004-09-11 18:28:34 +00:00
Tom Lane 9835944e54 Ensure that pg_largeobject references opened by lo_import() or lo_export()
will be cleaned up at end of transaction, even when there is no other LO
operation in the transaction.  Per bug report from Daniel Schuchardt.
2004-09-11 15:56:46 +00:00
Tom Lane 1d681d6cee Fix some problems with restoring databases owned by non-superusers,
as per bug #1249; and remove the last vestiges of using \connect to
change authorization.
2004-09-10 20:05:18 +00:00
Tom Lane b339d1fff6 Fire non-deferred AFTER triggers immediately upon query completion,
rather than when returning to the idle loop.  This makes no particular
difference for interactively-issued queries, but it makes a big difference
for queries issued within functions: trigger execution now occurs before
the calling function is allowed to proceed.  This responds to numerous
complaints about nonintuitive behavior of foreign key checking, such as
http://archives.postgresql.org/pgsql-bugs/2004-09/msg00020.php, and
appears to be required by the SQL99 spec.
Also take the opportunity to simplify the data structures used for the
pending-trigger list, rename them for more clarity, and squeeze out a
bit of space.
2004-09-10 18:40:09 +00:00
Bruce Momjian af7f6c0a6e Fix #if define 2004-09-10 15:51:47 +00:00
Bruce Momjian 487466a601 Fix palloc call from /port for Cygwin. 2004-09-10 15:23:51 +00:00
Bruce Momjian e515c3b13e Properly include port file for Cygwin. 2004-09-10 15:20:19 +00:00
Bruce Momjian 74248ad673 Minor cleanup. 2004-09-10 14:27:37 +00:00
Bruce Momjian 390c148557 More cleanup. 2004-09-10 14:24:25 +00:00
Bruce Momjian 777687c6de Add mention loops over unlink/rename might not be needed. 2004-09-10 09:58:21 +00:00
Bruce Momjian e2e1a0cc71 Move undef of rename/unlink so system declarations are unmodified. 2004-09-10 09:53:08 +00:00
Bruce Momjian 3036b84b77 Adjust quotes for win32 build of psql. 2004-09-10 09:45:21 +00:00
Neil Conway ae7ea1395c psql consistency fixes from Greg Sabino Mullane: have \df show schema and
name first, make sure \di+ shows description last, and make \dl SQL look
a little more standard.
2004-09-10 04:10:53 +00:00
Bruce Momjian 35e88b512e Create pg_config_paths in port/ for win32 builds of psql. 2004-09-10 03:48:54 +00:00
Bruce Momjian 8975dcfcbb Clean up Cygwin test. 2004-09-10 02:49:37 +00:00
Bruce Momjian b493b39004 Move TIMEZONE_GLOBAL out into the proper place. 2004-09-09 14:18:20 +00:00
Bruce Momjian cec5d26d34 We don't use java in our compiles anymore so remove the filter test from
pgtest.
2004-09-09 09:57:23 +00:00
Dennis Bjorklund dbff17a8c8 Added a call to gettext() to fix broken translated error messages. 2004-09-09 06:56:48 +00:00
Dennis Bjorklund 877aa19211 Translation updates 2004-09-09 06:46:57 +00:00
Dennis Bjorklund 65f35065f4 Some source files was not scanned for translatable strings. 2004-09-09 06:32:13 +00:00
Dennis Bjorklund 00eb901d92 Translation updates 2004-09-09 06:02:39 +00:00
Bruce Momjian f1d1116178 Fix Cygwin defines to be consistent. 2004-09-09 00:59:49 +00:00
Bruce Momjian b70999d0fd Make TZNAME_GLOBAL for reference to tzname global variable. 2004-09-09 00:24:12 +00:00
Tom Lane f62901ca81 Minor efficiency improvements in keeping track of trigger deferred
status.  In particular, I see no reason for deferredTriggerCheckState
to make an explicit entry to note that a particular trigger has its
default state --- that just clutters a list that should normally be
empty or very short.  I have plans to revise this module much more
heavily, but this is a simple separable improvement.
2004-09-08 23:47:58 +00:00
Bruce Momjian e97c817092 Use _timezone global on Cygwin instead of timezone. 2004-09-08 19:43:12 +00:00
Tom Lane 6bb0d54eb8 Fix a couple of small errors in trigger-list management, as per recent
discussion.
2004-09-07 21:48:30 +00:00
Tom Lane 2750b11e18 Fix places where WaitForxxx can block, to eliminate failure to detect
deadlock on Win32.  Magnus Hagander
2004-09-07 14:31:42 +00:00
Tom Lane a1f7fb0975 Fix error in Windows version of CHECK_FOR_INTERRUPTS macro.
This prevented statement_timeout from working.
Magnus Hagander
2004-09-06 23:55:34 +00:00
Tom Lane 083258e535 Fix a number of places where brittle data structures or overly strong
Asserts would lead to a server core dump if an error occurred while
trying to abort a failed subtransaction (thereby leading to re-execution
of whatever parts of AbortSubTransaction had already run).  This of course
does not prevent such an error from creating an infinite loop, but at
least we don't make the situation worse.  Responds to an open item on
the subtransactions to-do list.
2004-09-06 23:33:48 +00:00
Tom Lane d55588ea7a Guard against transaction control statements in SQL functions. This
never worked, but it particularly doesn't work now.
2004-09-06 18:10:38 +00:00
Tom Lane 23645f0582 Fix incorrect ordering of smgr cleanup relative to buffer pin cleanup
during transaction abort.  Add a regression test case to catch related
mistakes in future.  Alvaro Herrera and Tom Lane.
2004-09-06 17:56:33 +00:00
Tom Lane eb917c1a21 I can't see any good reason for DropRelFileNodeBuffers to be issuing
FATAL when it detects a nonzero reference count.  Reduce to ERROR.
2004-09-06 17:31:32 +00:00
Michael Meskes 2a8b626d48 Fixed segfault in Informix mode. 2004-09-06 11:23:07 +00:00
Tom Lane e32bba202d Downgrade LOG messages to DEBUG1 for normal recycling of xlog, clog,
subtrans segments.  Per Greg Mullane and Chris K-L.
2004-09-06 03:04:27 +00:00
Tom Lane 7488929c96 Simplify IsXactIsoLevelSerializable test. A cycle saved is a cycle
earned ...
2004-09-05 23:01:26 +00:00
Tom Lane 1a86e6eabf On further consideration, there's another problem here: the existing
elog() emulation code always calls errstart with ERROR error level.
This means that a recursive error call triggered by elog would do
MemoryContextReset(ErrorContext), whether or not this was actually
appropriate.  I'm surprised we haven't seen this in the field...
2004-09-05 03:42:13 +00:00
Tom Lane cefb4b141b Tweak elog.c's logic for promoting errors into more severe errors.
Messages of less than ERROR severity should never be promoted (this
fixes Gaetano Mendola's problem with a COMMERROR becoming a PANIC,
and is obvious in hindsight anyway).  Do all promotion in errstart
not errfinish, to ensure that output decisions are made correctly;
the former coding could suppress logging of promoted errors, which
doesn't seem like a good idea.  Eliminate some redundant code too.
2004-09-05 02:01:41 +00:00
Tom Lane 346900e83b Fix shared library linking operations to work properly on all (or at
least more) combinations of HP-UX hardware, compiler, and linker.
Shinji Teragaito and Tom Lane.
2004-09-02 23:06:43 +00:00
Tom Lane cb79234307 Apparently HPUX runs the IA64 in big-endian mode. 2004-09-02 21:03:30 +00:00
Tom Lane 6ad853b975 Yet another place where someone was being careless about the arguments
of <ctype.h> macros.
2004-09-02 20:07:50 +00:00
Tom Lane a28961d5e0 Spelling correction, per Greg Mullane. 2004-09-02 17:58:41 +00:00
Tom Lane 1e4c33b1e8 Fix getrusage() emulation on Windows. Magnus Hagander 2004-09-02 17:55:16 +00:00
Tom Lane 3cd16475db Cope with recent HPUX versions providing isfinite() instead of finite(). 2004-09-02 17:12:50 +00:00
Tom Lane 5042985fb4 Add s_lock support for HPUX on IA64, per Shinji Teragaito. 2004-09-02 17:10:58 +00:00
Tom Lane e00896f3c6 Remove useless variable. 2004-09-02 16:42:00 +00:00
Bruce Momjian 8cef6ae522 Remove pg_config_paths.h from libpq *.mak builds so later MinGW builds
will succeed.
2004-09-02 02:02:02 +00:00
Bruce Momjian bf831f6e9f Back out timezone detection patch. Tom already applied it. 2004-09-02 01:15:06 +00:00
Bruce Momjian 525449be27 This patch attempts to fix the issue with localized timezones on
Windows.

Recap: When running on a localized windows version, the timezone name
returned is also localized, and therefor does not match our lookup
table.

Solution: The registry contains both the name of the timezone in english
and the localized name. The patch adds code to scan the registry for the
localized name and gets the english name from that, and then rescans the
table.

I have tested this on a Swedish WinXP, and it works without problems.
The registry layout is the same in Win2k, but I haven't specifically
tested it. It's also the same on different languages but again only
Swedish is tested.

Magnus Hagander
2004-09-02 01:03:59 +00:00
Tom Lane e814e4bfe5 Remove obsolete comment. 2004-09-02 00:22:16 +00:00
Tom Lane e41acf4029 Tweak prettyprinting rules for saner indenting of UNION, INTERSECT,
EXCEPT constructs.
2004-09-01 23:58:38 +00:00
Bruce Momjian 453c670b61 Fix bcc to compile libpq by creating include file for path.c. 2004-09-01 23:45:16 +00:00
Bruce Momjian 4fa8b44749 Realign libpq and psql for need for path.c under Win32 VC and BCC. 2004-09-01 23:35:16 +00:00
Bruce Momjian bd9b951191 Back out Cygwin timezone change until we have a more global solution. 2004-09-01 18:59:35 +00:00
Tom Lane 93dc1d4685 Fix mistaken comment. 2004-09-01 18:04:32 +00:00
Tom Lane 272cc8e265 Whack Wisconsin benchmark around until it actually works again.
It's still useless because it tests a standalone backend, but at least
the bit rot is repaired.
2004-09-01 17:25:40 +00:00
Tom Lane d1b2260cdc Add code to be able to match the timezone name on localized Windows
systems.  Magnus Hagander.
2004-09-01 16:21:50 +00:00
Dennis Bjorklund b3d3e27bb8 Translation updates 2004-09-01 10:11:08 +00:00
Bruce Momjian 33f395eada Cast _timezone to int from time_t for Cygwin. 2004-09-01 04:02:06 +00:00
Bruce Momjian 2a5f83c17c src/bin/psql/tab-complete.c =~ s/CONVERSATION/CONVERSION/;
Greg Sabino Mullane
2004-09-01 00:10:01 +00:00
Tom Lane e19f6bcf64 needs_toast_table() should ignore dropped columns. 2004-08-31 23:27:05 +00:00
Tom Lane 1239a01a72 Code review for recent changes in guc-file.l. Avoid multiple frees,
use of already-freed strings, other silliness.  Also fix reporting of
config file syntax errors so that it actually works reasonably well
(eg, points at the correct line).  Use palloc instead of malloc for
temporary storage to reduce code clutter.
2004-08-31 22:43:58 +00:00
Tom Lane c32416ebb7 Code review for various recent GUC hacking. Don't elog(ERROR) when
not supposed to (fixes problem with postmaster aborting due to mistaken
postgresql.conf change); don't call superuser() when not inside a
transaction (fixes coredump when, eg, try to set log_statement from
PGOPTIONS); some message style guidelines enforcement.
2004-08-31 19:28:51 +00:00
Tom Lane 617d6ea7df Fix unintended assignment of sequences to the containing schema's
default tablespace --- they should always go in the database's default
tablespace.  Adjust heap_create() API so that it is passed the relkind
to make this easier; should simplify any further tweaking of the same
sort.
2004-08-31 17:10:36 +00:00
Tom Lane a421b4e850 FlushRelationBuffers was also being a bit cavalier about whether the
relation is already opened by smgr.
2004-08-31 16:13:06 +00:00
Tom Lane 556110f4e0 copy_relation_data was mistakenly assuming that the source relation
would always be already open at the smgr level.  Per bug report from
Fabien Coelho.
2004-08-31 15:56:39 +00:00
Bruce Momjian b4456e6d6a Define lstat with parameters, rather than just redefining the symbol. 2004-08-31 11:29:56 +00:00
Bruce Momjian 2e88d29f88 Fix typo in lstat() macro exposed by new tablespace code. 2004-08-31 11:25:33 +00:00
Tom Lane 8c603f2c95 Replace log_filename_prefix with more general log_filename parameter,
to allow DBA to choose the form in which log filenames reflect the
current time.  Also allow for truncating instead of appending to
pre-existing files --- this is convenient when the log filename pattern
rewrites the same names cyclically.  Per Ed L.
2004-08-31 04:53:44 +00:00
Tom Lane 332ee2dc41 Improve spinlock selftest to make it able to detect misdeclaration of
the slock_t datatype (ie, declared type smaller than what the hardware
TAS instruction needs).
2004-08-30 23:47:20 +00:00
Tom Lane 17364edce6 slock_t must be int not char for MIPS. 7.4 got this right, but the
info was apparently mistranscribed in s_lock code rearrangement.
2004-08-30 22:49:07 +00:00
Tom Lane c7040429e7 Fix obviously-utterly-untested noTocComments code. 2004-08-30 19:44:14 +00:00
Tom Lane 64cb889106 Ensure that the remainder of the current pg_clog page is zeroed during
startup, just to be sure that there's no leftover junk there.
2004-08-30 19:00:42 +00:00
Tom Lane 9cf4eaa00b Fix failure to advance nextXID beyond subtransactions whose XIDs appear
only within COMMIT or ABORT records.
2004-08-30 19:00:03 +00:00
Tom Lane 303e46ea93 Tweak md.c logic to cope with the situation where WAL replay tries to
write into a high-numbered segment of a relation that was later deleted.
We need to temporarily recreate missing segment files, instead of
failing.
2004-08-30 03:52:43 +00:00
Tom Lane 09c6ac9513 Dept. of second thoughts: it'd be a good idea to flush buffers
during replay of CREATE DATABASE as well as the first time around.
Else it's possible that the copy operation will copy obsolete blocks.
We are still a long way from guaranteeing anything about using a
recently-written database as a CREATE template, but this seems needed
to ensure the existing behavior holds up during replay.
2004-08-30 03:50:24 +00:00
Bruce Momjian 15d3f9f6b7 Another pgindent run with lib typedefs added. 2004-08-30 02:54:42 +00:00
Tom Lane 50742aed68 Add WAL logging for CREATE/DROP DATABASE and CREATE/DROP TABLESPACE.
Fix TablespaceCreateDbspace() to be able to create a dummy directory
in place of a dropped tablespace's symlink.  This eliminates the open
problem of a PANIC during WAL replay when a replayed action attempts
to touch a file in a since-deleted tablespace.  It also makes for a
significant improvement in the usability of PITR replay.
2004-08-29 21:08:48 +00:00
Bruce Momjian ee66401f31 Update typedefs with /lib info. 2004-08-29 17:31:42 +00:00
Tom Lane 0ffe11abd3 Widen xl_len field of XLogRecord header to 32 bits, so that we'll have
a more tolerable limit on the number of subtransactions or deleted files
in COMMIT and ABORT records.  Buy back the extra space by eliminating the
xl_xact_prev field, which isn't being used for anything and is rather
unlikely ever to be used for anything.
This does not force initdb, but you do need to do pg_resetxlog if you
want to upgrade an existing 8.0 installation without initdb.
2004-08-29 16:34:48 +00:00
Bruce Momjian b6b71b85bc Pgindent run for 8.0. 2004-08-29 05:07:03 +00:00
Bruce Momjian 90cb9c3051 Update with new typedefs. Remove java and c++ parts of readme. 2004-08-29 04:49:45 +00:00
Bruce Momjian da9a8649d8 Update copyright to 2004. 2004-08-29 04:13:13 +00:00
Bruce Momjian 466c1290df Fix for postmaster.c function win32_waitpid(int *exitstatus) call to
Win32 WaitForMultipleObjects:

	ret = WaitForMultipleObjects(win32_numChildren, win32_childHNDArray,
	FALSE, 0);

Problem is 'win32_numChildren' could be more then 64 ( function supports
), problem basically arise ( kills postgres ) when you create more then
64 connections and terminate some of them sill leaving more then 64.

Claudio Natoli
2004-08-29 03:16:30 +00:00
Bruce Momjian 71fce6ce1b Adjust regression expected file for new grant language hint. 2004-08-29 03:14:07 +00:00
Bruce Momjian 61384de6f9 Add hint about using GRANT with non-trusted languages.
James William Pye
2004-08-29 03:04:15 +00:00
Bruce Momjian 0476bbbc9b Several Cygwin fixes pointed out by Reini Urban. 2004-08-29 02:58:50 +00:00
Bruce Momjian f94aea9c10 Add comment on palloc use and DLLIMPORT> 2004-08-29 01:44:02 +00:00
Bruce Momjian 704ff0b2f2 >>> I understand your disliking of non-posix stuff. OTOH,
>>GetLastError will
>>> give much more details than errno.
>>
>>How much more, really?  That mapping table gave me the impression that
>>the win32 error codes aren't all that much more detailed than errno...
>
>The mapping table is not complete. My winerror.h from the SDK
>lists 2209
>error codes, whereas errno.h lists 42...
>
>I still don't think we'll get that much more stuff. Right now,
>the Win32
>code paths that actually use the more advanced functions already write
>out the error number in case something happens. We can keep doing that
>for the other paths (ereport the error *number* when the mapping does
>not have a match). The map to errno will catch almost all cases, I
>think. And in the corner cases we can do with just the number, and use
>"net helpmsg" to get the actual message when checking...

Here's an attempt on this. new file goes in backend/port/win32.

Magnus Hagander
2004-08-29 00:38:03 +00:00
Bruce Momjian fe90fb4d37 The attached patch improves pg_ctl's win32 service code to eliminate
some possible causes of the stale postmaster.pid problem that some users
have reported.

- The service did not properly report that it accepts
SERVICE_CONTROL_SHUTDOWN events, thus it's possible the SCM simply
killed the postmaster on shutdown.

- 'WaitHints' are now given to the SCM to prevent it timing out if
pg_ctl doesn't respond to a control event quickly enough.

- During shutdown, the service checkpoint counter is incremented every
five seconds for up to a minute to prevent the SCM timing out and
assuming the service is not responding.

Dave Page
2004-08-28 23:26:37 +00:00
Bruce Momjian f7587aeba8 > Am Dienstag, 17. August 2004 14:26 schrieb Fabien COELHO:
> > The patch adds missing the "libpgport.a" file to the installation under
> > "install-all-headers". It is needed by some contribs. I install the
> > library in "pkglibdir", but I was wondering whether it should be "libdir"?

Please find attached a small patch against current CVS head that fixes
pgport library installation so that it goes to libdir instead of
pkglibdir. It works for me.

Fabien Coelho
2004-08-28 22:55:06 +00:00
Bruce Momjian 922599464f Fix high-bit comparison compiler warning in pg_dump.
Philip Warner
2004-08-28 22:52:50 +00:00
Bruce Momjian 5395aed9d5 Add regression tests for ALTER INDEX.
Gavin Sherry
2004-08-28 22:06:04 +00:00
Tom Lane f78ecbf20e Now that TransactionIdDidAbort doesn't think it should try to modify
pg_clog, there's no reason to do abort marking of subtransactions in a
nonintuitive order.
2004-08-28 22:04:12 +00:00
Bruce Momjian c8702dcb8e Propogate pg_ctl -D to the postmaster for command-line identification. 2004-08-28 22:04:01 +00:00
Tom Lane 7531d2fd85 Add missing Assert to make TransactionIdDidAbort more consistent with
TransactionIdDidCommit.
2004-08-28 21:58:59 +00:00
Tom Lane 448eb0837f Rearrange order of operations in heap_drop_with_catalog and index_drop
so that we close and flush the doomed relation's relcache entry before
we start to delete the underlying catalog rows, rather than afterwards.
For awhile yesterday I thought that an unexpected relcache entry rebuild
partway through this sequence might explain the infrequent parallel
regression failures we were chasing.  It doesn't, mainly because there's
no CommandCounterIncrement in the sequence and so the deletions aren't
"really" done yet.  But it sure seems like trouble waiting to happen.
2004-08-28 21:05:26 +00:00
Bruce Momjian a0a61f494d > > Another issue is that when installing the Postgres service with
> > "pg_ctl register -w ...." the "-w" parameter was not put in
> the registry "ImagePath"
> > value for the Postgres service. (I added it manually to test.) So I
> > suspect that "pg_ctl register" will need to be enhanced to add the
> > "-w" parameter to the registry settings.

Dave Page
2004-08-28 21:01:38 +00:00
Bruce Momjian cc28a275cb Use dynamic buffer for token buffer in win32 admin check
Magnus Hagander
2004-08-28 21:00:35 +00:00
Tom Lane 1c72d0dec1 Fix relcache to account properly for subtransaction status of 'new'
relcache entries.  Also, change TransactionIdIsCurrentTransactionId()
so that if consulted during transaction abort, it will not say that
the aborted xact is still current.  (It would be better to ensure that
it's never called at all during abort, but I'm not sure we can easily
guarantee that.)  In combination, these fix a crash we have seen
occasionally during parallel regression tests of 8.0.
2004-08-28 20:31:44 +00:00
Joe Conway f900af7961 Further tightening of the array literal parser. Prevent junk
from being accepted after the outer right brace. Per report from
Markus Bertheau.

Also add regression test cases for this change, and for previous
recent array literal parser changes.
2004-08-28 19:31:29 +00:00
Tom Lane f444dafab0 Can't truncate pg_subtrans during a recovery checkpoint --- subtrans
module isn't fully initialized yet.
2004-08-28 18:18:03 +00:00
Tom Lane 7ff1c9d974 Add missing semicolon; some bison versions warn of this. 2004-08-28 18:04:51 +00:00
Tom Lane 3e3f70a28a Fix Windows emulation of kill(pid, 0). This will now succeed, but only
if the target PID is a PG postmaster or backend --- for our purposes that
is actually better than the Unix behavior.  Per Dave Page and Andrew Dunstan.
2004-08-27 18:31:48 +00:00
Tom Lane 1785acebf2 Introduce local hash table for lock state, as per recent proposal.
PROCLOCK structs in shared memory now have only a bitmask for held
locks, rather than counts (making them 40 bytes smaller, which is a
good thing).  Multiple locks within a transaction are counted in the
local hash table instead, and we have provision for tracking which
ResourceOwner each count belongs to.  Solves recently reported problem
with memory leakage within long transactions.
2004-08-27 17:07:42 +00:00
Tom Lane 337b513e07 Fix user locks. Broken some time ago for all platforms by Windows-related
changes.
2004-08-26 17:23:30 +00:00
Tom Lane 51d7e25651 Improve some comments. 2004-08-26 17:22:28 +00:00
Bruce Momjian 32142e2a60 Update documentation to prefer CIDR format for pg_hba.conf and use new
CIDR column in examples first.
2004-08-26 16:50:05 +00:00
Bruce Momjian 8ec3221d32 Update Win32 wording. 2004-08-26 13:44:38 +00:00
Tom Lane 7584194cc9 Fix typo in comment, per Andrew Dunstan. 2004-08-25 20:07:57 +00:00
Tom Lane fe455ee1d4 Revise ResourceOwner code to avoid accumulating ResourceOwner objects
for every command executed within a transaction.  For long transactions
this was a significant memory leak.  Instead, we can delete a portal's
or subtransaction's ResourceOwner immediately, if we physically transfer
the information about its locks up to the parent owner.  This does not
fully solve the leak problem; we need to do something about counting
multiple acquisitions of the same lock in order to fix it.  But it's a
necessary step along the way.
2004-08-25 18:43:43 +00:00
Peter Eisentraut b662311db0 Translation update 2004-08-24 21:45:40 +00:00
Peter Eisentraut a56cebb18f Translation update 2004-08-24 21:35:19 +00:00
Tom Lane 3cb1ffa653 Allow second and subsequent names in a qualified (dotted) name to be
ColLabel instead of just ColId --- that is, any keyword can appear after
a dot and it will be taken as an identifier.  Fixes problems with names
that are okay as standalone function names but fail when qualified.
2004-08-24 20:41:40 +00:00
Tom Lane 4dbb880d3c Rearrange pg_subtrans handling as per recent discussion. pg_subtrans
updates are no longer WAL-logged nor even fsync'd; we do not need to,
since after a crash no old pg_subtrans data is needed again.  We truncate
pg_subtrans to RecentGlobalXmin at each checkpoint.  slru.c's API is
refactored a little bit to separate out the necessary decisions.
2004-08-23 23:22:45 +00:00
Tom Lane f009c316ba Tweak code so that pg_subtrans is never consulted for XIDs older than
RecentXmin (== MyProc->xmin).  This ensures that it will be safe to
truncate pg_subtrans at RecentGlobalXmin, which should largely eliminate
any fear of bloat.  Along the way, eliminate SubTransXidsHaveCommonAncestor,
which isn't really needed and could not give a trustworthy result anyway
under the lookback restriction.
In an unrelated but nearby change, #ifdef out GetUndoRecPtr, which has
been dead code since 2001 and seems unlikely to ever be resurrected.
2004-08-22 02:41:58 +00:00
Tom Lane 37d937ea2c Code review for ALTER INDEX patch. 2004-08-22 00:08:28 +00:00
Bruce Momjian 235caf4bb2 Fix tab completion for ALTER INDEX. 2004-08-21 18:45:59 +00:00
Bruce Momjian d21eabc61a Remove Solaris bug mention in pg_hba.conf. 2004-08-21 03:21:57 +00:00
Bruce Momjian 34f34a041c Fix pg_ctl -w to properly wait on server startup. 2004-08-21 03:12:55 +00:00
Tom Lane bf9d9bd2f3 Recognize plpgsql EXCEPTION condition names at function compile time
instead of runtime, for better detection of invalid condition names
(and maybe a little more speed, too).
2004-08-20 22:00:14 +00:00
Bruce Momjian 009b0d1a85 >>At this stage of the game I would just change pg_hba.conf.sample to use
>>'127.0.0.1/32' instead of '127.0.0.1 255.255.255.255'.
>>
>>
>
>Yeah, that's probably the path of least resistance.  Note that the
>comments and possibly the SGML docs need to be adjusted to match,
>however, so it's not quite a one-liner.

Andrew Dunstan
2004-08-20 20:23:06 +00:00
Bruce Momjian 3ca998b951 Allow psql to use 7.4.X database by not referencing tablespaces.
Greg Sabino Mullan
2004-08-20 20:18:23 +00:00
Bruce Momjian ee85595d46 > Please find enclose a submission to fix these problems.
>
> The patch adds missing the "libpgport.a" file to the installation under
> "install-all-headers". It is needed by some contribs. I install the
> library in "pkglibdir", but I was wondering whether it should be "libdir"?
> I was wondering also whether it would make sense to have a "libpgport.so"?
>
> It fixes various macros which are used by contrib makefiles, especially
> libpq_*dir and LDFLAGS when used under PGXS. It seems to me that they are
> needed to
>
> It adds the ability to test and use PGXS with contribs, with "make
> USE_PGXS=1". Without the macro, this is exactly as before, there should be
> no difference, esp. wrt the vpath feature that seemed broken by previous
> submission. So it should not harm anybody, and it is useful at least to me.
>
> It fixes some inconsistencies in various contrib makefiles
> (useless override, ":=" instead of "=").

Fabien COELHO
2004-08-20 20:13:10 +00:00
Bruce Momjian f7168bd44c They are two different problems; the TOC entry is important for any
multiline command  or to rerun the command easily later.

Whereas displaying the failed SQL command is a matter of fixing the
error
messages.

The latter is complicated by failed COPY commands which, with
die-on-errors
off, results in the data being processed as a command, so dumping the
command will dump all of the data.

In the case of long commands, should the whole command be dumped? eg.
(eg.
several pages of function definition).

In the case of the COPY command, I'm not sure what to do. Obviously, it
would be best to avoid sending the data, but the data and command are
combined (from memory). Also, the 'data' may be in the form of INSERT
statements.

Attached patch produces the first 125 chars of the command:

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC Entry 26; 1255 16449270
FUNCTION
plpgsql_call_handler() pjw
pg_restore: [archiver (db)] could not execute query: ERROR:  function
"plpgsql_call_handler" already exists with same argument types
     Command was: CREATE FUNCTION plpgsql_call_handler() RETURNS
language_handler
     AS '/var/lib/pgsql-8.0b1/lib/plpgsql', 'plpgsql_call_han...
pg_restore: [archiver (db)] Error from TOC Entry 27; 1255 16449271
FUNCTION
plpgsql_validator(oid) pjw
pg_restore: [archiver (db)] could not execute query: ERROR:  function
"plpgsql_validator" already exists with same argument types
     Command was: CREATE FUNCTION plpgsql_validator(oid) RETURNS void
     AS '/var/lib/pgsql-8.0b1/lib/plpgsql', 'plpgsql_validator'
     LANGU...

Philip Warner
2004-08-20 20:00:34 +00:00
Bruce Momjian cecf41bd29 Attached is the third version of my patch that adds/fixes several things
to/in the psql-tabcomplete code. This diff includes the still missing
tab-complete support for TABLESPACE I already sent earlier. New in this
version of the patch is a small adaption of the tab-complete code to
support the adjusted SAVEPOINT-Syntax commited by Tom, as well as
completion of the only half working (and I think only by accident)
tabcomplete-suppport for "BEGIN [ TRANSACTION | WORK ]".

below is a complete list of the things I have changed with this patch:


*) add tablespace support for CREATE/DROP/ALTER and \db
*) sync the list of possible commands following ALTER with the docs (by
adding
AGGREGATE,CONVERSATION,DOMAIN,FUNCTION,LANGUAGE,OPERATOR,SEQUENCE,TABLESPACE
and TYPE)
*) provide a list of valid users after "OWNER TO"
*) tab-complete support for ALTER (AGGREGATE|CONVERSION|FUNCTION)
*) basic tab-complete support for ALTER DOMAIN
*) provide a list of suitable indexes following ALTER TABLE <sth>
CLUSTER ON(?)
*) add "CLUSTER ON" and "SET" to the ALTER TABLE <sth> - tab-complete
list(fixes incorrect/wrong tab-complete with ALTER TABLE <sth> SET
+<TAB> too)
*) provide a list of possible indexes following ALTER TABLE <sth> CLUSTER ON
*) provide list of possible commands(WITHOUT CLUSTER,WITHOUT OIDS,
TABLESPACE) following ALTER TABLE <sth> SET
*) sync "COMMENT ON" with docs by adding "CAST","CONVERSION","FUNCTION"
*) add ABSOLUT to the list of possible commands after FETCH
*) "END" was missing from the sql-commands overview (though it had
completion support!) - i know it's depreciated but we have ABORT and
others still in ...
*) fixes small buglet with ALTER (TRIGGER|CLUSTER) ON autocomplete
(CLUSTER ON +<TAB> would produce CLUSTER ON ON - same for TRIGGER ON)
*) adapt to new SAVEPOINT syntax
*) fix incomplete Support for BEGIN [ TRANSACTION | WORK ]

Stefan Kaltenbrunn
2004-08-20 19:24:59 +00:00
Bruce Momjian 1b5e0143b5 This patch allows pg_restore to recognize $-quotes in SQL queries. It
will treat any unquoted string that starts with a $ and has no preceding
identifier chars as a potential $-quote tag, it then makes sure that the
tag chars are valid. If so, it processes the $-quote.

Philip Warner
2004-08-20 16:07:15 +00:00
Bruce Momjian 09d4e96d7e Add ALTER INDEX, particularly for moving tablespaces.
Gavin Sherry
2004-08-20 04:29:33 +00:00
Bruce Momjian daa076c4fd > Please find attached a submission to add a "exit on error" option to
> pg_restore, as it seems that some people have scripts that rely on the
> previous "abort on error" default behavior when restoring data with a
> direct connection.
>
> Fabien Coelho
2004-08-20 04:20:23 +00:00
Bruce Momjian 46be0c18f1 > After all that about numbering centuries and millenia correctly,
> why does CVS tip still give me
>
> regression=# select extract(century from now());
>  date_part
> -----------
>         20
> (1 row)
> [ ... looks in code ... ]
>
> Apparently it's because you fixed only timestamp_part, and not
> timestamptz_part.  I'm not too sure about what timestamp_trunc or
> timestamptz_trunc should do, but they may be wrong as well.

Sigh... as usual, what is not tested does not work:-(


> Could we have a more complete patch?

Please find a submission attached. I hope it really fixes all decade,
century and millenium issues for extract and *_trunc functions on
interval
and other timestamp types. If someone could check that the results
are reasonnable, it would be great.

I indeed overlooked the fact that there were two functions. The patch
fixes the code so that both variants agree.

I added comments to interval extractions, because it relies on the C
division to have a negative remainder: -7/10 = 0 and remains -7.

As for *_trunc functions, I have chosen to put the first year of the
century or millennium: -100, 1, 101... 1001 2001 etc. Indeed, I don't
think it would make sense to put 2000 (last year of the 2nd millennium)
for rounding all years of the third millenium.

I also fixed the code so that all decades last 10 years and decade 199
means the 1990's.

I have added some tests that are relevant to deal with tricky cases. The
formula may be simplified, but all these cases must pass. Please keep
them.

Fabien Coelho
2004-08-20 03:45:14 +00:00
Tom Lane bbd6eb5b95 Repair some issues with column aliases and RowExpr construction in the
presence of dropped columns.  Document the already-presumed fact that
eref aliases in relation RTEs are supposed to have entries for dropped
columns; cause the user alias structs to have such entries too, so that
there's always a one-to-one mapping to the underlying physical attnums.
Adjust expandRTE() and related code to handle the case where a column
that is part of a JOIN has been dropped.  Generalize expandRTE()'s API
so that it can be used in a couple of places that formerly rolled their
own implementation of the same logic.  Fix ruleutils.c to suppress
display of aliases for columns that were dropped since the rule was made.
2004-08-19 20:57:41 +00:00
Bruce Momjian 84f878f5cd Don't use get_home_path so libpq doesn't pull path.c into the library. 2004-08-19 00:00:34 +00:00
Tom Lane 76dd2333d5 Clean up some random departures from project's standard declaration style. 2004-08-18 19:27:13 +00:00
Bruce Momjian 1abf13db3c Add get_home_path() to use USERPROFILE on Win32 and HOME on Unix. 2004-08-18 02:59:12 +00:00
Tom Lane 19cd31b068 Fix bug introduced into _bt_getstackbuf() on 2003-Feb-21: the initial
value of 'start' could be past the end of the page, if the page was
split by some concurrent inserting process since we visited it.  In
this situation the code could look at bogus entries and possibly find
a match (since after all those entries still contain what they had
before the split).  This would lead to 'specified item offset is too large'
followed by 'PANIC: failed to add item to the page', as reported by Joe
Conway for scenarios involving heavy concurrent insertion activity.
2004-08-17 23:15:33 +00:00
Tom Lane fcaad7e2c1 Standardize on the assumption that the arguments of a RowExpr correspond
to the physical layout of the rowtype, ie, there are dummy arguments
corresponding to any dropped columns in the rowtype.  We formerly had a
couple of places that did it this way and several others that did not.
Fixes Gaetano Mendola's "cache lookup failed for type 0" bug of 5-Aug.
2004-08-17 18:47:09 +00:00
Bruce Momjian 3f0fa93cfc Chain on to SIGPIPE handler rather than just do action on default.
Always create thread-specific variable.
2004-08-17 16:54:47 +00:00
Bruce Momjian 26f6111dd9 Add comment about portability function name inconsistency. 2004-08-17 14:38:38 +00:00
Tom Lane 109d7aff73 Fix linking problem when enabling thread safety on Darwin: uninitialized
global variables are problematic on this platform.  Simplest solution
seems to be to initialize pthread key variable to 0.  Also, rename this
variable and check_sigpipe_handler to something involving "pq" to
avoid gratuitous pollution of application namespace.
2004-08-17 04:24:23 +00:00
Bruce Momjian 8b82a705c8 Add DLLIMPORT for PostGIS. 2004-08-17 02:51:32 +00:00
Bruce Momjian 26fc9b655b Move io.h include higher in the file so it doesn't conflict with
rename/unlink defined later.  Problem exists on MS VC.

Andrew Francis
2004-08-17 02:44:13 +00:00
Tom Lane 64410289f8 Add trivial NULL statement to plpgsql, for Oracle compatibility. 2004-08-16 17:52:06 +00:00
Bruce Momjian 33829a5e0f Throw error if initdb -L is not an absolute path. 2004-08-16 15:44:03 +00:00
Bruce Momjian 23717760d1 Fix for adding \n for zero-length win32 read_pipe return 2004-08-16 02:46:36 +00:00
Tom Lane e617fe729d Mark server_encoding and integer_datetimes as GUC_REPORT, per previous
proposals by Oliver Jowett.  Update documentation.
2004-08-16 02:12:29 +00:00
Bruce Momjian c7ae53a6b4 Clarify need for \r\n -> \n translation in version checking code. 2004-08-16 01:26:31 +00:00
Tom Lane 1a3de15a3a Dept. of further reflection: I looked around to see if any other callers
of XLogInsert had the same sort of checkpoint interlock problem as
RecordTransactionCommit, and indeed I found some.  Btree index build
and ALTER TABLE SET TABLESPACE write data outside the friendly confines
of the buffer manager, and therefore they have to take their own
responsibility for checkpoint interlock.  The easiest solution seems to
be to force smgrimmedsync at the end of the index build or table copy,
even when the operation is being WAL-logged.  This is sufficient since
the new index or table will be of interest to no one if we don't get
as far as committing the current transaction.
2004-08-15 23:44:46 +00:00
Tom Lane 057ea3471f Xmin calculations should consider only top transaction IDs, and
therefore starting with GetCurrentTransactionId is wrong.  Fixes
miscomputation of RecentGlobalXmin leading to bizarre behavior
reported by Gavin Sherry.
2004-08-15 17:03:36 +00:00
Tom Lane 2820f05ef9 Specify SA_NOCLDSTOP when enabling SIGCHLD, per suggestion from
Oliver Jowett.
2004-08-15 05:25:10 +00:00
Bruce Momjian 2284cfa255 Quote PERL expansion for Win32 path that might have spaces. 2004-08-15 00:41:51 +00:00
Peter Eisentraut 3ea6d6d4d5 Translation updates 2004-08-14 19:16:07 +00:00
Tom Lane b681bf9323 Fix psql's COPY support to deal with \r\n line endings.
Andrew Dunstan, some further hacking by Tom Lane.
2004-08-13 22:59:29 +00:00
Tom Lane 2193121fa9 Fix breakage with PUBLIC schema. Try to untwist the remarkably contorted
logic a little bit.
2004-08-13 21:37:28 +00:00
Tom Lane bf08e6550b Give a more specific error message for "you can't do that" error cases
in plpgsql, particularly trying to begin/end/rollback a transaction.
2004-08-13 18:47:56 +00:00
Peter Eisentraut 1a36562d6a New translations 2004-08-13 16:47:30 +00:00
Peter Eisentraut 3458a380d3 Translation update 2004-08-13 16:43:06 +00:00
Peter Eisentraut 1c31374e3d Translation updates 2004-08-13 16:34:31 +00:00
Tom Lane 79f9ee9d15 Fix core dumps, inability to count, etc associated with canonicalize_path
patches.
2004-08-13 14:47:23 +00:00
Tom Lane d785841f83 Change order of operations in ALTER TABLE SET TABLESPACE so that we
don't hold an open file reference to the original table at the end.
This is a good thing in any case, particularly so on Windows which
cannot drop the table file otherwise.
2004-08-13 04:50:28 +00:00
Tom Lane 7f7e8cc3f2 Allow commas in BEGIN, START TRANSACTION, and SET TRANSACTION, as required
by the SQL standard.  For backwards compatibility, however, continue to
accept the syntax without.  Minor editorialization in the reference pages
for these commands, too.
2004-08-12 21:00:34 +00:00
Tom Lane a583675108 Allow optional SAVEPOINT keyword in RELEASE and ROLLBACK TO, for greater
compliance with SQL2003 spec syntax.

Oliver Jowett
2004-08-12 19:12:21 +00:00
Bruce Momjian 10249abfa1 Cleanup Win32 COPY handling, and move archive examples to SGML. 2004-08-12 19:03:44 +00:00
Bruce Momjian 43ea65a0dc Add mention of "WIN32" COPY. 2004-08-12 18:34:45 +00:00
Bruce Momjian 6525b42b10 Add make_native_path() because Win32 COPY is an internal CMD.EXE command
and doesn't process forward slashes in the same way as external
commands.  Quoting the first argument to COPY does not convert forward
to backward slashes, but COPY does properly process quoted forward
slashes in the second argument.

Win32 COPY works with quoted forward slashes in the first argument only if the
current directory is the same as the directory of the first argument.
2004-08-12 18:32:52 +00:00
Tom Lane 250e516051 Cause initdb to actually accept -s as intended, and fix some typos in
a comment.

Jon Jensen
2004-08-11 23:28:54 +00:00
Tom Lane 3de91c18b5 Fix broken parsing of CREATE TABLE AS (looks like a mis-sync with main
parser).
2004-08-11 22:50:35 +00:00
Tom Lane aff700a160 Avoid crashing when restoring a saved GUC session_authorization value
that refers to a now-deleted userid.  Per gripe from Chris Ochs.
2004-08-11 21:10:37 +00:00
Tom Lane f79fbb2bec Add PQserverVersion() to libpq to provide more-convenient access to
the server version number.  This commit also removes bogus DOS line
endings from libpqddll.def.

Greg Sabino Mullane
2004-08-11 18:06:01 +00:00
Tom Lane b2d9fbeef2 Work around broken strtod() that's present in many Solaris releases.
Thanks to Michael Fuhr for identifying the problem.
2004-08-11 17:20:50 +00:00
Tom Lane 178ec6f40e Fix function definition that somehow missed being ANSI-fied, and align
it with previous prototype to suppress complaints from picky compilers,
per report from Scott Bailey.  Also, remove substitute strerror
definition --- not needed, since we link this with libpgport.
2004-08-11 16:53:28 +00:00
Peter Eisentraut 81cca21818 Allow compilation when CODESET is not defined (OpenBSD). 2004-08-11 11:06:23 +00:00
Peter Eisentraut 7a7ffe944d Translation update 2004-08-11 09:27:20 +00:00
Peter Eisentraut 3ae6531673 Add translation from 7.4 branch to head. 2004-08-11 09:00:27 +00:00
Tom Lane 3fdf649f4f Fix failure to guarantee that a checkpoint will write out pg_clog updates
for transaction commits that occurred just before the checkpoint.  This is
an EXTREMELY serious bug --- kudos to Satoshi Okada for creating a
reproducible test case to prove its existence.
2004-08-11 04:07:16 +00:00
Tom Lane 7d3b7db8da Set DYLD_LIBRARY_PATH so that 'make check' works without prior
'make install' on OS X.  Per suggestion from Adam Witney.
2004-08-10 22:24:06 +00:00
Peter Eisentraut a2ec3fe817 New translation 2004-08-10 19:10:21 +00:00
Peter Eisentraut f781ed4ed8 Translation updates 2004-08-10 19:06:21 +00:00
Peter Eisentraut 73730f49af Translation update 2004-08-10 18:59:57 +00:00
Peter Eisentraut 742781bdab Translation updates 2004-08-10 18:42:22 +00:00
Peter Eisentraut e21e121999 Translation update 2004-08-10 18:38:19 +00:00
Tom Lane 8cf8b47a21 syslogger.c needs <sys/time.h> on some platforms, per Greg Mullane. 2004-08-09 20:28:48 +00:00
Tom Lane b06c907645 Path-mangling logic was failing to account for paths containing mentions
of '.' or '..'.  Extend canonicalize_path() to trim off trailing occurrences
of these things, and use it to fix up paths where needed (which I think is
only after places where we trim the last path component, but maybe some
others will turn up).  Fixes Josh's complaint that './initdb' does not
work.
2004-08-09 20:20:47 +00:00
Tom Lane 35f539b481 When expanding %p in archive_command or restore_command, translate
slashes to backslashes #ifdef WIN32.  This is to cope with the fact
that Windows seems exceedingly unfriendly to slashes in shell commands,
as per recent discussion.
2004-08-09 16:26:06 +00:00
Bruce Momjian 3d642ae7d9 Fix Win32 pg_dumpall check. 2004-08-09 03:12:38 +00:00
Bruce Momjian bc1ca750e8 Improve comment. 2004-08-09 02:12:51 +00:00
Bruce Momjian b942e8700f Stamp libpq.rc with 8.0 version. 2004-08-09 01:55:42 +00:00
Tom Lane 33bf242a8a Make listen_addresses be a comma-separated list instead of a space-separated
list.  More consistent with our other list-containing GUC variables.
2004-08-08 20:17:36 +00:00
Tom Lane dc199eafa7 Document background writer control parameters, do some editorial work
on other recent changes in runtime parameter list.
2004-08-08 19:42:57 +00:00
Tom Lane faafbae720 If these are ifdef WIN32 in the .c file, should be so in .h as well. 2004-08-08 16:13:05 +00:00
Bruce Momjian d5fc378f32 Disable vacuum delay, as discussed on hackers. 2004-08-08 15:37:06 +00:00
Bruce Momjian 640d0dc0f0 Fix compiler warning in the proper way. 2004-08-08 07:00:22 +00:00