Commit Graph

26475 Commits

Author SHA1 Message Date
Tom Lane 7d6e6e2e97 Fix PREPARE TRANSACTION to reject the case where the transaction has dropped a
temporary table; we can't support that because there's no way to clean up the
source backend's internal state if the eventual COMMIT PREPARED is done by
another backend.  This was checked correctly in 8.1 but I broke it in 8.2 :-(.
Patch by Heikki Linnakangas, original trouble report by John Smith.
2008-03-04 19:54:06 +00:00
Magnus Hagander 9b8a93baa4 Use windows DACL fix for pg_regress as well.
Dave Page
2008-03-04 15:38:31 +00:00
Bruce Momjian 2c63d8405b Update pg_dump item:
< 	  produce a single dump output file.
> 	  produce a single dump output file.  It also would require
> 	  several sessions to share the same snapshot.
2008-03-04 14:38:38 +00:00
Bruce Momjian 271205223a Show example of ts_headline() using a configuration name. 2008-03-04 03:17:18 +00:00
Bruce Momjian 60c93d3976 Remove:
<
< 	o To better utilize resources, restore data, primary keys, and
<  	  indexes for a single table before restoring the next table
<
< 	  Hopefully this will allow the CPU-I/O load to be more uniform
< 	  for simultaneous restores.  The idea is to start data restores
< 	  for several objects, and once the first object is done, to move
< 	  on to its primary keys and indexes.  Over time, simultaneous
< 	  data loads and index builds will be running.
2008-03-04 02:48:22 +00:00
Bruce Momjian 66504d763f Add URL for:
o Allow pg_restore to utilize multiple CPUs and I/O channels by
          restoring multiple objects simultaneously

> 	  http://archives.postgresql.org/pgsql-hackers/2008-02/msg00963.php
2008-03-04 01:38:37 +00:00
Bruce Momjian a273d393b7 Add ideas for concurrent pg_dump and pg_restore:
< * pg_dump
> * pg_dump / pg_restore
> 	o Allow pg_dump to utilize multiple CPUs and I/O channels by dumping
> 	  multiple objects simultaneously
>
> 	  The difficulty with this is getting multiple dump processes to
> 	  produce a single dump output file.
> 	  http://archives.postgresql.org/pgsql-hackers/2008-02/msg00205.php
>
> 	o Allow pg_restore to utilize multiple CPUs and I/O channels by
>           restoring multiple objects simultaneously
>
> 	  This might require a pg_restore flag to indicate how many
> 	  simultaneous operations should be performed.  Only pg_dump's
> 	  -Fc format has the necessary dependency information.
>
> 	o To better utilize resources, restore data, primary keys, and
>  	  indexes for a single table before restoring the next table
>
> 	  Hopefully this will allow the CPU-I/O load to be more uniform
> 	  for simultaneous restores.  The idea is to start data restores
> 	  for several objects, and once the first object is done, to move
> 	  on to its primary keys and indexes.  Over time, simultaneous
> 	  data loads and index builds will be running.
>
> 	o To better utilize resources, allow pg_restore to check foreign
> 	  keys simultaneously, where possible
> 	o Allow pg_restore to create all indexes of a table
> 	  concurrently, via a single heap scan
>
> 	  This requires a pg_dump -Fc file because that format contains
>           the required dependency information.
> 	  http://archives.postgresql.org/pgsql-general/2007-05/msg01274.php
>
> 	o Allow pg_restore to load different parts of the COPY data
> 	  simultaneously
<   single heap scan, and have a restore of a pg_dump somehow use it
>   single heap scan, and have pg_restore use it
<   http://archives.postgresql.org/pgsql-general/2007-05/msg01274.php
2008-03-04 01:33:32 +00:00
Bruce Momjian b5aae11c73 Update Japanese FAQ.
Jun Kuwamura
2008-03-03 22:10:51 +00:00
Bruce Momjian a17772c7fb Add:
> * Allow INSERT ... DELETE ... RETURNING, namely allow the DELETE ...
>   RETURNING to supply values to the INSERT
>   http://archives.postgresql.org/pgsql-hackers/2008-02/thrd2.php#00979
2008-03-03 21:26:09 +00:00
Bruce Momjian ca470198a4 Add another URL for:
o Consider using a ring buffer for COPY FROM
<
< http://archives.postgresql.org/pgsql-hackers/2008-02/msg01080.php
> 	  http://archives.postgresql.org/pgsql-hackers/2008-02/msg01080.php
2008-03-03 21:00:35 +00:00
Bruce Momjian 17405109d4 Document that REVOKE doesn't remove all permissions if PUBLIC has permissions. 2008-03-03 19:17:27 +00:00
Bruce Momjian efa67833bb Add:
>
> * Allow the UUID type to accept non-standard formats
>
>   http://archives.postgresql.org/pgsql-hackers/2008-02/msg01214.php
2008-03-03 19:03:44 +00:00
Bruce Momjian 7740991d52 Add:
> * Speed WAL recovery by allowing more than one page to be prefetched
>
>   This involves having a separate process that can be told which pages
>   the recovery process will need in the near future.
>   http://archives.postgresql.org/pgsql-hackers/2008-02/msg01279.php
>
2008-03-03 18:45:24 +00:00
Bruce Momjian 37cb2b776a Remove "reliably" from chr(0) doc mention. 2008-03-03 18:09:02 +00:00
Bruce Momjian dc41fd8869 Document that chr(0) is not supported, and why. 2008-03-03 17:11:13 +00:00
Bruce Momjian 55f037ffe3 Fix markup. 2008-03-03 16:22:55 +00:00
Bruce Momjian 06ae191f90 Add new FAQ item:
<H3 id="item1.15">1.15) How do I unsubscribe from the
    PostgreSQL email lists?  How do I avoid receiving duplicate
    emails?</H3>
2008-03-03 15:55:26 +00:00
Bruce Momjian ceb567c1c1 Add URL's for sequence discussions:
>
>   http://archives.postgresql.org/pgsql-hackers/2008-03/msg00008.php
>
< 	o %Have ALTER TABLE RENAME rename SERIAL sequence names
> 	o Have ALTER TABLE RENAME rename SERIAL sequence names
>
> 	  http://archives.postgresql.org/pgsql-hackers/2008-03/msg00008.php
>
> 	  http://archives.postgresql.org/pgsql-hackers/2008-03/msg00008.php
2008-03-03 15:06:55 +00:00
Michael Meskes fb7b1df083 Fixed bug that caused arrays of varchar to be output with incomplete name.
In the process expanded one test case,
2008-03-02 10:54:11 +00:00
Tom Lane 0f855d621b Venezuela Time now means UTC-4:30, not UTC-4:00. Adjust our treatment
of "VET" accordingly.  Per bug #3997 from Aaron Mizrachi.
2008-03-02 00:10:22 +00:00
Tom Lane d50e256b67 Fix another place that was assuming that a local variable declared as
"struct varlena" would be at least word-aligned.  Per buildfarm results
from gypsy_moth.  I did a little bit of trawling for other instances of
this coding pattern, and didn't find any; but if we turn up any more
of them I think we'd better revert the "char [4]" patch and find another
way of making tuptoaster.c alignment-safe.
2008-03-01 19:26:22 +00:00
Tom Lane e04fa58dcd Fix unportable usages of tolower(). On signed-char machines, it is necessary
to explicitly cast the output back to char before comparing it to a char
value, else we get the wrong result for high-bit-set characters.  Found by
Rolf Jentsch.  Also, fix several places where <ctype.h> functions were being
called without casting the argument to unsigned char; this is likewise
unportable, but we keep making that mistake :-(.  These found by buildfarm
member salamander, which I will desperately miss if it ever goes belly-up.
2008-03-01 03:26:35 +00:00
Tom Lane 3bf822c4d7 Disable the undocumented xmlvalidate() function, which was unintentionally
left in the code though it was not meant to be provided.  It represents a
security hole because unprivileged users could use it to look at (at least the
first line of) any file readable by the backend.  Fortunately, this is only
possible if the backend was built with XML support, so the damage is at least
mitigated; and 8.3 probably hasn't propagated into any security-critical uses
yet anyway.  Per report from Sergey Burladyan.
2008-03-01 02:46:49 +00:00
Andrew Dunstan 64f30bb206 Don't call AddUserToDacl on Cygwin 2008-02-29 23:31:20 +00:00
Alvaro Herrera 7157114d54 Remove long-unused and broken TCL_ARRAYS. 2008-02-29 20:58:33 +00:00
Tom Lane c67f6f2f57 Reducing the assumed alignment of struct varlena means that the compiler
is also licensed to put a local variable declared that way at an unaligned
address.  Which will not work if the variable is then manipulated with
SET_VARSIZE or other macros that assume alignment.  So the previous patch
is not an unalloyed good, but on balance I think it's still a win, since
we have very few places that do that sort of thing.  Fix the one place in
tuptoaster.c that does it.  Per buildfarm results from gypsy_moth
(I'm a bit surprised that only one machine showed a failure).
2008-02-29 17:47:41 +00:00
Magnus Hagander 2d2b022267 Fix handling of restricted processes for Windows Vista (mainly),
by explicitly adding back the user to the DACL of the new process.
This fixes the failure case when executing as the Administrator
user, which had no permissions left at all after we dropped the
Administrators group.

Dave Page with some modifications from me
2008-02-29 15:31:33 +00:00
Bruce Momjian 4db0d87c9d Update wording:
< * Add Oracle-style packages  (Pavel)
> * Add features of Oracle-style packages  (Pavel)
2008-02-29 14:56:50 +00:00
Peter Eisentraut 02504dfd0a Write the objfiles.txt rules in a way that is compatible with GNU make 3.78,
and simpler, too.
2008-02-29 10:34:51 +00:00
Neil Conway ff428cdeda Fix several memory leaks when rescanning SRFs. Arrange for an SRF's
"multi_call_ctx" to be a distinct sub-context of the EState's per-query
context, and delete the multi_call_ctx as soon as the SRF finishes
execution. This avoids leaking SRF memory until the end of the current
query, which is particularly egregious when the SRF is scanned
multiple times. This change also fixes a leak of the fields of the
AttInMetadata struct in shutdown_MultiFuncCall().

Also fix a leak of the SRF result TupleDesc when rescanning a
FunctionScan node. The TupleDesc is allocated in the per-query context
for every call to ExecMakeTableFunctionResult(), so we should free it
after calling that function. Since the SRF might choose to return
a non-expendable TupleDesc, we only free the TupleDesc if it is
not being reference-counted.

Backpatch to 8.3 and 8.2 stable branches.
2008-02-29 02:49:39 +00:00
Magnus Hagander b13635ce59 Support for building contrib/uuid-ossp with MSVC.
Original patch from Hiroshi Saito, modified by me.
2008-02-28 12:17:59 +00:00
Peter Eisentraut b8eef28353 Change expand_subsys function so that it preserves the relative order of
the files passed as argument.  This is desirable so that the dtrace rule
in src/backend/Makefile works.
2008-02-27 20:31:01 +00:00
Tom Lane 1743778d04 If RelationBuildDesc() fails to open a critical system index, PANIC with
a relevant error message instead of just dumping core.  Odd that nobody
reported this before Darren Reed.
2008-02-27 17:44:19 +00:00
Peter Eisentraut 00941eea77 Add more clarification about SSH tunnels from Faheem Mitha. 2008-02-26 18:01:26 +00:00
Peter Eisentraut f49beb3f50 In the SSH setup instructions, change
ssh -L 3333:foo.com:5432 joe@foo.com

I think this should be changed to

ssh -L 3333:localhost:5432 joe@foo.com

The reason is that this assumes the postgres server on foo.com allows
connections from foo.com, which is not allowed by the default
listen_addresses setting.  Add more detail explaining this.

pointed out by Faheem Mitha

Also change the example port number 3333 to 63333 so no one can complain
that we are stealing a reserved port number.
2008-02-26 16:07:16 +00:00
Peter Eisentraut f26203ef32 Add information about format modifiers that apply to numeric formats.
These were previously only documented in the context of date/time formats.
2008-02-26 15:32:30 +00:00
Peter Eisentraut bd929b4909 Fixed dtrace build
found by Magne Mæhre
2008-02-26 14:42:27 +00:00
Peter Eisentraut 9623b727da Don't build the win32 support files in the all target, only in distprep and
when they are actually needed as prerequisites.
2008-02-26 14:26:16 +00:00
Peter Eisentraut f6f8d61a47 Fix uninstall target. 2008-02-26 13:48:57 +00:00
Peter Eisentraut 0e04ee41d0 Create two separate libpq.rc's: One that is built at build time, and one
that is shipped in the distribution, named libpq-dist.rc.  This way the
build system doesn't get upset when a distributed file is forcibly
overwritten by during a normal build.
2008-02-26 13:31:40 +00:00
Peter Eisentraut bdaf90b70f Reorganize some of the exports list generation code. It seems that this
has been reinvented about four different times throughout history (aix,
cygwin, win32, darwin/linux) and a lot of the concepts are actually shared,
which the code now shows better.
2008-02-26 10:45:24 +00:00
Peter Eisentraut 734a56ca2e Escape # character in variable assignment 2008-02-26 10:30:06 +00:00
Peter Eisentraut d391bdac50 Need more dependencies to get the build order right when objfiles.txt
doesn't exist yet.
2008-02-26 08:23:31 +00:00
Peter Eisentraut 3690019da8 We don't need to rebuild objfiles.txt every time an object file changes.
So only rebuild when a makefile changes (which presumably defines the
file list somewhere), and only touch the file if an object changed. The
touch is necessary so the parent make knows something changed and
ultimately rebuilds postgres.
2008-02-26 07:20:38 +00:00
Peter Eisentraut a1d5d85747 Refactor the code that creates the shared library export files to appear
only once in Makefile.shlib and not in four copies.
2008-02-26 06:41:24 +00:00
Tom Lane fd15dba543 Fix encode(...bytea..., 'escape') so that it converts all high-bit-set byte
values into \nnn octal escape sequences.  When the database encoding is
multibyte this is *necessary* to avoid generating invalidly encoded text.
Even in a single-byte encoding, the old behavior seems very hazardous ---
consider for example what happens if the text is transferred to another
database with a different encoding.  Decoding would then yield some other
bytea value than what was encoded, which is surely undesirable.  Per gripe
from Hernan Gonzalez.

Backpatch to 8.3, but not further.  This is a bit of a judgment call, but I
make it on these grounds: pre-8.3 we don't really have much encoding safety
anyway because of the convert() function family, and we would also have much
higher risk of breaking existing apps that may not be expecting this behavior.
8.3 is still new enough that we can probably get away with making this change
in the function's behavior.
2008-02-26 02:54:08 +00:00
Tom Lane bc93919be7 Reject year zero during datetime input, except when it's a 2-digit year
(then it means 2000 AD).  Formerly we silently interpreted this as 1 BC,
which at best is unwarranted familiarity with the implementation.
It's barely possible that some app somewhere expects the old behavior,
though, so we won't back-patch this into existing release branches.
2008-02-25 23:36:28 +00:00
Tom Lane 05506fc4af Fix datetime input to behave correctly for Feb 29 in years BC.
Formerly, DecodeDate attempted to verify the day-of-the-month exactly, but
it was under the misapprehension that it would know whether we were looking
at a BC year or not.  In reality this check can't be made until the calling
function (eg DecodeDateTime) has processed all the fields.  So, split the
BC adjustment and validity checks out into a new function ValidateDate that
is called only after processing all the fields.  In passing, this patch
makes DecodeTimeOnly work for BC inputs, which it never did before.

(The historical veracity of all this is nonexistent, of course, but if
we're going to say we support proleptic Gregorian calendar then we should
do it correctly.  In any case the unpatched code is broken because it could
emit dates that it would then reject on re-inputting.)

Per report from Bernd Helmle.  Back-patch as far as 8.0; in 7.x we were
not using our own calendar support and so this seems a bit too risky
to put into 7.4.
2008-02-25 23:21:01 +00:00
Peter Eisentraut 9956ddc191 Link postgres from all object files at once, to avoid the error-prone
SUBSYS.o step and allow for better optimization by the linker.

Instead of partial linking into SUBSYS.o, the list of object files is
assembled in objfiles.txt files that are expanded when the final
linking is done.

Because we are not yet sure how long command lines different platforms
can handle, the old way of linking is still available, by defining the
make variable PARTIAL_LINKING (e.g., make all PARTIAL_LINKING=1).  If
we determine that this is necessary for some platforms, then we will
document this in a more prominent place.
2008-02-25 17:55:42 +00:00
Tom Lane ad20c990f7 Use our own getopt() and getopt_long() on Solaris, because that platform's
versions don't handle long options the way we want.  Per Zdenek Kotala.
2008-02-24 05:21:54 +00:00