Joe Conway [Thu, 5 Aug 2004 03:30:44 +0000 (03:30 +0000)]
Require that array literals produce "rectangular" arrays, i.e. all the
subarrays of a given dimension have the same number of elements/subarrays.
Also repair a longstanding undocumented (as far as I can see) ability to
explicitly set array bounds in the array literal syntax. It now can
deal properly with negative array indicies. Modify array_out so that
arrays with non-standard lower bounds (i.e. not 1) are output with
the expicit dimension syntax. This fixes a longstanding issue whereby
arrays with non-default lower bounds had them changed to default
after a dump/reload cycle.
Modify regression tests and docs to suit, and add some minimal
documentation regarding the explicit dimension syntax.
Tom Lane [Wed, 4 Aug 2004 20:53:53 +0000 (20:53 +0000)]
Fix silly thinko in ALTER COLUMN TYPE. Check for finding expected
dependency was looking at wrong columns and so would always fail.
Was not exposed by regression tests because we are only testing cases
involving built-in (pinned) types and so no actual dependency entry
exists to be removed.
Tom Lane [Wed, 4 Aug 2004 17:13:03 +0000 (17:13 +0000)]
Dump comments on columns of composite types.
Instead of putting all the OWNER TO commands at the end, it dumps then
after each object. This is WAY more readable and nice. ACLs are still
at the end.
Tom Lane [Tue, 3 Aug 2004 20:32:36 +0000 (20:32 +0000)]
Add functions pg_start_backup, pg_stop_backup to create backup label
and history files as per recent discussion. While at it, remove
pg_terminate_backend, since we have decided we do not have time during
this release cycle to address the reliability concerns it creates.
Split the 'Miscellaneous Functions' documentation section into
'System Information Functions' and 'System Administration Functions',
which hopefully will draw the eyes of those looking for such things.
Tom Lane [Mon, 2 Aug 2004 21:42:18 +0000 (21:42 +0000)]
Fix not-quite-right Assertion. Did not work at all in extended-query
mode (per complaint from Kris Jurka) and it was only by chance that it
didn't fail in simple-query mode. A COMMIT or ROLLBACK has to be
executed by a portal, therefore it's wrong to suppose that there aren't
any live portals at CleanupTransaction time.
Tom Lane [Mon, 2 Aug 2004 17:03:48 +0000 (17:03 +0000)]
Actually, there's no need to use pg_strcasecmp for checking exception
names, because the name we got from the lexer is already downcased.
Just store the table in lower case and use strcmp ...
Tom Lane [Mon, 2 Aug 2004 16:51:10 +0000 (16:51 +0000)]
While perusing SQL92 I realized that we are delivering the wrong SQLSTATE
error code for string-too-long errors. It should be STRING_DATA_RIGHT_TRUNCATION
not STRING_DATA_LENGTH_MISMATCH. The latter probably should only be
applied to cases where a string must be exactly so many bits --- there are
no cases at all where it applies to character strings, only bit strings.
Tom Lane [Mon, 2 Aug 2004 01:30:51 +0000 (01:30 +0000)]
Allow DECLARE CURSOR to take parameters from the portal in which it is
executed. Previously, the DECLARE would succeed but subsequent FETCHes
would fail since the parameter values supplied to DECLARE were not
propagated to the portal created for the cursor.
In support of this, add type Oids to ParamListInfo entries, which seems
like a good idea anyway since code that extracts a value can double-check
that it got the type of value it was expecting.
Oliver Jowett, with minor editorialization by Tom Lane.
Tom Lane [Sun, 1 Aug 2004 20:30:49 +0000 (20:30 +0000)]
Cause ALTER OWNER commands to update the object's ACL, replacing references
to the old owner with the new owner. This is not necessarily right, but
it's sure a lot more likely to be what the user wants than doing nothing.
Christopher Kings-Lynne, some rework by Tom Lane.
Tom Lane [Sun, 1 Aug 2004 17:32:22 +0000 (17:32 +0000)]
Some mop-up work for savepoints (nested transactions). Store a small
number of active subtransaction XIDs in each backend's PGPROC entry,
and use this to avoid expensive probes into pg_subtrans during
TransactionIdIsInProgress. Extend EOXactCallback API to allow add-on
modules to get control at subxact start/end. (This is deliberately
not compatible with the former API, since any uses of that API probably
need manual review anyway.) Add basic reference documentation for
SAVEPOINT and related commands. Minor other cleanups to check off some
of the open issues for subtransactions.
Alvaro Herrera and Tom Lane.
Bruce Momjian [Sun, 1 Aug 2004 05:59:13 +0000 (05:59 +0000)]
>I got a new idea on this. I think we should add an initdb option that
>takes a string to specify the local authentication method:
>
> initdb --auth 'ident'
>
>or whatever the user wants. I think this is more flexible and more
>compact. It would default to 'trust', and the packagers could
>set it to
>whatever they want. If their OS supports local ident, they can use
>that.
>
>Also keep in mind you might want some ident map file:
>
> initdb --auth 'ident mymap'
>
>so you would need to allow multiple words in the string.
Tom Lane [Sat, 31 Jul 2004 23:04:58 +0000 (23:04 +0000)]
Support "OR condition ..." in plpgsql EXCEPTION clauses to make the syntax
more nearly Oracle-equivalent. Allow matching by category as well as
specific error code. Document the set of available condition names
(or more accurately, synchronize it with the existing documentation). In
passing, update errcodes.sgml to include codes added during 7.5 development.
Tom Lane [Sat, 31 Jul 2004 20:55:45 +0000 (20:55 +0000)]
Be more consistent about reporting SPI errors in the various PLs.
Create a shared function to convert a SPI error code into a string
(replacing near-duplicate code in several PLs), and use it anywhere
that a SPI function call error is reported.
Tom Lane [Sat, 31 Jul 2004 19:12:15 +0000 (19:12 +0000)]
Still another try at matching system timezone nicely. On non-Windows
machines, break tie scores by preferring shorter zone names over longer;
for names of equal length, prefer the alphabetically first name. This
yields for example 'EST5EDT' not 'America/New_York' for US eastern time.
On Windows, abandon the whole concept of inspecting the detailed behavior
of the system TZ library, because it doesn't bear inspection :-(. Instead
use a hardwired mapping table to select our zone name based on the
result of strftime %Z output. Windows code from Magnus Hagander.
Tom Lane [Sat, 31 Jul 2004 07:39:21 +0000 (07:39 +0000)]
plpgsql does exceptions.
There are still some things that need refinement; in particular I fear
that the recognized set of error condition names probably has little in
common with what Oracle recognizes. But it's a start.
Bruce Momjian [Sat, 31 Jul 2004 06:19:23 +0000 (06:19 +0000)]
>OK, if you look at the last few commits to interfaces/libpq/win32.mak,
>you will see changes for pg_config_paths.h and for thread safety. Can
>you look at those changes, merge them into bcc.mak. There might be
>other changes in there you want to add to bcc.mak too.
>
>
>
OK, having no M$ diff, I attach files src\interfaces\libpq\bcc32.mak and
src\interfaces\libpq\win32.h
Tom Lane [Sat, 31 Jul 2004 00:45:57 +0000 (00:45 +0000)]
Restructure error handling as recently discussed. It is now really
possible to trap an error inside a function rather than letting it
propagate out to PostgresMain. You still have to use AbortCurrentTransaction
to clean up, but at least the error handling itself will cooperate.
Peter Eisentraut [Fri, 30 Jul 2004 12:26:40 +0000 (12:26 +0000)]
PostgreSQL extension makefile framework ("pgxs"), by Fabien Coelho, with
some massaging by Peter Eisentraut. This is basically a simple
generalization of the existing contrib makefiles.
Tom Lane [Wed, 28 Jul 2004 22:05:47 +0000 (22:05 +0000)]
Revert ill-conceived patch that made elog(FATAL) the same as elog(ERROR)
followed by seeing EOF from client. If we want a safe session-kill
capability we will need to write one, not break our error handling
mechanism.
Tom Lane [Wed, 28 Jul 2004 14:23:31 +0000 (14:23 +0000)]
Fix subtransaction behavior for large objects, temp namespace, files,
password/group files. Also allow read-only subtransactions of a read-write
parent, but not vice versa. These are the reasonably noncontroversial
parts of Alvaro's recent mop-up patch, plus further work on large objects
to minimize use of the TopTransactionResourceOwner.
Tom Lane [Tue, 27 Jul 2004 05:11:48 +0000 (05:11 +0000)]
Replace nested-BEGIN syntax for subtransactions with spec-compliant
SAVEPOINT/RELEASE/ROLLBACK-TO syntax. (Alvaro)
Cause COMMIT of a failed transaction to report ROLLBACK instead of
COMMIT in its command tag. (Tom)
Fix a few loose ends in the nested-transactions stuff.
Tom Lane [Tue, 27 Jul 2004 01:46:03 +0000 (01:46 +0000)]
Fix oversight: in case where SIGTERM is received while there are
live backends, the archiver and stats processes never got sent a
kill signal. They'd eventually exit on their own, but not for awhile,
which is a bit annoying when you are trying to replace the executable
file on a platform that doesn't allow removal of busy executables.
Also, tweak main loop logic so that we will perform the background
tasks after select() returns EINTR.
Bruce Momjian [Mon, 26 Jul 2004 01:48:00 +0000 (01:48 +0000)]
Here is a patch that fixes the pipes used in find_other_exec() when
running as a service on windows <= 2000. Required to make the pg_ctl
service wrapper to work at all.
Tom Lane [Thu, 22 Jul 2004 21:09:37 +0000 (21:09 +0000)]
Add cross-check that current timeline of pg_control is an ancestor of
recovery_target_timeline --- otherwise there is no path from the backup
to the requested timeline. This check was foreseen in the original
discussion but I forgot to implement it.
Tom Lane [Thu, 22 Jul 2004 20:18:40 +0000 (20:18 +0000)]
Add a check on file size as an additional safety check that a WAL file
recovered from archive is not corrupt. It's not much but it will catch
one common problem, viz out-of-disk-space.
Also, force a WAL recovery scan when recovery.conf is present, even if
pg_control shows a clean shutdown. This allows recovery with a tar backup
that was taken with the postmaster shut down, as per complaint from
Mark Kirkwood.
Tom Lane [Thu, 22 Jul 2004 05:28:30 +0000 (05:28 +0000)]
Still another try at automatically detecting the best match in the zic
timezone database for the system behavior we find ourselves in. Scan
backwards from current time and choose the zone that matches furthest
back. As per discussion a week or so back.
Tom Lane [Wed, 21 Jul 2004 22:31:26 +0000 (22:31 +0000)]
Invent WAL timelines, as per recent discussion, to make point-in-time
recovery more manageable. Also, undo recent change to add FILE_HEADER
and WASTED_SPACE records to XLOG; instead make the XLOG page header
variable-size with extra fields in the first page of an XLOG file.
This should fix the boundary-case bugs observed by Mark Kirkwood.
initdb forced due to change of XLOG representation.