Bruce Momjian [Fri, 5 Mar 2004 03:24:50 +0000 (03:24 +0000)]
Thanks to the generous support of Torchbox (http://www.torchbox.com), I
have been able to significantly improve the contrib/xml XPath
integration code.
New features:
* XPath set-returning function allows multiple results from an several
XPath queries to be used as a virtual table.
* Using libxslt, XSLT transformations (with and without parameters) are
supported. (Caution: This support allows generic URL fetching from
within the backend as well).
I've removed the old code so that it is all libxml based. Rather than
attach as a patch, I've put the tar.gz (10k!) at
http://www.azuli.co.uk/pgxml-1.0.tar.gz
(all files in archive are xml/....).
I think this is worth replacing the contrib version with, even though
the function names have changed (though the same functionality is
there), because it includes a SRF and some SPI usage, in addition to
linking to an external library. And it isn't a big module! Obviously, I
understand that people might prefer to move it elsewhere, or might have
reservations about replacing an existing contrib module with an
incompatible one. I'm open to suggestions.
Tom Lane [Fri, 5 Mar 2004 01:53:59 +0000 (01:53 +0000)]
libpq's query to get the OIDs of large-object support functions was not
schema-safe. Make it so, and improve the internal support for knowledge
of server version.
Neil Conway [Thu, 4 Mar 2004 21:47:18 +0000 (21:47 +0000)]
Emit a warning when an empty string is input to the oid, float4, and
float8 types. This begins the deprecation of this feature: in 7.6,
this input will be rejected.
Also added a new error code for warnings about deprecated features,
and updated the regression tests.
The trim function doc did not say that the second argument could be
be omitted. This patch fixes that. It also fixes a bug where the
type text was not wrapped as <type>text</type>.
Neil Conway [Wed, 3 Mar 2004 22:22:24 +0000 (22:22 +0000)]
Add a few more cross-references where appropriate, add more text about
the FROM clause and an example to the UPDATE reference page, and make
a few other SGML tweaks.
Tom Lane [Wed, 3 Mar 2004 21:28:55 +0000 (21:28 +0000)]
Modify pg_dump so that the preferred dump order is by name within
object types, rather than by OID. This should help ensure consistent
dump output from databases that are logically the same but have different
histories, per recent discussion about 'diffing' databases. The patch
is bulky because of renaming of fields, but not very complicated.
Also, do some tweaking to cause BLOB restoration to be done in a better
order, and clean up pg_restore's textual output to exactly match pg_dump.
Bruce Momjian [Wed, 3 Mar 2004 04:22:47 +0000 (04:22 +0000)]
Adds the -W flag to the pwd call under Win32. This allows directories,
which are munged by sed, such as:
/e/cygwin/opt/diff9c/pgsql/src/test/regress/data/agg.data to be
correctly passed as:
e:/cygwin/opt/diff9c/pgsql/src/test/regress/data/agg.data
Tom Lane [Tue, 2 Mar 2004 22:17:34 +0000 (22:17 +0000)]
Remove useless rebuilding of subPlan list during ExecInitNode. Wouldn't
have been there to start with, except for overly enthusiastic copy-and-
paste ...
Tom Lane [Tue, 2 Mar 2004 21:14:44 +0000 (21:14 +0000)]
Always schema-qualify the name of a function referenced in CREATE CAST.
The former coding failed if the cast function was not in the pg_catalog
schema. How'd this escape detection?
Tom Lane [Tue, 2 Mar 2004 18:56:15 +0000 (18:56 +0000)]
Junkfilter logic to force a projection step during SELECT INTO was too
simplistic; it recognized SELECT * FROM but not SELECT * FROM LIMIT.
Per bug report from Jeff Bohmer.
Tom Lane [Tue, 2 Mar 2004 16:42:20 +0000 (16:42 +0000)]
Teach is_distinct_query to recognize that GROUP BY forces a subquery's
output to be distinct, if all the GROUP BY columns appear in the output.
Per suggestion from Dennis Haney.
Neil Conway [Mon, 1 Mar 2004 17:58:39 +0000 (17:58 +0000)]
Add a few more xrefs, where they seemed appropriate: for example, refer
to the discussion of planner statistics in the documentation for the
default_statistics_target GUC var.
Tom Lane [Sun, 29 Feb 2004 17:36:05 +0000 (17:36 +0000)]
make_sort_from_pathkeys()'s method for choosing which of several
equivalent sort expressions to use was broken: you can't just look
at the relation membership, you have to actually grovel over the
individual Vars in each expression. I think this did work when it
was written, but it was broken by subsequent optimizations that made
join relations not propagate every single input variable upward.
Must find the Var that got propagated, not choose one at random.
Per bug report from Daniel O'Neill.
Neil Conway [Sun, 29 Feb 2004 15:45:53 +0000 (15:45 +0000)]
Fix a typo in a recent commit to func.sgml that apparently broke the doc
build for some versions of OpenJade (unfortunately, my local version of
OpenJade didn't report the error...) -- thanks to Andrew Dunstan for
the report.
Tom Lane [Fri, 27 Feb 2004 21:48:04 +0000 (21:48 +0000)]
Adjust remove_redundant_join_clauses() so that when it has a choice
of which redundant clause to remove, it removes the more expensive one.
In simple scenarios the clauses will be like 'var = var' and there's
no difference, but we are now capable of considering cases where there
are sub-selects in the clauses, and it makes a BIG difference.
Tom Lane [Fri, 27 Feb 2004 21:44:34 +0000 (21:44 +0000)]
genericcostestimate() neglected to include qual startup cost in
indexTotalCost. I think this may not make any real difference in 7.4,
but it definitely is a problem with CVS tip's new equation.
Tom Lane [Fri, 27 Feb 2004 21:42:00 +0000 (21:42 +0000)]
process_implied_equality must copy the substructure of the clauses it
is generating, to avoid problems when subselects are involved. Per
report from Damon Hart.
Neil Conway [Fri, 27 Feb 2004 03:59:23 +0000 (03:59 +0000)]
Fix a few omissions in the initcap() documentation & source code
comments, make some unrelated improvements to the functions
documentation, and perform some minor consistency cleanup
elsewhere. Original initcap() change from Dennis B., additional
changes by Neil C.
Tom Lane [Tue, 24 Feb 2004 22:59:10 +0000 (22:59 +0000)]
anyarray really needs to be declared with typalign = 'd', so that entries
in pg_statistic are correctly aligned if they contain values that require
double alignment. Too bad we cannot force initdb for this in 7.4 branch.
Tom Lane [Tue, 24 Feb 2004 22:06:32 +0000 (22:06 +0000)]
Add %option nodefault to all our flex lexers. Fix a couple of rule gaps
exposed thereby. AFAICT these would not lead to any worse problems than
junk emitted on the backend's stdout, but we should have the option to
catch possible worse errors in future.
Tom Lane [Tue, 24 Feb 2004 21:45:18 +0000 (21:45 +0000)]
Implement dollar-quoting in the backend lexer and psql. Documentation
is still lacking, as is support in plpgsql and other places, but this is
the basic feature. Patch by Andrew Dunstan, some tweaking by Tom Lane.
Also, enable %option nodefault in these two lexers, and patch some gaps
revealed thereby.
Joe Conway [Tue, 24 Feb 2004 06:07:18 +0000 (06:07 +0000)]
When returning type "record", replace use of pgresultGetTupleDesc
with ReturnSetInfo->expectedDesc. This allows custom datatypes
(e.g. from tsearch2) to be returned at runtime. Previous behavior
depended on the type oid to match between the remote and local
database, which obviously doesn't work well for custom types.
Per report from Mark Gibson.
Tom Lane [Tue, 24 Feb 2004 03:35:19 +0000 (03:35 +0000)]
Cause pg_dump to emit a 'SET client_encoding' command at the start of
any restore operation, thereby ensuring that dumped data is interpreted
the same way it was dumped even if the target database has a different
encoding. Per suggestions from Pavel Stehule and others. Also,
simplify scheme for handling check_function_bodies ... we may as well
just set that at the head of the script.
Tom Lane [Mon, 23 Feb 2004 23:03:10 +0000 (23:03 +0000)]
Replace opendir/closedir calls throughout the backend with AllocateDir
and FreeDir routines modeled on the existing AllocateFile/FreeFile.
Like the latter, these routines will avoid failing on EMFILE/ENFILE
conditions whenever possible, and will prevent leakage of directory
descriptors if an elog() occurs while one is open.
Also, reduce PANIC to ERROR in MoveOfflineLogs() --- this is not
critical code and there is no reason to force a DB restart on failure.
All per recent trouble report from Olivier Hubaut.
Tom Lane [Mon, 23 Feb 2004 20:45:59 +0000 (20:45 +0000)]
Do a direct probe during postmaster startup to determine the maximum
number of openable files and the number already opened. This eliminates
depending on sysconf(_SC_OPEN_MAX), and allows much saner behavior on
platforms where open-file slots are used up by semaphores.
Tom Lane [Sun, 22 Feb 2004 21:26:55 +0000 (21:26 +0000)]
Move responsibility for copying argv[] array into ps_status.c, where it
logically belongs. Arrange to update the _NSGetArgv() copy of the argv
pointer on Darwin. (It seems likely that other NeXT-derived platforms
also have an _NSGetArgv() problem, but until we have some reports I'll
just make this #ifdef __darwin__.)
Tom Lane [Sat, 21 Feb 2004 00:34:53 +0000 (00:34 +0000)]
Implement a solution to the 'Turkish locale downcases I incorrectly'
problem, per previous discussion. Make some additional changes to
centralize the knowledge of just how identifier downcasing is done,
in hopes of simplifying any future tweaking in this area.
Tom Lane [Thu, 19 Feb 2004 19:40:09 +0000 (19:40 +0000)]
Re-implement psql's input scanning to use a flex-generated lexer, as per
recent discussion. The lexer is used for both SQL command text and
backslash commands. The purpose of this change is to make it easier to
track the behavior of the backend's SQL lexer --- essentially identical
flex rules are now used by psql. Also, this cleans up a lot of very
squirrelly code in mainloop.c and command.c. The flex code is somewhat
bulkier than the removed code, but should be lots easier to maintain.
Neil Conway [Wed, 18 Feb 2004 00:01:34 +0000 (00:01 +0000)]
Improve the consistency of the error message emitted when rejecting
invalid input to the oid type. Also, remove some long-unused code
from adt/numutils.c
Neil Conway [Tue, 17 Feb 2004 06:28:05 +0000 (06:28 +0000)]
Significant improvements to the documentation for the new cost-based
vacuum delay feature, including updating the docs for Tom's recent
improvements. There is still more work to be done here: for example,
adding some more information on the practical use of cost-based
vacuum delay to the "maintenance" section would probably be a good
idea.
Bruce Momjian [Tue, 17 Feb 2004 03:54:57 +0000 (03:54 +0000)]
This patch brings up to date what I did last year (now unfortunately
bitrotted) to allow the logging of the end of a session, enabled by
the config setting "log_disconnections".
Bruce Momjian [Tue, 17 Feb 2004 03:45:17 +0000 (03:45 +0000)]
Here is an updated version of the win32 readdir patch.
1) Now puts in exactly the same change as the current-cvs mingw code
does. (see
http://cvs.sourceforge.net/viewcvs.py/mingw/runtime/mingwex/dirent.c?r1=
1.3&r2=1.4, second part of the patch).
2) Updates both xlog.c and slru.c in backend/access/transam/
3) Also updates pg_resetxlog, which also uses readdir() and checks the
errno value after the loop.
Bruce Momjian [Tue, 17 Feb 2004 03:35:57 +0000 (03:35 +0000)]
Under Win32, stat() returns an st_ino field, but it has no meaning (on
Win2K, and possibly all Win32 variants, it is always 0). This causes a
number of problems in the dfmgr.c logic, which basically all revolve
around the fact that *any* two files will appear to have the same inode.
Bruce Momjian [Tue, 17 Feb 2004 03:34:35 +0000 (03:34 +0000)]
Please apply this patch to contrib/dbmirror
In incorperates changes from myself and a number of contributors.
This update to dbmirror provides:
-replication of sequence operations via setval/nextval
-DBMirror.pl support for logging to syslog
-changed the names of the tables to dbmirror_* (no quotes required)
-Support for writitng SQL statements to files instead of directly to
a slave database
-More options for DBMirror.pl in the config files.
Tom Lane [Tue, 17 Feb 2004 00:52:53 +0000 (00:52 +0000)]
Make use of statistics on index expressions. There are still some
corner cases that could stand improvement, but it does all the basic
stuff. A byproduct is that the selectivity routines are no longer
constrained to working on simple Vars; we might in future be able to
improve the behavior for subexpressions that don't match indexes.