Bruce Momjian [Sun, 8 Aug 2004 06:44:36 +0000 (06:44 +0000)]
Allow libpgport to call memory allocation routines even though
CurrentMemoryContext is DLLIMPORT on Win32. Work around that by
creating stubs in the backend for palloc/pstrdup.
Also fix pg_dumpall to do proper quoting on Win32.
Joe Conway [Sun, 8 Aug 2004 05:01:55 +0000 (05:01 +0000)]
Tighened up syntax checking of array input processing considerably. Junk that
was previously allowed in odd places with odd results now causes an ERROR.
Also changed behavior with respect to whitespace -- trailing whitespace is
now ignored as well as leading whitespace (which has always been ignored).
Documentation updated to reflect change in whitespace handling. Also some
refactoring to what I believe is a more sensible order of several paragraphs.
Tom Lane [Sun, 8 Aug 2004 00:50:58 +0000 (00:50 +0000)]
Update plpgsql documentation for 8.0 (mostly, make use of named
function parameters and dollar quoting in examples; do some polishing
of the existing dollar-quoting docs). The 'how to port from Oracle'
section is looking pretty respectable these days ...
Tom Lane [Sat, 7 Aug 2004 17:40:49 +0000 (17:40 +0000)]
Don't try to rewrite NEW references in a utility statement in a rule.
There won't be any, and in fact there won't even be an RTE for NEW,
which was leading to a core dump in CVS tip. 7.4 and earlier manage
not to crash when applying ResolveNew in this scenario, but I think
it was just good fortune that they didn't. Per report from
Bernd Helmle.
Bruce Momjian [Fri, 6 Aug 2004 18:09:15 +0000 (18:09 +0000)]
I have noticed that the latex format in psql has some bugs:
o "_" is not escaped, and causes TeX to abort, thinking it's a
subscript outside of maths mode. Most of my table and field names
use underscores, so this is a really nasty one.
o The column count is calculated using the contents of opt_align. But
opt_align has one extra element, and so it's always one too many. I
changed it to count the column headings, like all the other output
formats. There may be a bug in computing opt_align that this patch
does not address, but I'm not yet familiar enough with the psql
source to fix this as well.
o The line drawing rules for each border setting (0-3) and expanded
mode didn't always match the documented behaviour and what other
formats (e.g. aligned) did. I made it as conformant as possible,
and also tidied the alignment of the first line of the footer, which
was incorrectly indented.
Tom Lane [Fri, 6 Aug 2004 18:05:49 +0000 (18:05 +0000)]
Use one, not zero, as the default lower bound for arrays of AclItems.
This avoids changing the displayed appearance of ACL columns now that
array_out decorates its output with bounds information when the lower
bound isn't one. Per gripe from Gaetano Mendola. Note that I did not
force initdb for this, although any database initdb'd in the last
couple of days is going to have some problems.
Bruce Momjian [Fri, 6 Aug 2004 17:52:44 +0000 (17:52 +0000)]
Modify:
> * Un-comment all variables in postgresql.conf
84,85c84,85
< By removing comments we prevent the confusion that commenting a line
< returns a modified value to its default, which it does not.
> By not showing commented-out variables, we discourage people from
> thinking that re-commenting a variable returns it to its default.
Tom Lane [Thu, 5 Aug 2004 23:32:13 +0000 (23:32 +0000)]
Create a built-in log rotation program, so that we no longer have to
recommend that people go get Apache's rotatelogs program. Additional
benefits are that configuration is done through GUC, rather than
externally, and that the postmaster can monitor the log rotator and
restart it after failure (though we certainly hope that won't happen
often).
Andreas Pflug, some rework by Tom Lane.
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.