users/andresfreund/postgres.git
11 years agoFix jsonb_exists_all
Peter Geoghegan [Fri, 7 Mar 2014 09:31:47 +0000 (01:31 -0800)]
Fix jsonb_exists_all

11 years agoConsistently use new 'object' nomenclature for associative structure
Peter Geoghegan [Fri, 7 Mar 2014 08:51:48 +0000 (00:51 -0800)]
Consistently use new 'object' nomenclature for associative structure

11 years agoRemove ill-considered @ operator
Peter Geoghegan [Fri, 7 Mar 2014 08:13:25 +0000 (00:13 -0800)]
Remove ill-considered @ operator

11 years agoRegression test whitespace
Peter Geoghegan [Fri, 7 Mar 2014 07:45:22 +0000 (23:45 -0800)]
Regression test whitespace

11 years agoFix broken GiST compression
Peter Geoghegan [Fri, 7 Mar 2014 07:41:10 +0000 (23:41 -0800)]
Fix broken GiST compression

Forgot to detoast ghstore value during compression.

11 years agoWhitespace
Peter Geoghegan [Fri, 7 Mar 2014 05:38:10 +0000 (21:38 -0800)]
Whitespace

11 years agoMinor style tweaks
Peter Geoghegan [Fri, 7 Mar 2014 03:17:23 +0000 (19:17 -0800)]
Minor style tweaks

11 years agoFix hash gin opclass in tests
Peter Geoghegan [Fri, 7 Mar 2014 02:43:55 +0000 (18:43 -0800)]
Fix hash gin opclass in tests

11 years agoMerge branch 'jsonb-test-fixes' into jsonb_and_hstore
Peter Geoghegan [Fri, 7 Mar 2014 02:31:49 +0000 (18:31 -0800)]
Merge branch 'jsonb-test-fixes' into jsonb_and_hstore

Adds some regression tests previously in hstore2 to core's jsonb
datatype.

11 years agoDocument various operator classes
Peter Geoghegan [Fri, 7 Mar 2014 02:30:04 +0000 (18:30 -0800)]
Document various operator classes

11 years agoMove remaining jsonb.data tests
Maciek Sakrejda [Fri, 7 Mar 2014 02:07:24 +0000 (18:07 -0800)]
Move remaining jsonb.data tests

11 years agoRemove bulk of observations on jsonb from notes section
Peter Geoghegan [Fri, 7 Mar 2014 01:45:39 +0000 (17:45 -0800)]
Remove bulk of observations on jsonb from notes section

11 years agoRemove hstore tests ported to jsonb
Maciek Sakrejda [Fri, 7 Mar 2014 01:38:07 +0000 (17:38 -0800)]
Remove hstore tests ported to jsonb

11 years agoAdd jsonb_each and sort/hash tests
Maciek Sakrejda [Fri, 7 Mar 2014 01:35:38 +0000 (17:35 -0800)]
Add jsonb_each and sort/hash tests

11 years agoFix existing scan tests; add gin
Maciek Sakrejda [Fri, 7 Mar 2014 01:03:34 +0000 (17:03 -0800)]
Fix existing scan tests; add gin

11 years agoBetter wording of what the operators are
Peter Geoghegan [Fri, 7 Mar 2014 00:35:12 +0000 (16:35 -0800)]
Better wording of what the operators are

11 years agoFix expected output
Maciek Sakrejda [Fri, 7 Mar 2014 00:34:11 +0000 (16:34 -0800)]
Fix expected output

11 years agoMore polish for documentation
Peter Geoghegan [Fri, 7 Mar 2014 00:24:17 +0000 (16:24 -0800)]
More polish for documentation

11 years agoAdd basic scan tests
Maciek Sakrejda [Thu, 6 Mar 2014 23:56:46 +0000 (15:56 -0800)]
Add basic scan tests

11 years agoAdd jsonb equality/inequality tests
Maciek Sakrejda [Thu, 6 Mar 2014 22:16:40 +0000 (14:16 -0800)]
Add jsonb equality/inequality tests

11 years agoAdd error tests for jsonb_extract_path on scalars
Maciek Sakrejda [Thu, 6 Mar 2014 22:05:46 +0000 (14:05 -0800)]
Add error tests for jsonb_extract_path on scalars

11 years agoAdd failing test cases where applicable
Maciek Sakrejda [Thu, 6 Mar 2014 21:49:19 +0000 (13:49 -0800)]
Add failing test cases where applicable

11 years agoTypo fix
Maciek Sakrejda [Thu, 6 Mar 2014 21:17:18 +0000 (13:17 -0800)]
Typo fix

11 years agoAdditional reformatting
Maciek Sakrejda [Thu, 6 Mar 2014 21:15:39 +0000 (13:15 -0800)]
Additional reformatting

11 years agoReformat jsonb tests for terseness
Maciek Sakrejda [Thu, 6 Mar 2014 21:04:11 +0000 (13:04 -0800)]
Reformat jsonb tests for terseness

11 years agoThey're text arrays
Peter Geoghegan [Thu, 6 Mar 2014 23:17:23 +0000 (15:17 -0800)]
They're text arrays

11 years agoFirst cut at documenting new operators
Peter Geoghegan [Thu, 6 Mar 2014 23:10:59 +0000 (15:10 -0800)]
First cut at documenting new operators

11 years agoRevert hstore_op.c bug fix change, already integrated to core
Peter Geoghegan [Thu, 6 Mar 2014 19:29:45 +0000 (11:29 -0800)]
Revert hstore_op.c bug fix change, already integrated to core

11 years agoMerge remote-tracking branch 'feodor/jsonb_and_hstore' into jsonb_and_hstore
Peter Geoghegan [Thu, 6 Mar 2014 19:28:12 +0000 (11:28 -0800)]
Merge remote-tracking branch 'feodor/jsonb_and_hstore' into jsonb_and_hstore

11 years agoMore removal of hstore vistiges, remove dead struct
Peter Geoghegan [Thu, 6 Mar 2014 18:59:23 +0000 (10:59 -0800)]
More removal of hstore vistiges, remove dead struct

11 years agofix jsonb_hash() - now it uses correct hashing for numeric value
Peter Geoghegan [Thu, 6 Mar 2014 18:50:38 +0000 (10:50 -0800)]
fix jsonb_hash() - now it uses correct hashing for numeric value

11 years agofix hstore_hash() - now it uses correct hashing for numeric value
Teodor Sigaev [Thu, 6 Mar 2014 12:23:57 +0000 (16:23 +0400)]
fix hstore_hash() - now it uses correct hashing for numeric value

11 years agoRemove hstore_to_json tests, which are not really necessary in light of clean break
Peter Geoghegan [Thu, 6 Mar 2014 09:24:53 +0000 (01:24 -0800)]
Remove hstore_to_json tests, which are not really necessary in light of clean break

11 years agoMove more support functions in private modules
Peter Geoghegan [Thu, 6 Mar 2014 08:33:42 +0000 (00:33 -0800)]
Move more support functions in private modules

11 years agoTweak jsonb.h header once more
Peter Geoghegan [Thu, 6 Mar 2014 08:12:19 +0000 (00:12 -0800)]
Tweak jsonb.h header once more

11 years agoRe-ordering within jsonb.h some more
Peter Geoghegan [Thu, 6 Mar 2014 08:03:37 +0000 (00:03 -0800)]
Re-ordering within jsonb.h some more

11 years agoMacros can live in jsonb_support.c
Peter Geoghegan [Thu, 6 Mar 2014 07:56:04 +0000 (23:56 -0800)]
Macros can live in jsonb_support.c

11 years agoRefactor
Peter Geoghegan [Thu, 6 Mar 2014 07:46:30 +0000 (23:46 -0800)]
Refactor

Remove dead code. Shape up jsonb.h.

11 years agoWhitespace
Peter Geoghegan [Thu, 6 Mar 2014 07:11:41 +0000 (23:11 -0800)]
Whitespace

11 years agoRemove unused idx functions
Peter Geoghegan [Thu, 6 Mar 2014 07:07:02 +0000 (23:07 -0800)]
Remove unused idx functions

11 years agoAdd headers, clean-up a bit for core
Peter Geoghegan [Thu, 6 Mar 2014 07:03:13 +0000 (23:03 -0800)]
Add headers, clean-up a bit for core

11 years agoRevert changes to hstore; formalize notion that jsonb and hstore are fully separate
Peter Geoghegan [Thu, 6 Mar 2014 06:39:58 +0000 (22:39 -0800)]
Revert changes to hstore; formalize notion that jsonb and hstore are fully separate

11 years agogin hash opclass added, all opclass sanity checks pass
Peter Geoghegan [Thu, 6 Mar 2014 06:21:14 +0000 (22:21 -0800)]
gin hash opclass added, all opclass sanity checks pass

11 years agoGIN regression opclass passing
Peter Geoghegan [Thu, 6 Mar 2014 06:05:34 +0000 (22:05 -0800)]
GIN regression opclass passing

11 years agoRemove hstore tests that just reflect change in output format
Peter Geoghegan [Thu, 6 Mar 2014 05:10:33 +0000 (21:10 -0800)]
Remove hstore tests that just reflect change in output format

11 years agoUse PG_GETARG_JSONB consistently
Peter Geoghegan [Thu, 6 Mar 2014 04:42:31 +0000 (20:42 -0800)]
Use PG_GETARG_JSONB consistently

11 years agoFix bug, GiST works
Peter Geoghegan [Thu, 6 Mar 2014 04:33:23 +0000 (20:33 -0800)]
Fix bug, GiST works

11 years agoNot compatible
Peter Geoghegan [Thu, 6 Mar 2014 03:22:27 +0000 (19:22 -0800)]
Not compatible

11 years agoGiST in core passes regression tests
Peter Geoghegan [Thu, 6 Mar 2014 03:07:39 +0000 (19:07 -0800)]
GiST in core passes regression tests

11 years agoAdd contains and contained alt operators
Peter Geoghegan [Thu, 6 Mar 2014 01:54:09 +0000 (17:54 -0800)]
Add contains and contained alt operators

11 years ago?& operator
Peter Geoghegan [Thu, 6 Mar 2014 01:06:38 +0000 (17:06 -0800)]
?& operator

11 years agoAdd ?| operator proper
Peter Geoghegan [Thu, 6 Mar 2014 01:01:24 +0000 (17:01 -0800)]
Add ?| operator proper

11 years ago? operator
Peter Geoghegan [Thu, 6 Mar 2014 00:55:27 +0000 (16:55 -0800)]
? operator

11 years agoAdd contains operator
Peter Geoghegan [Thu, 6 Mar 2014 00:43:04 +0000 (16:43 -0800)]
Add contains operator

11 years agoReorder GIN stuff, organize jsonb header, expunge remaining hstore references
Peter Geoghegan [Thu, 6 Mar 2014 00:18:21 +0000 (16:18 -0800)]
Reorder GIN stuff, organize jsonb header, expunge remaining hstore references

11 years agoOrder GiST procs by strategy number
Peter Geoghegan [Thu, 6 Mar 2014 00:09:23 +0000 (16:09 -0800)]
Order GiST procs by strategy number

11 years agoFix up GIN + GiST headers, declarations
Peter Geoghegan [Wed, 5 Mar 2014 23:50:27 +0000 (15:50 -0800)]
Fix up GIN + GiST headers, declarations

11 years agohash indexes work. Fix a few regression tests for opclasses too.
Peter Geoghegan [Wed, 5 Mar 2014 23:39:25 +0000 (15:39 -0800)]
hash indexes work. Fix a few regression tests for opclasses too.

11 years agoMerge branch 'master' into jsonb_and_hstore
Peter Geoghegan [Wed, 5 Mar 2014 23:00:15 +0000 (15:00 -0800)]
Merge branch 'master' into jsonb_and_hstore

Conflicts:
src/backend/catalog/system_views.sql

11 years agoEncourage jsonb opclass usage
Peter Geoghegan [Wed, 5 Mar 2014 22:54:50 +0000 (14:54 -0800)]
Encourage jsonb opclass usage

11 years agoGut most new jsonb stuff
Peter Geoghegan [Wed, 5 Mar 2014 22:51:35 +0000 (14:51 -0800)]
Gut most new jsonb stuff

11 years agoIn-core btree opclass works
Peter Geoghegan [Wed, 5 Mar 2014 21:53:18 +0000 (13:53 -0800)]
In-core btree opclass works

11 years agoFirst cut
Peter Geoghegan [Wed, 5 Mar 2014 02:59:17 +0000 (18:59 -0800)]
First cut

11 years agoMerge remote-tracking branch 'feodor/jsonb_and_hstore' into jsonb_and_hstore
Peter Geoghegan [Tue, 4 Mar 2014 22:57:52 +0000 (14:57 -0800)]
Merge remote-tracking branch 'feodor/jsonb_and_hstore' into jsonb_and_hstore

11 years agoProvide a FORCE NULL option to COPY in CSV mode.
Andrew Dunstan [Tue, 4 Mar 2014 22:31:59 +0000 (17:31 -0500)]
Provide a FORCE NULL option to COPY in CSV mode.

This forces an input field containing the quoted null string to be
returned as a NULL. Without this option, only unquoted null strings
behave this way. This helps where some CSV producers insist on quoting
every field, whether or not it is needed. The option takes a list of
fields, and only applies to those columns. There is an equivalent
column-level option added to file_fdw.

Ian Barwick, with some tweaking by Andrew Dunstan, reviewed by Payal
Singh.

11 years agoauto_explain: Add logging of trigger execution
Alvaro Herrera [Tue, 4 Mar 2014 18:31:18 +0000 (15:31 -0300)]
auto_explain: Add logging of trigger execution

Author: Kyotaro HORIGUCHI
Reviewed-by: Jaime Casanova
11 years agoConstructors for interval, timestamp, timestamptz
Alvaro Herrera [Tue, 4 Mar 2014 18:09:43 +0000 (15:09 -0300)]
Constructors for interval, timestamp, timestamptz

Author: Pavel Stěhule, editorialized somewhat by Álvaro Herrera
Reviewed-by: Tomáš Vondra, Marko Tiikkaja
With input from Fabrízio de Royes Mello, Jim Nasby

11 years agoforgot to commit tests
Teodor Sigaev [Tue, 4 Mar 2014 16:44:21 +0000 (20:44 +0400)]
forgot to commit tests

11 years agoAllow VACUUM FULL/CLUSTER to bump freeze horizons even for pg_class.
Robert Haas [Tue, 4 Mar 2014 16:08:18 +0000 (11:08 -0500)]
Allow VACUUM FULL/CLUSTER to bump freeze horizons even for pg_class.

pg_class is a special case for CLUSTER and VACUUM FULL, so although
commit 3cff1879f8d03cb729368722ca823a4bf74c0cac caused these
operations to advance relfrozenxid and relminmxid for all other
tables, it did not provide the same benefit for pg_class.  This
plugs that gap.

Andres Freund

11 years agoMinor corrections to logical decoding patch.
Robert Haas [Tue, 4 Mar 2014 16:07:54 +0000 (11:07 -0500)]
Minor corrections to logical decoding patch.

11 years agoError out on send failure in walsender loop.
Heikki Linnakangas [Tue, 4 Mar 2014 13:30:52 +0000 (15:30 +0200)]
Error out on send failure in walsender loop.

I changed the loop in 9.3 to use "goto send_failure" instead of "break" on
errors, but I missed this one case. It was a relatively harmless bug: if
the flush fails once it will most likely fail again as soon as we try to
flush the output again. But it's a bug nevertheless.

Report and fix by Andres Freund.

11 years agomake numeric in hstore/jsonb compare indepent from precision/locale
Teodor Sigaev [Tue, 4 Mar 2014 11:47:16 +0000 (15:47 +0400)]
make numeric in hstore/jsonb compare indepent from precision/locale

11 years agoRevert "move jsonb to contrib"
Peter Geoghegan [Tue, 4 Mar 2014 01:37:04 +0000 (17:37 -0800)]
Revert "move jsonb to contrib"

This reverts commit aa6166de2cdcd7ecd5d93bb1c41fa2fd38b821dd.

11 years agoIntroduce logical decoding.
Robert Haas [Mon, 3 Mar 2014 21:32:18 +0000 (16:32 -0500)]
Introduce logical decoding.

This feature, building on previous commits, allows the write-ahead log
stream to be decoded into a series of logical changes; that is,
inserts, updates, and deletes and the transactions which contain them.
It is capable of handling decoding even across changes to the schema
of the effected tables.  The output format is controlled by a
so-called "output plugin"; an example is included.  To make use of
this in a real replication system, the output plugin will need to be
modified to produce output in the format appropriate to that system,
and to perform filtering.

Currently, information can be extracted from the logical decoding
system only via SQL; future commits will add the ability to stream
changes via walsender.

Andres Freund, with review and other contributions from many other
people, including Álvaro Herrera, Abhijit Menon-Sen, Peter Gheogegan,
Kevin Grittner, Robert Haas, Heikki Linnakangas, Fujii Masao, Abhijit
Menon-Sen, Michael Paquier, Simon Riggs, Craig Ringer, and Steve
Singer.

11 years agoFix whitespace
Peter Eisentraut [Mon, 3 Mar 2014 19:05:33 +0000 (14:05 -0500)]
Fix whitespace

11 years agoRename huge_tlb_pages to huge_pages, and improve docs.
Heikki Linnakangas [Mon, 3 Mar 2014 18:52:48 +0000 (20:52 +0200)]
Rename huge_tlb_pages to huge_pages, and improve docs.

Christian Kruse

11 years agopg_dump et al: Add --if-exists option
Alvaro Herrera [Mon, 3 Mar 2014 18:02:18 +0000 (15:02 -0300)]
pg_dump et al: Add --if-exists option

This option makes pg_dump, pg_dumpall and pg_restore inject an IF EXISTS
clause to each DROP command they emit.  (In pg_dumpall, the clause is
not added to individual objects drops, but rather to the CREATE DATABASE
commands, as well as CREATE ROLE and CREATE TABLESPACE.)

This allows for a better user dump experience when using --clean in case
some objects do not already exist.  Per bug #7873 by Dave Rolsky.

Author: Pavel Stěhule
Reviewed-by: Jeevan Chalke, Álvaro Herrera, Josh Kupershmidt
11 years agoUse a longer buffer in libpqrcv_startstreaming.
Robert Haas [Mon, 3 Mar 2014 12:24:52 +0000 (07:24 -0500)]
Use a longer buffer in libpqrcv_startstreaming.

Because of the new SLOT clause in the START_REPLICATION command, it's
possible for the command to end up too long for the old maximum buffer
length.

Andres Freund

11 years agoBump catversion.
Robert Haas [Mon, 3 Mar 2014 12:22:20 +0000 (07:22 -0500)]
Bump catversion.

The previous patch should have entailed a catversion bump, but I
forgot.

11 years agoCorrections to replication slots code and documentation.
Robert Haas [Mon, 3 Mar 2014 12:16:54 +0000 (07:16 -0500)]
Corrections to replication slots code and documentation.

Andres Freund, per a report from Vik Faering

11 years agopageinspect: Use new pg_lsn datatype.
Robert Haas [Mon, 3 Mar 2014 12:14:31 +0000 (07:14 -0500)]
pageinspect: Use new pg_lsn datatype.

Michael Paquier, with slight comment changes by me

11 years agoDefine LSNOID in pg_type.h.
Robert Haas [Mon, 3 Mar 2014 12:03:41 +0000 (07:03 -0500)]
Define LSNOID in pg_type.h.

Most other built-in types have a similarly-named constant, so this
type should probably have one, too.

Michael Paquier

11 years agoAnother round of Coverity fixes
Stephen Frost [Mon, 3 Mar 2014 08:18:51 +0000 (03:18 -0500)]
Another round of Coverity fixes

Additional non-security issues/improvements spotted by Coverity.

In backend/libpq, no sense trying to protect against port->hba being
NULL after we've already dereferenced it in the switch() statement.

Prevent against possible overflow due to 32bit arithmitic in
basebackup throttling (not yet released, so no security concern).

Remove nonsensical check of array pointer against NULL in procarray.c,
looks to be a holdover from 9.1 and earlier when there were pointers
being used but now it's just an array.

Remove pointer check-against-NULL in tsearch/spell.c as we had already
dereferenced it above (in the strcmp()).

Remove dead code from adt/orderedsetaggs.c, isnull is checked
immediately after each tuplesort_getdatum() call and if true we return,
so no point checking it again down at the bottom.

Remove recently added minor error-condition memory leak in pg_regress.

11 years agoVarious Coverity-spotted fixes
Stephen Frost [Sun, 2 Mar 2014 03:14:14 +0000 (22:14 -0500)]
Various Coverity-spotted fixes

A number of issues were identified by the Coverity scanner and are
addressed in this patch.  None of these appear to be security issues
and many are mostly cosmetic changes.

Short comments for each of the changes follows.

Correct the semi-colon placement in be-secure.c regarding SSL retries.
Remove a useless comparison-to-NULL in proc.c (value is dereferenced
  prior to this check and therefore can't be NULL).
Add checking of chmod() return values to initdb.
Fix a couple minor memory leaks in initdb.
Fix memory leak in pg_ctl- involves free'ing the config file contents.
Use an int to capture fgetc() return instead of an enum in pg_dump.
Fix minor memory leaks in pg_dump.
  (note minor change to convertOperatorReference()'s API)
Check fclose()/remove() return codes in psql.
Check fstat(), find_my_exec() return codes in psql.
Various ECPG memory leak fixes.
Check find_my_exec() return in ECPG.
Explicitly ignore pqFlush return in libpq error-path.
Change PQfnumber() to avoid doing an strdup() when no changes required.
Remove a few useless check-against-NULL's (value deref'd beforehand).
Check rmtree(), malloc() results in pg_regress.
Also check get_alternative_expectfile() return in pg_regress.

11 years agoAllow regex operations to be terminated early by query cancel requests.
Tom Lane [Sat, 1 Mar 2014 20:20:56 +0000 (15:20 -0500)]
Allow regex operations to be terminated early by query cancel requests.

The regex code didn't have any provision for query cancel; which is
unsurprising given its non-Postgres origin, but still problematic since
some operations can take a long time.  Introduce a callback function to
check for a pending query cancel or session termination request, and
call it in a couple of strategic spots where we can make the regex code
exit with an error indicator.

If we ever actually split out the regex code as a standalone library,
some additional work will be needed to let the cancel callback function
be specified externally to the library.  But that's straightforward
(certainly so by comparison to putting the locale-dependent character
classification logic on a similar arms-length basis), and there seems
no need to do it right now.

A bigger issue is that there may be more places than these two where
we need to check for cancels.  We can always add more checks later,
now that the infrastructure is in place.

Since there are known examples of not-terribly-long regexes that can
lock up a backend for a long time, back-patch to all supported branches.
I have hopes of fixing the known performance problems later, but adding
query cancel ability seems like a good idea even if they were all fixed.

11 years agocheck_stack_depth in JsonbIteratorGet()
Teodor Sigaev [Fri, 28 Feb 2014 17:22:33 +0000 (21:22 +0400)]
check_stack_depth in JsonbIteratorGet()

11 years agoMerge branch 'jsonb_and_hstore' of github.com:feodor/postgres into jsonb_and_hstore
Teodor Sigaev [Fri, 28 Feb 2014 14:02:56 +0000 (18:02 +0400)]
Merge branch 'jsonb_and_hstore' of github.com:feodor/postgres into jsonb_and_hstore

Conflicts:
src/backend/utils/adt/jsonfuncs.c

11 years agoMerge branch 'master' into jsonb_and_hstore
Teodor Sigaev [Fri, 28 Feb 2014 13:07:52 +0000 (17:07 +0400)]
Merge branch 'master' into jsonb_and_hstore

Conflicts:
src/backend/utils/adt/jsonfuncs.c

11 years agoRemove bogus while-loop.
Heikki Linnakangas [Fri, 28 Feb 2014 11:22:25 +0000 (13:22 +0200)]
Remove bogus while-loop.

Commit abf5c5c9a4f142b3343614746bb9e99a794f8e7b added a bogus while-
statement after the for(;;)-loop. It went unnoticed in testing, because
it was dead code.

Report by KONDO Mitsumasa. Backpatch to 9.3. The commit that introduced
this was also applied to 9.2, but not the bogus while-loop part, because
the code in 9.2 looks quite different.

11 years agomove jsonb to contrib
Peter Geoghegan [Fri, 28 Feb 2014 06:58:46 +0000 (22:58 -0800)]
move jsonb to contrib

11 years agopgbench: Fix help message
Peter Eisentraut [Fri, 28 Feb 2014 02:52:21 +0000 (21:52 -0500)]
pgbench: Fix help message

Add NUM placeholder to -t option in help message.  It got lost in
79cddb18419778be3202c971b3f21cdd90f7b719.

Author: Fabien COELHO <[email protected]>

11 years agoadd comment suggested by Andres.
Andrew Dunstan [Fri, 28 Feb 2014 01:45:31 +0000 (20:45 -0500)]
add comment suggested by Andres.

11 years agoAllow BASE_BACKUP to be throttled
Alvaro Herrera [Thu, 27 Feb 2014 21:55:57 +0000 (18:55 -0300)]
Allow BASE_BACKUP to be throttled

A new MAX_RATE option allows imposing a limit to the network transfer
rate from the server side.  This is useful to limit the stress that
taking a base backup has on the server.

pg_basebackup is now able to specify a value to the server, too.

Author: Antonin Houska

Patch reviewed by Stefan Radomski, Andres Freund, Zoltán Böszörményi,
Fujii Masao, and Álvaro Herrera.

11 years agoRemove dependency on database encoding in citext regression test.
Tom Lane [Thu, 27 Feb 2014 19:58:47 +0000 (14:58 -0500)]
Remove dependency on database encoding in citext regression test.

Testing convert_to(..., 'ISO-8859-1') fails if there isn't a conversion
function available from the database encoding to ISO-8859-1.  This has
been broken since day one, but the breakage was hidden by
pg_do_encoding_conversion's failure to complain, up till commit
49c817eab78c6f0ce8c3bf46766b73d6cf3190b7.

Since the data being converted in this test is plain ASCII, no actual
conversion need happen (and if it did, it would prove little about citext
anyway).  So that we still have some code coverage of the convert() family
of functions, let's switch to using convert_from, with SQL_ASCII as the
specified source encoding.  Per buildfarm.

11 years agodoc: bgw_main takes a Datum argument, not void *.
Alvaro Herrera [Thu, 27 Feb 2014 14:41:43 +0000 (11:41 -0300)]
doc: bgw_main takes a Datum argument, not void *.

Per report from James Harper.

11 years agoFix WAL replay of locking an updated tuple
Alvaro Herrera [Thu, 27 Feb 2014 14:13:39 +0000 (11:13 -0300)]
Fix WAL replay of locking an updated tuple

We were resetting the tuple's HEAP_HOT_UPDATED flag as well as t_ctid on
WAL replay of a tuple-lock operation, which is incorrect when the tuple
is already updated.

Back-patch to 9.3.  The clearing of both header elements was there
previously, but since no update could be present on a tuple that was
being locked, it was harmless.

Bug reported by Peter Geoghegan and Greg Stark in
CAM3SWZTMQiCi5PV5OWHb+bYkUcnCk=O67w0cSswPvV7XfUcU5g@mail.gmail.com and
CAM-w4HPTOeMT4KP0OJK+mGgzgcTOtLRTvFZyvD0O4aH-7dxo3Q@mail.gmail.com
respectively; diagnosis by Andres Freund.

11 years agoMerge branch 'master' into jsonb
Andrew Dunstan [Thu, 27 Feb 2014 00:08:57 +0000 (19:08 -0500)]
Merge branch 'master' into jsonb

Conflicts:
src/backend/utils/adt/jsonfuncs.c

11 years agoundo change compiler complains about
Andrew Dunstan [Wed, 26 Feb 2014 22:07:48 +0000 (17:07 -0500)]
undo change compiler complains about

11 years agochanges based on code review
Andrew Dunstan [Wed, 26 Feb 2014 21:15:39 +0000 (16:15 -0500)]
changes based on code review

11 years agoDon't construct a text object just so you can json-parse a Cstring.
Andrew Dunstan [Wed, 26 Feb 2014 18:20:49 +0000 (13:20 -0500)]
Don't construct a text object just so you can json-parse a Cstring.