OSDN Git Service

pg-rex/syncrep.git
13 years agoSet up PLPerl trigger data using C code instead of Perl code.
Andrew Dunstan [Tue, 1 Feb 2011 14:43:25 +0000 (09:43 -0500)]
Set up PLPerl trigger data using C code instead of Perl code.

This is an efficiency change, and means we now no longer have to run
"out $_TD; local $_TD = shift;", which was especially pointless in the case of
non-trigger functions where the passed value was always undef anyway.

A tiny open issue is whether we should get rid of the $prolog argument of
mkfunc, and the corresponding pushed value, which is now just a constant "false".

Tim Bunce, reviewed by Alex Hunsaker.

13 years agoUndefine setlocale() macro on Win32
Magnus Hagander [Tue, 1 Feb 2011 12:19:18 +0000 (13:19 +0100)]
Undefine setlocale() macro on Win32

New versions of libintl redefine setlocale() to a macro
which causes problems when the backend and libintl are
linked against different versions of the runtime, which
is often the case in msvc builds.

Hiroshi Inoue, slightly updated comment by me

13 years agoRe-classify ERRCODE_DATABASE_DROPPED to 57P04
Simon Riggs [Tue, 1 Feb 2011 08:44:01 +0000 (08:44 +0000)]
Re-classify ERRCODE_DATABASE_DROPPED to 57P04

13 years agoFix wrong error reports in 'number of array dimensions exceeds the
Itagaki Takahiro [Tue, 1 Feb 2011 06:21:32 +0000 (15:21 +0900)]
Fix wrong error reports in 'number of array dimensions exceeds the
maximum allowed' messages, that have reported one-less dimensions.

Alexey Klyukin

13 years agoAdd a link from client_encoding parameter to the list of character sets
Itagaki Takahiro [Tue, 1 Feb 2011 05:26:17 +0000 (14:26 +0900)]
Add a link from client_encoding parameter to the list of character sets
in documentation.

Thom Brown

13 years agoImprove docs for pg_authid encryption description with better markup and
Bruce Momjian [Tue, 1 Feb 2011 03:53:58 +0000 (22:53 -0500)]
Improve docs for pg_authid encryption description with better markup and
a mention of unencrypted passwords.

13 years agoIn pg_authid.rolpassword docs, make "md5" appear as a literal.
Bruce Momjian [Tue, 1 Feb 2011 03:28:42 +0000 (22:28 -0500)]
In pg_authid.rolpassword docs, make "md5" appear as a literal.

13 years agoSupport LIKE and ILIKE index searches via contrib/pg_trgm indexes.
Tom Lane [Tue, 1 Feb 2011 02:33:55 +0000 (21:33 -0500)]
Support LIKE and ILIKE index searches via contrib/pg_trgm indexes.

Unlike Btree-based LIKE optimization, this works for non-left-anchored
search patterns.  The effectiveness of the search depends on how many
trigrams can be extracted from the pattern.  (The worst case, with no
trigrams, degrades to a full-table scan, so this isn't a panacea.  But
it can be very useful.)

Alexander Korotkov, reviewed by Jan Urbanski

13 years agoFix pg_upgrade to create pg_authid restore functions in the 'postgres'
Bruce Momjian [Tue, 1 Feb 2011 01:15:43 +0000 (20:15 -0500)]
Fix pg_upgrade to create pg_authid restore functions in the 'postgres'
database, not in the os-user database, per report from Magnus.

13 years agoCreate new errcode for recovery conflict caused by db drop on master.
Simon Riggs [Tue, 1 Feb 2011 00:20:53 +0000 (00:20 +0000)]
Create new errcode for recovery conflict caused by db drop on 
Previously reported as ERRCODE_ADMIN_SHUTDOWN, this case is now
reported as ERRCODE_T_R_DATABASE_DROPPED. No message text change.
Unlikely to happen on most servers, so low impact change to allow
session poolers to correctly handle this situation.

Tatsuo Ishii, edits by me, review by Robert Haas

13 years agoRemove spurious word, spotted by Thom Brown.
Heikki Linnakangas [Mon, 31 Jan 2011 20:51:51 +0000 (22:51 +0200)]
Remove spurious word, spotted by Thom Brown.

13 years agoUpdate pg_upgrade docs to mention its use in a less risk-warning way,
Bruce Momjian [Mon, 31 Jan 2011 20:21:51 +0000 (15:21 -0500)]
Update pg_upgrade docs to mention its use in a less risk-warning way,
and update the pg_upgrade docs to mention its reliance on no changes to
the storage format (the later based on Robert Haas's patch).

13 years agoFix SGML markup for upgrade doc addition.
Bruce Momjian [Mon, 31 Jan 2011 19:58:49 +0000 (14:58 -0500)]
Fix SGML markup for upgrade doc addition.

13 years agoFix error code for canceling statement due to conflict with recovery.
Simon Riggs [Mon, 31 Jan 2011 19:20:23 +0000 (19:20 +0000)]
Fix error code for canceling statement due to conflict with recovery.
All retryable conflict errors now have an error code that indicates that
a retry is possible, correcting my incomplete fix of 2010/05/12

Tatsuo Ishii and Simon Riggs, input from Robert Haas and Florian Pflug

13 years agoUpdate docs on building for Windows to accomodate current reality.
Andrew Dunstan [Mon, 31 Jan 2011 18:40:45 +0000 (13:40 -0500)]
Update docs on building for Windows to accomodate current reality.

Document how to build 64 bit Windows binaries using the MinGW64 tool set.
Remove recommendation against using Mingw as a build platform.
Be more specific about when Cygwin is useful and when it's not,  in
particular note its usefulness for running psql, and
add a note about building on Cygwin in non-C locales.

Per recent discussions.

13 years agoMove upgrade instructions into its own section under "Server Setup and
Bruce Momjian [Mon, 31 Jan 2011 17:32:03 +0000 (12:32 -0500)]
Move upgrade instructions into its own section under "Server Setup and
Operation", merged from upgrade sections in "Installation from Source
Code" and "Backup and Restore".  This now gives a single place for all
upgrade information.

13 years agoFix typo
Heikki Linnakangas [Mon, 31 Jan 2011 16:29:38 +0000 (18:29 +0200)]
Fix typo

13 years agoSupport multiple concurrent pg_basebackup backups.
Heikki Linnakangas [Mon, 31 Jan 2011 16:13:01 +0000 (18:13 +0200)]
Support multiple concurrent pg_basebackup backups.

With this patch, pg_basebackup doesn't write a backup_label file in the
data directory, so it doesn't interfere with a pg_start/stop_backup() based
backup anymore. backup_label is still included in the backup, but it is
injected directly into the tar stream.

Heikki Linnakangas, reviewed by Fujii Masao and Magnus Hagander.

13 years agoFix typo
Andrew Dunstan [Mon, 31 Jan 2011 01:34:05 +0000 (20:34 -0500)]
Fix typo

13 years agoEnable building with the Mingw64 compiler.
Andrew Dunstan [Mon, 31 Jan 2011 00:56:46 +0000 (19:56 -0500)]
Enable building with the Mingw64 compiler.

This can be used to build 64 bit Windows binaries, not only on 64 bit
Windows but on supported cross-compiling hosts including 32 bit Windows,
Cygwin, Darwin and Linux.

13 years agoMake reduce_outer_joins() smarter about semijoins.
Tom Lane [Sun, 30 Jan 2011 22:04:31 +0000 (17:04 -0500)]
Make reduce_outer_joins() smarter about semijoins.

reduce_outer_joins() mistakenly treated a semijoin like a left join for
purposes of deciding whether not-null constraints created by the join's
quals could be passed down into the join's left-hand side (possibly
resulting in outer-join simplification there).  Actually, semijoin works
like inner join for this purpose, ie, we do not need to see any rows that
can't possibly satisfy the quals.  Hence, two-line fix to treat semi and
inner joins alike.  Per observation by Andres Freund about a performance
gripe from Yazan Suleiman.

Back-patch to 8.4, since this oversight has been there since the current
handling of semijoins was implemented.

13 years agoAdd option to include WAL in base backup
Magnus Hagander [Sun, 30 Jan 2011 20:30:09 +0000 (21:30 +0100)]
Add option to include WAL in base backup

When included, this makes the base backup a complete working
"clone" of the initial database, ready to have a postmaster
started against it without the need to set up any log archiving
or similar.

Magnus Hagander, reviewed by Fujii Masao and Heikki Linnakangas

13 years agoProperly capitalize documentation headings; some only had initial-word
Bruce Momjian [Sat, 29 Jan 2011 18:00:18 +0000 (13:00 -0500)]
Properly capitalize documentation headings;  some only had initial-word
capitalization.

13 years agoMake installation.sgml build standalone again.
Tom Lane [Sat, 29 Jan 2011 17:51:44 +0000 (12:51 -0500)]
Make installation.sgml build standalone again.

We must not try to link to sections that aren't part of the standalone
"make INSTALL" build.  Corrects build failure introduced in commit
159e3d86292cfec2a2828f9f69ac7a6cb1be242d.

13 years agoUse GSSAPI library for SSPI auth, when native SSPI is not available
Magnus Hagander [Sat, 29 Jan 2011 16:06:55 +0000 (17:06 +0100)]
Use GSSAPI library for SSPI auth, when native SSPI is not available

This allows non-Windows clients to connect to a Windows
server with SSPI authentication.

Christian Ullrich, largely modified by me

13 years agoTry to avoid running with a full fsync request queue.
Robert Haas [Sat, 29 Jan 2011 13:08:41 +0000 (08:08 -0500)]
Try to avoid running with a full fsync request queue.

When we need to insert a new entry and the queue is full, compact the
entire queue in the hopes of making room for the new entry.  Doing this
on every insertion might worsen contention on BgWriterCommLock, but
when the queue it's full, it's far better than allowing the backend to
perform its own fsync, per testing by Greg Smith as reported in
http://archives.postgresql.org/pgsql-hackers/2011-01/msg02665.php

Original idea from Greg Smith.  Patch by me.  Review by Chris Browne
and Greg Smith

13 years agoCopy-edit a paragraph in the contrib/seg documentation.
Tom Lane [Fri, 28 Jan 2011 19:34:42 +0000 (14:34 -0500)]
Copy-edit a paragraph in the contrib/seg documentation.

Although this improves the style, an ulterior motive is to keep the two
table links from breaking across lines in PDF output, per complaint from
Josh Kupershmidt.

13 years agoRephrase pg_conversion description to avoid splitting link across page.
Tom Lane [Thu, 27 Jan 2011 23:42:12 +0000 (18:42 -0500)]
Rephrase pg_conversion description to avoid splitting link across page.

The link to the CREATE CONVERSION manual page was split across a page
boundary in the PDF output, leading to "\pdfendlink ended up in different
nesting level than \pdfstartlink" error while building PDFs.

It wouldn't be worth changing text that's undergoing active editing to
avoid this, since other editing might result in moving the link away from
the page end anyway.  But this paragraph has been static for a long time,
so might as well fix it to prevent it from being an issue in future.

13 years agoUpdate release notes.
Tom Lane [Thu, 27 Jan 2011 22:45:37 +0000 (17:45 -0500)]
Update release notes.

Security: CVE-2010-4015

13 years agoPrevent buffer overrun while parsing an integer in a "query_int" value.
Tom Lane [Thu, 27 Jan 2011 22:41:41 +0000 (17:41 -0500)]
Prevent buffer overrun while parsing an integer in a "query_int" value.

contrib/intarray's gettoken() uses a fixed-size buffer to collect an
integer's digits, and did not guard against overrunning the buffer.
This is at least a backend crash risk, and in principle might allow
arbitrary code execution.  The code didn't check for overflow of the
integer value either, which while not presenting a crash risk was still
bad.

Thanks to Apple Inc's security team for reporting this issue and supplying
the fix.

Security: CVE-2010-4015

13 years agoDon't include <asm/ia64regs.h> unnecessarily.
Tom Lane [Thu, 27 Jan 2011 21:27:27 +0000 (16:27 -0500)]
Don't include <asm/ia64regs.h> unnecessarily.

We only need that header when compiling with icc, since the gcc variant of
ia64_get_bsp() uses in-line assembly code.  Per report from Frank Brendel,
the header doesn't exist on all IA64 platforms; so don't include it unless
we need it.

13 years agoUpdate release notes for releases 9.0.3, 8.4.7, 8.3.14, and 8.2.20.
Tom Lane [Thu, 27 Jan 2011 21:09:39 +0000 (16:09 -0500)]
Update release notes for releases 9.0.3, 8.4.7, 8.3.14, and 8.2.20.

13 years agoUpdate psql's \copyright to match the text we have in the COPYRIGHT file.
Heikki Linnakangas [Thu, 27 Jan 2011 18:20:08 +0000 (20:20 +0200)]
Update psql's \copyright to match the text we have in the COPYRIGHT file.

13 years agoImprove grammar and spelling in durability discussion.
Tom Lane [Thu, 27 Jan 2011 17:48:57 +0000 (12:48 -0500)]
Improve grammar and spelling in durability discussion.

13 years agoUpdate non-durable docs about non-synchronous-commit allowing
Bruce Momjian [Thu, 27 Jan 2011 17:06:26 +0000 (12:06 -0500)]
Update non-durable docs about non-synchronous-commit allowing
transaction loss for a _database_ crash.

13 years agoRestore ALTER TABLE .. ADD COLUMN w/DEFAULT restriction.
Robert Haas [Thu, 27 Jan 2011 13:35:34 +0000 (08:35 -0500)]
Restore ALTER TABLE .. ADD COLUMN w/DEFAULT restriction.

This reverts commit a06e41deebdf74b8b5109329dc75b2e9d9057962 of 2011-01-26.
Per discussion, this behavior is not wanted, as it would need to change if
we ever made composite types support DEFAULT.

13 years agoRestructure streaming docs so streaming seems more integrated in the
Bruce Momjian [Thu, 27 Jan 2011 00:54:41 +0000 (19:54 -0500)]
Restructure streaming docs so streaming seems more integrated in the
paragraphs, per suggestion from Dan Birken.

13 years agoChange inv_truncate() to not repeat its systable_getnext_ordered() scan.
Tom Lane [Thu, 27 Jan 2011 00:33:50 +0000 (19:33 -0500)]
Change inv_truncate() to not repeat its systable_getnext_ordered() scan.

In the case where the initial call of systable_getnext_ordered() returned
NULL, this function would nonetheless call it again.  That's undefined
behavior that only by chance failed to not give visibly incorrect results.
Put an if-test around the final loop to prevent that, and in passing
improve some comments.  No back-patch since there's no actual failure.

Per report from YAMAMOTO Takashi.

13 years agoUse -Wformat-security when available
Peter Eisentraut [Wed, 26 Jan 2011 23:23:48 +0000 (01:23 +0200)]
Use -Wformat-security when available

13 years agoautoreconf
Peter Eisentraut [Wed, 26 Jan 2011 23:03:55 +0000 (01:03 +0200)]
autoreconf

Synchronize pg_config.h.in with configure.in (someone must have
forgotten to run autoheader or autoreconf), and clean up some spurious
change in configure introduced by the last commit there.

13 years agoDo not prefix error messages with the string "PL/Python: "
Peter Eisentraut [Wed, 26 Jan 2011 23:00:58 +0000 (01:00 +0200)]
Do not prefix error messages with the string "PL/Python: "

It is redundant, given the error context.

Jan Urbański

13 years agoImprove exception usage in PL/Python
Peter Eisentraut [Wed, 26 Jan 2011 22:47:14 +0000 (00:47 +0200)]
Improve exception usage in PL/Python

Use the built-in TypeError, not SPIError, for errors having to do with
argument counts or types.  Use SPIError, not simply plpy.Error, for
errors in PLy_spi_execute_plan.  Finally, do not set a Python
exception if PyArg_ParseTuple failed, as it already sets the correct
exception.

Jan Urbański

13 years agoAlso save the error detail in SPIError
Peter Eisentraut [Wed, 26 Jan 2011 22:35:28 +0000 (00:35 +0200)]
Also save the error detail in SPIError

The temporarily broken plpython_unicode test shows a case where this
is used.

Do remaining fix-ups on the expected files at the same time.

13 years agoFix compiler warnings
Peter Eisentraut [Wed, 26 Jan 2011 22:18:10 +0000 (00:18 +0200)]
Fix compiler warnings

Older versions of GCC appear to report these with the current standard
option set, newer versions need -Wformat-security.

13 years agoPer Peter E, use 'kB' for kilobyte, not 'K'.
Bruce Momjian [Wed, 26 Jan 2011 21:21:19 +0000 (16:21 -0500)]
Per Peter E, use 'kB' for kilobyte, not 'K'.

13 years agoIn pg_test_fsync, use K(1024) rather than k(1000) for write size units.
Bruce Momjian [Wed, 26 Jan 2011 16:02:52 +0000 (11:02 -0500)]
In pg_test_fsync, use K(1024) rather than k(1000) for write size units.

13 years agoUpdate contrib documention mentions to point to actual documentation
Bruce Momjian [Wed, 26 Jan 2011 14:22:21 +0000 (09:22 -0500)]
Update contrib documention mentions to point to actual documentation
sections, rather than just calling it "/contrib/module_name".

Also update pg_test_fsync build instructions now that it is in /contrib.

13 years agoUpdate sync commit performance documentation to be consistent with other
Bruce Momjian [Wed, 26 Jan 2011 14:15:52 +0000 (09:15 -0500)]
Update sync commit performance documentation to be consistent with other
non-durable items, per Robert Haas.

13 years agoMake 'on' uppercase in a sql example.
Itagaki Takahiro [Wed, 26 Jan 2011 13:35:01 +0000 (22:35 +0900)]
Make 'on' uppercase in a sql example.

13 years agoAdd a comment explaining why we force physical removal of OIDs.
Robert Haas [Wed, 26 Jan 2011 11:42:51 +0000 (06:42 -0500)]
Add a comment explaining why we force physical removal of OIDs.

Noah Misch, slightly revised.

13 years agoRemove arbitrary ALTER TABLE .. ADD COLUMN restriction.
Robert Haas [Wed, 26 Jan 2011 11:23:23 +0000 (06:23 -0500)]
Remove arbitrary ALTER TABLE .. ADD COLUMN restriction.

The previous coding prevented ALTER TABLE .. ADD COLUMN from being used
with a non-NULL default in situations where the table's rowtype was being
used elsewhere.  But this is a completely arbitrary restriction since
you could do the same operation in multiple steps (add the column, add
the default, update the table).

Inspired by a patch from Noah Misch, though I didn't use his code.

13 years agoAdjust pg_test_fsync to always do XLOG_BLCKSZ-sized writes, rather than
Bruce Momjian [Wed, 26 Jan 2011 03:18:24 +0000 (22:18 -0500)]
Adjust pg_test_fsync to always do XLOG_BLCKSZ-sized writes, rather than
always 8k writes, per suggestion from Tom.  Also adjust open_sync output
layout.

13 years agoUpdate warning about synchronous-commit durability, per suggestion from
Bruce Momjian [Wed, 26 Jan 2011 01:32:26 +0000 (20:32 -0500)]
Update warning about synchronous-commit durability, per suggestion from
Robvert Haas.

13 years agoCorrect ALTER TYPE -> SET DATA TYPE in ALTER TABLE documentation.
Robert Haas [Tue, 25 Jan 2011 23:50:35 +0000 (18:50 -0500)]
Correct ALTER TYPE -> SET DATA TYPE in ALTER TABLE documentation.

The latter is the correct name of the operation to change the data type
of a column.

Noah Misch

13 years agoRemove old claim that ExclusiveLock is sometimes taken on system catalogs.
Tom Lane [Tue, 25 Jan 2011 23:39:01 +0000 (18:39 -0500)]
Remove old claim that ExclusiveLock is sometimes taken on system catalogs.

We used to do that on pg_listener, but pg_listener is no more.

Also add a bit more documentation for ShareRowExclusive mode.

13 years agoFix thinko in ALTER FOREIGN TABLE documentation.
Robert Haas [Tue, 25 Jan 2011 22:56:22 +0000 (17:56 -0500)]
Fix thinko in ALTER FOREIGN TABLE documentation.

Noah Misch

13 years agoReplace pg_class.relhasexclusion with pg_index.indisexclusion.
Tom Lane [Tue, 25 Jan 2011 22:51:59 +0000 (17:51 -0500)]
Replace pg_class.relhasexclusion with pg_index.indisexclusion.

There isn't any need to track this state on a table-wide basis, and trying
to do so introduces undesirable semantic fuzziness.  Move the flag to
pg_index, where it clearly describes just a single index and can be
immutable after index creation.

13 years agoImplement ALTER TABLE ADD UNIQUE/PRIMARY KEY USING INDEX.
Tom Lane [Tue, 25 Jan 2011 20:42:03 +0000 (15:42 -0500)]
Implement ALTER TABLE ADD UNIQUE/PRIMARY KEY USING INDEX.

This feature allows a unique or pkey constraint to be created using an
already-existing unique index.  While the constraint isn't very
functionally different from the bare index, it's nice to be able to do that
for documentation purposes.  The main advantage over just issuing a plain
ALTER TABLE ADD UNIQUE/PRIMARY KEY is that the index can be created with
CREATE INDEX CONCURRENTLY, so that there is not a long interval where the
table is locked against updates.

On the way, refactor some of the code in DefineIndex() and index_create()
so that we don't have to pass through those functions in order to create
the index constraint's catalog entries.  Also, in parse_utilcmd.c, pass
around the ParseState pointer in struct CreateStmtContext to save on
notation, and add error location pointers to some error reports that didn't
have one before.

Gurjeet Singh, reviewed by Steve Singer and Tom Lane

13 years agoTypo fix for MemSet size.
Magnus Hagander [Tue, 25 Jan 2011 09:50:04 +0000 (10:50 +0100)]
Typo fix for MemSet size.

Fujii Masao

13 years agoUse consistent spacing for PGAPPICON Makefile option.
Bruce Momjian [Tue, 25 Jan 2011 01:46:30 +0000 (20:46 -0500)]
Use consistent spacing for PGAPPICON Makefile option.

13 years agoUse XLOG_BLCKSZ in pg_test_fsync, rather than our own define, but verify
Bruce Momjian [Tue, 25 Jan 2011 01:07:05 +0000 (20:07 -0500)]
Use XLOG_BLCKSZ in pg_test_fsync, rather than our own define, but verify
it is 8k as expected.

13 years agoIn test_open_sync(), writes kilobytes as intended, not by bytes.
Bruce Momjian [Tue, 25 Jan 2011 00:42:32 +0000 (19:42 -0500)]
In test_open_sync(), writes kilobytes as intended, not by bytes.

13 years agoDocument the "S" option for psql's \dn command in the psql help
Peter Eisentraut [Mon, 24 Jan 2011 23:51:35 +0000 (01:51 +0200)]
Document the "S" option for psql's \dn command in the psql help

This option was recently introduced, but the documentation in help.c
was not updated.

13 years agoCall PLy_spi_execute_fetch_result inside the try/catch block
Peter Eisentraut [Mon, 24 Jan 2011 22:43:25 +0000 (00:43 +0200)]
Call PLy_spi_execute_fetch_result inside the try/catch block

This way errors from fetching tuples are correctly reported as errors
in the SPI call.  While at it, avoid palloc(0).

Jan Urbański

13 years agoRefactor PLy_spi_prepare to save two levels of indentation
Peter Eisentraut [Mon, 24 Jan 2011 20:12:01 +0000 (22:12 +0200)]
Refactor PLy_spi_prepare to save two levels of indentation

Instead of checking whether the arglist is NULL and then if its length
is 0, do it in one step, and outside of the try/catch block.

Jan Urbański

13 years agoMore documentation cleanup for sepgsql.
Robert Haas [Mon, 24 Jan 2011 13:42:44 +0000 (08:42 -0500)]
More documentation cleanup for sepgsql.

Thom Brown and Robert Haas

13 years agoFix typo in the psql \d query handling, so that we use the correct query
Heikki Linnakangas [Mon, 24 Jan 2011 12:30:42 +0000 (14:30 +0200)]
Fix typo in the psql \d query handling, so that we use the correct query
against 9.0 servers.

13 years agoExclude sepgsql from MSVC regression testing as well
Magnus Hagander [Mon, 24 Jan 2011 07:24:31 +0000 (08:24 +0100)]
Exclude sepgsql from MSVC regression testing as well

In passing, change exclusion in the build to follow the
same pattern as other always-excluded modules.

13 years agoSilence compiler warning about uninitialized variable, noted by
Heikki Linnakangas [Mon, 24 Jan 2011 06:28:00 +0000 (08:28 +0200)]
Silence compiler warning about uninitialized variable, noted by
Itagaki Takahiro

13 years agoPGXS support for contrib/hstore
Robert Haas [Mon, 24 Jan 2011 04:07:55 +0000 (23:07 -0500)]
PGXS support for contrib/hstore

Joey Adams

13 years agoBlind attempt to exclude sepgsql from MSVC build system.
Robert Haas [Mon, 24 Jan 2011 03:57:32 +0000 (22:57 -0500)]
Blind attempt to exclude sepgsql from MSVC build system.

13 years agoFirst round of cleanup of sepgsql code and documentation.
Robert Haas [Mon, 24 Jan 2011 03:47:16 +0000 (22:47 -0500)]
First round of cleanup of sepgsql code and documentation.

Robert Haas, with a few suggestions from Thom Brown

13 years agosepgsql, an SE-Linux integration for PostgreSQL
Robert Haas [Mon, 24 Jan 2011 01:44:48 +0000 (20:44 -0500)]
sepgsql, an SE-Linux integration for PostgreSQL

This is still pretty rough - among other things, the documentation
needs work, and the messages need a visit from the style police -
but this gets the basic framework in place.

KaiGai Kohei

13 years agoMake walsender options order-independent
Magnus Hagander [Sun, 23 Jan 2011 22:39:18 +0000 (23:39 +0100)]
Make walsender options order-independent

While doing this, also move base backup options into
a struct instead of increasing the number of parameters
to multiple functions for each new option.

13 years agoReorder includes to unbreak MSVC
Magnus Hagander [Sun, 23 Jan 2011 21:44:07 +0000 (22:44 +0100)]
Reorder includes to unbreak MSVC

13 years agoAdd 'directory' format to pg_dump. The new directory format is compatible
Heikki Linnakangas [Sun, 23 Jan 2011 21:10:15 +0000 (23:10 +0200)]
Add 'directory' format to pg_dump. The new directory format is compatible
with the 'tar' format, in that untarring a tar format archive produces a
valid directory format archive.

Joachim Wieland and Heikki Linnakangas

13 years agoFix another portability issue in pg_basebackup.
Tom Lane [Sun, 23 Jan 2011 19:26:51 +0000 (14:26 -0500)]
Fix another portability issue in pg_basebackup.

The target of sscanf with a %o format had better be of integer width,
but "mode_t" conceivably isn't that.  Another compiler warning seen
only on some platforms; this one I think is potentially a real bug
and not just a warning.

13 years agoImprove getObjectDescription's display of pg_amop and pg_amproc entries.
Tom Lane [Sun, 23 Jan 2011 19:13:46 +0000 (14:13 -0500)]
Improve getObjectDescription's display of pg_amop and pg_amproc entries.

Include the lefttype/righttype columns explicitly (instead of assuming
the reader can deduce them from the operator or function description),
and move the operator or function description to the end of the string,
to make it clearer that it's a referenced object and not the amop or
amproc item itself.  Per extensive discussion of Andreas Karlsson's
original patch.

Andreas Karlsson, Tom Lane

13 years agoRevert "Factor out functions responsible for caching I/O routines".
Tom Lane [Sun, 23 Jan 2011 18:12:55 +0000 (13:12 -0500)]
Revert "Factor out functions responsible for caching I/O routines".

This reverts commit 740e54ca84c437fd67524f97a3ea9ddea752e208, which seems
to have tickled an optimization bug in gcc 4.5.x, as reported upstream at
https://bugzilla.redhat.com/show_bug.cgi?id=671899
Since this patch had no purpose beyond code beautification, it's not
worth expending a lot of effort to look for another workaround.

13 years agoAdd .gitignore file to silence complaints about pg_basebackup.
Tom Lane [Sun, 23 Jan 2011 18:07:34 +0000 (13:07 -0500)]
Add .gitignore file to silence complaints about pg_basebackup.

13 years agoSuppress uninitialized-variable warning.
Tom Lane [Sun, 23 Jan 2011 18:06:38 +0000 (13:06 -0500)]
Suppress uninitialized-variable warning.

13 years agoSilence flex warnings about DOS file paths in MSVC builds
Andrew Dunstan [Sun, 23 Jan 2011 17:24:15 +0000 (12:24 -0500)]
Silence flex warnings about DOS file paths in MSVC builds

13 years agoUse pg_strcasecmp instead of strcasecmp for portability
Magnus Hagander [Sun, 23 Jan 2011 16:35:02 +0000 (17:35 +0100)]
Use pg_strcasecmp instead of strcasecmp for portability

Per buildfarm.

13 years agoOnly show pg_stat_replication details to superusers
Magnus Hagander [Sun, 23 Jan 2011 16:28:19 +0000 (17:28 +0100)]
Only show pg_stat_replication details to superusers

13 years agofilemode is parsed on win32 even if never used
Magnus Hagander [Sun, 23 Jan 2011 13:45:23 +0000 (14:45 +0100)]
filemode is parsed on win32 even if never used

Per buildfarm failure.

13 years agoAdd pg_basebackup tool for streaming base backups
Magnus Hagander [Sun, 23 Jan 2011 11:21:23 +0000 (12:21 +0100)]
Add pg_basebackup tool for streaming base backups

This tool makes it possible to do the pg_start_backup/
copy files/pg_stop_backup step in a single command.

There are still some steps to be done before this is a
complete backup solution, such as the ability to stream
the required WAL logs, but it's still usable, and
could do with some buildfarm coverage.

In passing, make the checkpoint request optionally
fast instead of hardcoding it.

Magnus Hagander, reviewed by Fujii Masao and Dimitri Fontaine

13 years agoCode cleanup for assign_transaction_read_only.
Robert Haas [Sun, 23 Jan 2011 01:51:32 +0000 (20:51 -0500)]
Code cleanup for assign_transaction_read_only.

As in commit fb4c5d2798730f60b102d775f22fb53c26a6445d on 2011-01-21,
this avoids spurious debug messages and allows idempotent changes at
any time.  Along the way, make assign_XactIsoLevel allow idempotent
changes even when not within a subtransaction, to be consistent with
the new coding of assign_transaction_read_only and because there's
no compelling reason to do otherwise.

Kevin Grittner, with some adjustments.

13 years agoQuick hack to un-break plpython regression tests.
Tom Lane [Sun, 23 Jan 2011 01:43:54 +0000 (20:43 -0500)]
Quick hack to un-break plpython regression tests.

It's not clear to me what should happen to the other plpython_unicode
variant expected files, but this patch gets things passing on my own
machines and at least some of the buildfarm.

13 years agoAllow the wal_buffers setting to be auto-tuned to a reasonable value.
Tom Lane [Sun, 23 Jan 2011 01:31:24 +0000 (20:31 -0500)]
Allow the wal_buffers setting to be auto-tuned to a reasonable value.

If wal_buffers is initially set to -1 (which is now the default), it's
replaced by 1/32nd of shared_buffers, with a minimum of 8 (the old default)
and a maximum of the XLOG segment size.  The allowed range for manual
settings is still from 4 up to whatever will fit in shared memory.

Greg Smith, with implementation correction by me.

13 years agoSuppress "control reaches end of non-void function" warning from gcc 4.5.
Tom Lane [Sat, 22 Jan 2011 23:01:31 +0000 (18:01 -0500)]
Suppress "control reaches end of non-void function" warning from gcc 4.5.

Not sure why I'm seeing this on Fedora 14 and not earlier versions.
Seems like a regression that gcc no longer knows that DIE() doesn't return.
Still, adding a dummy return is harmless enough.

13 years agoSuppress possibly-uninitialized-variable warnings from gcc 4.5.
Tom Lane [Sat, 22 Jan 2011 22:56:42 +0000 (17:56 -0500)]
Suppress possibly-uninitialized-variable warnings from gcc 4.5.

It appears that gcc 4.5 can issue such warnings for whole structs, not
just scalar variables as in the past.  Refactor some pg_dump code slightly
so that the OutputContext local variables are always initialized, even
if they won't be used.  It's cheap enough to not be worth worrying about.

13 years agoGet rid of the global variable holding the error state
Peter Eisentraut [Sat, 22 Jan 2011 20:08:51 +0000 (22:08 +0200)]
Get rid of the global variable holding the error state

Global error handling led to confusion and was hard to manage.  With
this change, errors from PostgreSQL are immediately reported to Python
as exceptions.  This requires setting a Python exception after
reporting the caught PostgreSQL error as a warning, because PLy_elog
destroys the Python exception state.

Ideally, all places where PostgreSQL errors need to be reported back
to Python should be wrapped in subtransactions, to make going back to
Python from a longjmp safe.  This will be handled in a separate patch.

Jan Urbański

13 years agoMore pg_test_fsync fixups.
Tom Lane [Sat, 22 Jan 2011 20:01:26 +0000 (15:01 -0500)]
More pg_test_fsync fixups.

Reduce #includes to minimum actually needed; in particular include
postgres_fe.h not postgres.h, so as to stop build failures on some
platforms.

Use get_progname() instead of hardwired program name; improve error
checking for command line syntax; bring error messages into line with
style guidelines; include strerror result in die() cases.

13 years agoSuppress unused-variables warning when OPEN_SYNC_FLAG isn't defined.
Tom Lane [Sat, 22 Jan 2011 17:25:48 +0000 (12:25 -0500)]
Suppress unused-variables warning when OPEN_SYNC_FLAG isn't defined.

Per buildfarm.

13 years agoLink libpgport into pg_test_fsync on msvc
Magnus Hagander [Sat, 22 Jan 2011 17:16:20 +0000 (18:16 +0100)]
Link libpgport into pg_test_fsync on msvc

13 years agoAvoid treating WAL senders as normal backends.
Robert Haas [Sat, 22 Jan 2011 03:20:06 +0000 (22:20 -0500)]
Avoid treating WAL senders as normal backends.

The previous coding treated anything that wasn't an autovacuum launcher
as a normal backend, which is wrong now that we also have WAL senders.

Fujii Masao, reviewed by Robert Haas, Alvaro Herrera, Tom Lane,
and Bernd Helmle.

13 years agoCode cleanup for assign_XactIsoLevel.
Robert Haas [Sat, 22 Jan 2011 02:49:19 +0000 (21:49 -0500)]
Code cleanup for assign_XactIsoLevel.

The new coding avoids a spurious debug message when a transaction
that has changed the isolation level has been rolled back.  It also
allows the property to be freely changed to the current value within
a subtransaction.

Kevin Grittner, with one small change by me.

13 years agoMore pg_test_fsync cleanup.
Tom Lane [Sat, 22 Jan 2011 00:44:53 +0000 (19:44 -0500)]
More pg_test_fsync cleanup.

Un-break Windows build (I hope) by making the HAVE_FSYNC_WRITETHROUGH
code match the backend.  Fix incorrect program help message.  static-ize
all functions.

13 years agoClean up pg_test_fsync commit.
Tom Lane [Sat, 22 Jan 2011 00:27:25 +0000 (19:27 -0500)]
Clean up pg_test_fsync commit.

Actually rename the program, rather than just claiming we did.  Hook it
into the build system.  Get rid of useless dependency on libpq.  Clean up
#include list and messy whitespace.

13 years agoFix broken markup, also minor copy-editing.
Tom Lane [Fri, 21 Jan 2011 23:42:46 +0000 (18:42 -0500)]
Fix broken markup, also minor copy-editing.