Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

update from original#2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vinpokale merged 360 commits intovinpokale:masterfrompostgres:master
Feb 3, 2016
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
360 commits
Select commitHold shift + click to select a range
385f337
Allow foreign and custom joins to handle EvalPlanQual rechecks.
robertmhaasDec 8, 2015
d5563d7
psql: Support multiple -c and -f options, and allow mixing them.
robertmhaasDec 8, 2015
938d797
Avoid odd portability problem in TestLib.pm's slurp_file function.
tglsfdcDec 8, 2015
521f045
Make failure to open psql's --log-file fatal.
tglsfdcDec 8, 2015
25c5392
Improve performance in freeing memory contexts
kgrittnDec 8, 2015
b287df7
Allow EXPLAIN (ANALYZE, VERBOSE) to display per-worker statistics.
robertmhaasDec 9, 2015
c00239e
Remove redundant sentence.
robertmhaasDec 9, 2015
9c779c4
Accept flex > 2.5.x on Windows, too.
tglsfdcDec 10, 2015
e3f4cfc
Fix bug leading to restoring unlogged relations from empty files.
anarazelDec 10, 2015
84ac126
Fix ON CONFLICT UPDATE bug breaking AFTER UPDATE triggers.
anarazelDec 10, 2015
348bcd8
Fix typo.
robertmhaasDec 10, 2015
8b469bd
Improve ALTER POLICY tab completion.
robertmhaasDec 10, 2015
a351705
Improve some messages
petereDec 11, 2015
69e7235
Fix commit timestamp initialization
alvherreDec 11, 2015
acfcd45
Still more fixes for planner's handling of LATERAL references.
tglsfdcDec 11, 2015
ed8bec9
Handle dependencies properly in ALTER POLICY
sfrostDec 11, 2015
4fcf484
Get rid of the planner's LateralJoinInfo data structure.
tglsfdcDec 11, 2015
833728d
Handle policies during DROP OWNED BY
sfrostDec 11, 2015
dccf8e9
Install our "missing" script where PGXS builds can find it.
tglsfdcDec 11, 2015
8c16155
For REASSIGN OWNED for foreign user mappings
alvherreDec 11, 2015
6b34e55
pg_rewind: Don't error if the two clusters are already on the same ti…
petereDec 4, 2015
085423e
Add an expected-file to match behavior of latest libxml2.
tglsfdcDec 12, 2015
f54d062
Fix ALTER TABLE ... SET TABLESPACE for unlogged relations.
anarazelDec 12, 2015
19e7ca8
doc: Add some markup
petereDec 12, 2015
6d96cd0
Doc: update external URLs for PostGIS project.
tglsfdcDec 13, 2015
263c195
Properly initialize write, flush and replay locations in walsender slots
mhaganderDec 13, 2015
a91bdf6
Consistently set all fields in pg_stat_replication to null instead of 0
mhaganderDec 13, 2015
fcbbf82
Code and docs review for multiple -c and -f options in psql.
tglsfdcDec 13, 2015
7bd149c
Docs: document that psql's "\i -" means read from stdin.
tglsfdcDec 14, 2015
2a35449
Correct statement to actually be the intended assert statement.
anarazelDec 14, 2015
cca705a
Fix bug in SetOffsetVacuumLimit() triggered by find_multixact_start()…
anarazelDec 14, 2015
7b96bf4
Fix out-of-memory error handling in ParameterDescription message proc…
hlinnakaDec 14, 2015
e2f1765
Remove xmlparse(document '') test
kgrittnDec 14, 2015
0d8f3d5
Add missing CHECK_FOR_INTERRUPTS in lseg_inside_poly
alvherreDec 14, 2015
db81329
Add missing cleanup logic in pg_rewind/t/005_same_timeline.pl test.
tglsfdcDec 15, 2015
e5e11c8
Collect the global OR of hasRowSecurity flags for plancache
sfrostDec 15, 2015
43cd468
Improve CREATE POLICY documentation
sfrostDec 15, 2015
3fed417
Provide a way to predefine LWLock tranche IDs.
robertmhaasDec 15, 2015
6150a1b
Move buffer I/O and content LWLocks out of the main tranche.
robertmhaasDec 15, 2015
049469e
Teach mdnblocks() not to create zero-length files.
robertmhaasDec 15, 2015
bfc7f5d
Update 9.5 release notes through today.
tglsfdcDec 15, 2015
0625dbb
Document use of Subject Alternative Names in SSL server certificates.
tglsfdcDec 15, 2015
f27a6b1
Mark CHECK constraints declared NOT VALID valid if created with table.
robertmhaasDec 16, 2015
b648b70
Speed up CREATE INDEX CONCURRENTLY's TID sort.
robertmhaasDec 16, 2015
2ec477d
Cope with Readline's failure to track SIGWINCH events outside of input.
tglsfdcDec 16, 2015
756e7b4
Rework internals of changing a type's ownership
alvherreDec 17, 2015
aee7705
Fix improper initialization order for readline.
tglsfdcDec 17, 2015
66d947b
Adjust behavior of single-user -j mode for better initdb error report…
tglsfdcDec 18, 2015
c4a8812
Use just one standalone-backend session for initdb's post-bootstrap s…
tglsfdcDec 18, 2015
3d0c50f
Remove unreferenced function declarations.
tglsfdcDec 18, 2015
33bd250
Cube extension kNN support
feodorDec 18, 2015
9246af6
Allow to omit boundaries in array subscript
feodorDec 18, 2015
9a51698
Fix typo in comment.
robertmhaasDec 18, 2015
4496226
Fix copy-and-paste error in logical decoding callback.
robertmhaasDec 18, 2015
2bdfcb5
Fix TupleQueueReaderNext not to ignore its nowait argument.
robertmhaasDec 18, 2015
6e7b335
Remove duplicate word.
robertmhaasDec 18, 2015
3c7042a
pgbench: Change terminology from "threshold" to "parameter".
robertmhaasDec 18, 2015
bbbd807
Revert 9246af6799819847faa33baf441251003acbb8fe because
feodorDec 18, 2015
130d94a
Fix tab completion for ALTER ... TABLESPACE ... OWNED BY.
anarazelDec 19, 2015
529fd74
Fix whitespace
petereDec 19, 2015
d37b816
Adopt a more compact, less error-prone notation for tab completion code.
tglsfdcDec 19, 2015
6542181
Add missing COSTS OFF to EXPLAIN commands in rowsecurity.sql.
tglsfdcDec 19, 2015
69e7c44
psql: Review of new help output strings
petereDec 20, 2015
d854118
Teach psql's tab completion to consider the entire input string.
tglsfdcDec 20, 2015
99ccb23
Remove silly completion for "DELETE FROM tabname ...".
tglsfdcDec 20, 2015
6f8cb1e
Make viewquery a copy in rewriteTargetView()
sfrostDec 21, 2015
f5a4370
Fix calculation of space needed for parsed words in tab completion.
tglsfdcDec 21, 2015
ccd8f97
postgres_fdw: Consider requesting sorted data so we can do a merge join.
robertmhaasDec 22, 2015
0ba3f3b
Comment improvements for abbreviated keys.
robertmhaasDec 22, 2015
6efbded
Allow omitting one or both boundaries in an array slice specifier.
tglsfdcDec 23, 2015
30c0c4b
Remove unnecessary escaping in C character literals
petereDec 23, 2015
51d152f
Change Gather not to use a physical tlist.
robertmhaasDec 23, 2015
bc7fcab
Read from the same worker repeatedly until it returns no tuple.
robertmhaasDec 23, 2015
1aa41e3
In pg_dump, remember connection passwords no matter how we got them.
tglsfdcDec 23, 2015
ff402ae
Improve handling of password reuse in src/bin/scripts programs.
tglsfdcDec 23, 2015
01e386a
Avoid VACUUM FULL altogether in initdb.
tglsfdcDec 24, 2015
bee172f
Docs typo fix.
tglsfdcDec 24, 2015
96cd61a
Fix factual and grammatical errors in comments for struct _tableInfo.
tglsfdcDec 24, 2015
71dd092
Docs: fix erroneously-given function name.
tglsfdcDec 24, 2015
a9246fb
Remove unnecessary row ordering dependency in pg_rewind test suite.
tglsfdcDec 24, 2015
25bfa7e
Improve the gin index scan performance in pg_trgm.
feodorDec 25, 2015
8014c44
Improve SECURITY LABEL tab completion
MasaoFujiiDec 25, 2015
3d2b31e
Fix brin_summarize_new_values() to check index type and ownership.
tglsfdcDec 26, 2015
fec1ad9
Include typmod when complaining about inherited column type mismatches.
tglsfdcDec 26, 2015
743229a
Add forgotten CHECK_FOR_INTERRUPT calls in pgcrypto's crypt()
alvherreDec 27, 2015
fc995bf
Fix translation domain in pg_basebackup
alvherreDec 28, 2015
731dfc7
Update documentation about pseudo-types.
tglsfdcDec 28, 2015
151c4ff
doc: pg_committs -> pg_commit_ts
alvherreDec 28, 2015
870df2b
Fix omission of -X (--no-psqlrc) in some psql invocations.
tglsfdcDec 28, 2015
54aaafe
Document the exponentiation operator as associating left to right.
tglsfdcDec 28, 2015
ac443d1
Document brin_summarize_new_pages
alvherreDec 28, 2015
81ee726
Code and docs review for cube kNN support.
tglsfdcDec 28, 2015
241448b
Rename (new|old)estCommitTs to (new|old)estCommitTsXid
jconwayDec 28, 2015
fd19525
Put back one copyObject() in rewriteTargetView().
tglsfdcDec 29, 2015
efe4c9d
Add some comments about division of labor between rewriter and planner.
tglsfdcDec 29, 2015
e5e5267
Minor hacking on contrib/cube documentation.
tglsfdcDec 30, 2015
e842908
Avoid useless truncation attempts during VACUUM.
tglsfdcDec 30, 2015
e5d06f2
Dept of second thoughts: the !scan_all exit mustn't increase scanned_…
tglsfdcDec 30, 2015
0dab5ef
Fix ALTER OPERATOR to update dependencies properly.
tglsfdcDec 31, 2015
5f36096
Add a comment noting that FDWs don't have to implement EXCEPT or LIMI…
tglsfdcDec 31, 2015
805ac78
doc: Add index entries and better documentation link for Linux OOM
petereJan 1, 2016
253de19
doc: Remove redundant duplicate URLs from ulink elements
petereJan 1, 2016
3cd1ba1
Fix comments about WAL rule "write xlog before data" versus pg_multix…
nmischJan 1, 2016
3c93a60
Add some more defenses against silly estimates to gincostestimate().
tglsfdcJan 1, 2016
c7e27be
Teach flatten_reloptions() to quote option values safely.
tglsfdcJan 1, 2016
dfcd9cb
Cover heap_page_prune_opt()'s cleanup lock tactic in README.
nmischJan 2, 2016
ee94300
Update copyright for 2016
bmomjianJan 2, 2016
ad08bf5
Update copyright for 2016
tglsfdcJan 2, 2016
48c9f28
Update copyright for 2016
tglsfdcJan 2, 2016
de7c8db
Make copyright.pl cope with nonstandard case choices in copyright not…
tglsfdcJan 2, 2016
df35af2
Adjust back-branch release note description of commits a2a718b22 et al.
tglsfdcJan 2, 2016
7157fe8
Fix overly-strict assertions in spgtextproc.c.
tglsfdcJan 2, 2016
b416c0b
Teach pg_dump to quote reloption values safely.
tglsfdcJan 3, 2016
90e61df
Fix treatment of *lpNumberOfBytesRecvd == 0: that's a completion cond…
tglsfdcJan 3, 2016
0279891
Do a final round of copy-editing on the 9.5 release notes.
tglsfdcJan 3, 2016
c6aeba3
Do some copy-editing on the docs for replication origins.
tglsfdcJan 3, 2016
939d10c
Guard against null arguments in binary_upgrade_create_empty_extension().
tglsfdcJan 3, 2016
c1611db
Do some copy-editing on the docs for row-level security.
tglsfdcJan 4, 2016
f47b602
Fix bogus lock release in RemovePolicyById and RemoveRoleFromObjectPo…
tglsfdcJan 4, 2016
fb1227a
Fix regrole and regnamespace types to honor quoting like other reg* t…
tglsfdcJan 4, 2016
b0cadc0
Fix regrole and regnamespace output functions to do quoting, too.
tglsfdcJan 4, 2016
8978eb0
Fix typo in comment.
robertmhaasJan 4, 2016
5d35438
Adjust behavior of row_security GUC to match the docs.
tglsfdcJan 4, 2016
7debf36
Docs: provide a concrete discussion and example for RLS race conditions.
tglsfdcJan 4, 2016
9b181b0
In psql's tab completion, change most TailMatches patterns to Matches.
tglsfdcJan 5, 2016
4f18010
Convert psql's tab completion for backslash commands to the new style.
tglsfdcJan 5, 2016
83be184
Add to_regnamespace() and to_regrole() to the documentation.
tglsfdcJan 5, 2016
efa318b
Make pg_shseclabel available in early backend startup
alvherreJan 5, 2016
ea0d494
Make the to_reg*() functions accept text not cstring.
tglsfdcJan 5, 2016
9211919
In opr_sanity regression test, check for unexpected uses of cstring.
tglsfdcJan 5, 2016
4aecd22
Make pg_receivexlog silent with 9.3 and older servers
alvherreJan 5, 2016
3343ea9
Sort $(wildcard) output where needed for reproducible build output.
tglsfdcJan 5, 2016
419400c
Remove some ancient and unmaintained encoding-conversion test cruft.
tglsfdcJan 5, 2016
abb1733
Add scale(numeric)
alvherreJan 5, 2016
65681d0
Fix typo in create_transform.sgml.
tatsuo-ishiiJan 5, 2016
4bf8716
Comment typo fix.
tglsfdcJan 6, 2016
dad0899
In initdb's post-bootstrap phase, drop temp tables explicitly.
tglsfdcJan 6, 2016
a967613
Windows: Make pg_ctl reliably detect service status
alvherreJan 7, 2016
5e0b5dc
Provide more detail in postmaster log for password authentication fai…
tglsfdcJan 7, 2016
6b1a837
Remove vestigial CHECK_FOR_INTERRUPTS call.
tglsfdcJan 7, 2016
b1a9bad
pgstat: add WAL receiver status view & SRF
alvherreJan 7, 2016
33b054b
Use plain mkdir() not pg_mkdir_p() to create subdirectories of PGDATA.
tglsfdcJan 7, 2016
fa838b5
Add win32security to LIBOBJS
alvherreJan 7, 2016
b41fb65
Fix unobvious interaction between -X switch and subdirectory creation.
tglsfdcJan 7, 2016
f81c966
Fix order of arguments to va_start()
alvherreJan 7, 2016
c44d013
Delay creation of subplan tlist until after create_plan().
tglsfdcJan 8, 2016
a54676a
Marginal cleanup of GROUPING SETS code in grouping_planner().
tglsfdcJan 8, 2016
c662ef1
Remove reundand include of TestLib
mhaganderJan 8, 2016
2650486
Fix typo in comment
mhaganderJan 8, 2016
e9282e9
Blind attempt at a Cygwin fix
alvherreJan 8, 2016
4631721
Revert "Blind attempt at a Cygwin fix"
alvherreJan 8, 2016
687f2cd
Avoid pin scan for replay of XLOG_BTREE_VACUUM
simonat2ndQuadrantJan 9, 2016
529baf6
Add STRICT to some C functions created by the regression tests.
tglsfdcJan 9, 2016
b602842
Revoke change to rmgr desc of btree vacuum
simonat2ndQuadrantJan 9, 2016
1cb63c7
Clean up code for widget_in() and widget_out().
tglsfdcJan 9, 2016
26d538d
Clean up some lack-of-STRICT issues in the core code, too.
tglsfdcJan 9, 2016
3ef16c4
Add some checks on "char"-type columns to type_sanity and opr_sanity.
tglsfdcJan 9, 2016
820bdcc
Remove a useless PG_GETARG_DATUM() call from jsonb_build_array.
tglsfdcJan 9, 2016
c618e1b
doc: Fix typo in logical decoding documentation
petereJan 11, 2016
950ab82
Remove obsolete comment.
robertmhaasJan 11, 2016
866566a
Avoid dump/reload problems when using both plpython2 and plpython3.
tglsfdcJan 12, 2016
fb6fcbd
Use LOAD not actual code execution to pull in plpython library.
tglsfdcJan 12, 2016
796d1e8
Remove no-longer-needed old-style check for incompatible plpythons.
tglsfdcJan 12, 2016
1e29e63
Maintain local LogwrtResult consistently
simonat2ndQuadrantJan 12, 2016
e63bb45
Add new user fn pg_current_xlog_flush_location()
simonat2ndQuadrantJan 12, 2016
7032703
psql: Update tab completion comment
petereJan 10, 2016
bc56d58
psql: Fix CREATE INDEX tab completion
petereJan 10, 2016
b1bfb28
psql: Improve CREATE INDEX CONCURRENTLY tab completion
petereJan 13, 2016
26905e0
Run pgindent on src/bin/pg_dump/*
tglsfdcJan 13, 2016
5b5fea2
Access pg_dump's options structs through Archive struct, not directly.
tglsfdcJan 13, 2016
e72d7d8
Handle extension members when first setting object dump flags in pg_d…
tglsfdcJan 13, 2016
6a61d1f
Properly close token in sspi authentication
mhaganderJan 14, 2016
a923af3
Fix build_grouping_chain() to not clobber its input lists.
tglsfdcJan 14, 2016
23c2dd0
Fix spelling mistakes.
robertmhaasJan 15, 2016
cf7dfbf
Fix minor typo in comment
mhaganderJan 15, 2016
4189e3d
psql: Add completion support for DROP INDEX CONCURRENTLY
petereJan 17, 2016
57ce9ac
Remove dead code in pg_dump.
tglsfdcJan 17, 2016
8d290c8
Re-pgindent a few files.
tglsfdcJan 18, 2016
65c5fcd
Restructure index access method API to hide most of it at the C level.
tglsfdcJan 18, 2016
49b4950
Add explicit cast to amcostestimate call.
tglsfdcJan 18, 2016
85f2228
Fix typo.
tatsuo-ishiiJan 18, 2016
53c949c
Remove Cygwin-specific code from pg_ctl
adunstanJan 19, 2016
9ff6027
Fix assorted inconsistencies in GiST opclass support function declara…
tglsfdcJan 19, 2016
948c979
Add two HyperLogLog functions
alvherreJan 19, 2016
dbe2328
Fix assorted inconsistencies in GIN opclass support function declarat…
tglsfdcJan 20, 2016
216d568
Properly install dynloader.h on MSVC builds
bmomjianJan 20, 2016
c8642d9
PostgresNode: Add names to nodes
alvherreJan 20, 2016
a7de3dc
Support multi-stage aggregation.
robertmhaasJan 20, 2016
45be99f
Support parallel joins, and make related improvements.
robertmhaasJan 20, 2016
422a55a
Refactor to create generic WAL page read callback
simonat2ndQuadrantJan 21, 2016
d0f2f53
psql: Add tab completion for COPY with query
petereJan 21, 2016
978b2f6
Speedup 2PC by skipping two phase state files in normal path
simonat2ndQuadrantJan 21, 2016
c80b31d
Refactor headers to split out standby defs
simonat2ndQuadrantJan 21, 2016
38710a3
Remove unused argument from ginInsertCleanup()
MasaoFujiiJan 21, 2016
b995518
Add defenses against putting expanded objects into Const nodes.
tglsfdcJan 21, 2016
be44ed2
Improve index AMs' opclass validation procedures.
tglsfdcJan 22, 2016
d9b9289
Suppress compiler warning.
tglsfdcJan 22, 2016
647d87c
Make extract() do something more reasonable with infinite datetimes.
tglsfdcJan 22, 2016
a396144
Remove new coupling between NAMEDATALEN and MAX_LEVENSHTEIN_STRLEN.
tglsfdcJan 22, 2016
80aa219
Improve levenshtein() docs.
tglsfdcJan 22, 2016
fd5200c
Improve cross-platform consistency of Inf/NaN handling in trig functi…
tglsfdcJan 22, 2016
e1bd684
Add trigonometric functions that work in degrees.
tglsfdcJan 22, 2016
df43fcf
pg_dump: Fix quoting of domain constraint names
alvherreJan 22, 2016
6ae4c8d
psql: Improve completion of FDW DDL commands
petereJan 23, 2016
73193d8
Adjust degree-based trig functions for more portability.
tglsfdcJan 23, 2016
65abaab
Further adjust degree-based trig functions for more portability.
tglsfdcJan 23, 2016
360f67d
Still further adjust degree-based trig functions for more portability.
tglsfdcJan 23, 2016
0034757
Yet further adjust degree-based trig functions for more portability.
tglsfdcJan 24, 2016
1129c2b
Correct comment in GetConflictingVirtualXIDs()
simonat2ndQuadrantJan 24, 2016
ad2e233
Revert "Fix broken multibyte regression tests."
tatsuo-ishiiJan 25, 2016
879d713
Various fixes to REFRESH MATERIALIZED VIEW tab completion.
kgrittnJan 26, 2016
cc988fb
Improve ResourceOwners' behavior for large numbers of owned objects.
tglsfdcJan 26, 2016
b8682a7
Fix startup so that log prefix %h works for the log_connections message.
tglsfdcJan 26, 2016
5b3cc1a
Mostly mechanical cleanup of pgbench
alvherreJan 27, 2016
8bea3d2
pgbench: improve multi-script support
alvherreJan 27, 2016
e09507a
Fix volatility marking of pg_size_pretty function
MasaoFujiiJan 27, 2016
025b2f3
Fix cross-version pg_dump for aggregate combine functions.
robertmhaasJan 28, 2016
eaf7b1f
Assert that create_unique_path returns non-NULL.
robertmhaasJan 28, 2016
7f46eaf
Add gin_clean_pending_list function to clean up GIN pending list
MasaoFujiiJan 28, 2016
62e2ddd
Fix typos in comments and doc
MasaoFujiiJan 28, 2016
e374838
Fix spi_worker mention in bgworker documentation
alvherreJan 28, 2016
80db1ca
Add [NO]BYPASSRLS options to CREATE USER and ALTER USER docs.
robertmhaasJan 28, 2016
96198d9
Avoid multiple foreign server connections when all use same user mapp…
robertmhaasJan 28, 2016
2f6b041
Add missing quotation mark.
robertmhaasJan 28, 2016
fbe5a3f
Only try to push down foreign joins if the user mapping OIDs match.
robertmhaasJan 28, 2016
b88ef20
postgres_fdw: Refactor deparsing code for locking clauses.
robertmhaasJan 28, 2016
c35c4ec
Fix syntax descriptions for replication commands in logicaldecoding.sgml
MasaoFujiiJan 29, 2016
7e22470
Fix incorrect pattern-match processing in psql's \det command.
tglsfdcJan 29, 2016
b603766
pgbench: refactor handling of stats tracking
alvherreJan 29, 2016
b319356
Migrate PGPROC's backendLock into PGPROC itself, using a new tranche.
robertmhaasJan 29, 2016
2251179
Migrate replication slot I/O locks into a separate tranche.
robertmhaasJan 29, 2016
cc592c4
postgres_fdw: More preliminary refactoring for upcoming join pushdown.
robertmhaasJan 30, 2016
9217bf3
Fix whitespace
petereJan 30, 2016
7dc09c1
Fix error in documentated use of mingw-w64 compilers
adunstanJan 31, 2016
61ce1e8
Fix misspelled function name in comment.
hlinnakaFeb 1, 2016
e51ab85
Fix typos in comments
mhaganderFeb 1, 2016
7a58d19
Make sure ecpg header files do not have a comment lasting several lin…
Feb 1, 2016
89611c4
Various fixes to "ALTER ... SET/RESET" tab completions
MasaoFujiiFeb 1, 2016
64f5edc
pgbench: Install guards against obscure overflow conditions.
robertmhaasFeb 1, 2016
1d0c3b3
pgbench: allow per-script statistics
alvherreFeb 1, 2016
7191ce8
Make all built-in lwlock tranche IDs fixed.
robertmhaasFeb 2, 2016
f25d07d
Fix lossy KNN GiST when ordering operator returns non-float8 value.
feodorFeb 2, 2016
23f3cc3
Fix typo in comment
mhaganderFeb 2, 2016
a4627e8
Fix pg_description entries for jsonb_to_record() and jsonb_to_records…
tglsfdcFeb 2, 2016
2ad83ff
Remove unnecessary "implementation of FOO operator" DESCR() entries.
tglsfdcFeb 2, 2016
3cb5867
Don't test for system columns on join relations
alvherreFeb 2, 2016
2808a2e
Remove printQueryOpt.quote field.
tglsfdcFeb 2, 2016
ac7238d
Improve error reporting when location specified by postgres -D does n…
petereNov 17, 2015
7d17e68
Add support for systemd service notifications
petereNov 17, 2015
e6ecc93
Fix IsValidJsonNumber() to notice trailing non-alphanumeric garbage.
tglsfdcFeb 3, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Only try to push down foreign joins if the user mapping OIDs match.
Previously, the foreign join pushdown infrastructure left the questionof security entirely up to individual FDWs, but it would be easy fora foreign data wrapper to inadvertently open up subtle security holesthat way.  So, make it the core code's job to determine which usermapping OID is relevant, and don't attempt join pushdown unless it'sthe same for all relevant relations.Per a suggestion from Tom Lane.  Shigeru Hanada and Ashutosh Bapat,reviewed by Etsuro Fujita and KaiGai Kohei, with some furtherchanges by me.
  • Loading branch information
@robertmhaas
robertmhaas committedJan 28, 2016
commitfbe5a3fb73102c2cfec11aaaa4a67943f4474383
1 change: 1 addition & 0 deletionssrc/backend/executor/execParallel.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -143,6 +143,7 @@ ExecSerializePlan(Plan *plan, EState *estate)
pstmt->relationOids = NIL;
pstmt->invalItems = NIL;/* workers can't replan anyway... */
pstmt->hasRowSecurity = false;
pstmt->hasForeignJoin = false;

/* Return serialized copy of our dummy PlannedStmt. */
return nodeToString(pstmt);
Expand Down
74 changes: 57 additions & 17 deletionssrc/backend/foreign/foreign.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,6 +31,7 @@
extern Datum pg_options_to_table(PG_FUNCTION_ARGS);
extern Datum postgresql_fdw_validator(PG_FUNCTION_ARGS);

static HeapTuple find_user_mapping(Oid userid, Oid serverid);

/*
* GetForeignDataWrapper -look up the foreign-data wrapper by OID.
Expand DownExpand Up@@ -174,23 +175,7 @@ GetUserMapping(Oid userid, Oid serverid)
boolisnull;
UserMapping *um;

tp = SearchSysCache2(USERMAPPINGUSERSERVER,
ObjectIdGetDatum(userid),
ObjectIdGetDatum(serverid));

if (!HeapTupleIsValid(tp))
{
/* Not found for the specific user -- try PUBLIC */
tp = SearchSysCache2(USERMAPPINGUSERSERVER,
ObjectIdGetDatum(InvalidOid),
ObjectIdGetDatum(serverid));
}

if (!HeapTupleIsValid(tp))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("user mapping not found for \"%s\"",
MappingUserName(userid))));
tp = find_user_mapping(userid, serverid);

um = (UserMapping *) palloc(sizeof(UserMapping));
um->umid = HeapTupleGetOid(tp);
Expand All@@ -212,6 +197,61 @@ GetUserMapping(Oid userid, Oid serverid)
return um;
}

/*
* GetUserMappingId - look up the user mapping, and return its OID
*
* If no mapping is found for the supplied user, we also look for
* PUBLIC mappings (userid == InvalidOid).
*/
Oid
GetUserMappingId(Oid userid, Oid serverid)
{
HeapTupletp;
Oidumid;

tp = find_user_mapping(userid, serverid);

/* Extract the Oid */
umid = HeapTupleGetOid(tp);

ReleaseSysCache(tp);

return umid;
}


/*
* find_user_mapping - Guts of GetUserMapping family.
*
* If no mapping is found for the supplied user, we also look for
* PUBLIC mappings (userid == InvalidOid).
*/
static HeapTuple
find_user_mapping(Oid userid, Oid serverid)
{
HeapTupletp;

tp = SearchSysCache2(USERMAPPINGUSERSERVER,
ObjectIdGetDatum(userid),
ObjectIdGetDatum(serverid));

if (HeapTupleIsValid(tp))
return tp;

/* Not found for the specific user -- try PUBLIC */
tp = SearchSysCache2(USERMAPPINGUSERSERVER,
ObjectIdGetDatum(InvalidOid),
ObjectIdGetDatum(serverid));

if (!HeapTupleIsValid(tp))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("user mapping not found for \"%s\"",
MappingUserName(userid))));

return tp;
}


/*
* GetForeignTable - look up the foreign table definition by relation oid.
Expand Down
1 change: 1 addition & 0 deletionssrc/backend/nodes/copyfuncs.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -95,6 +95,7 @@ _copyPlannedStmt(const PlannedStmt *from)
COPY_SCALAR_FIELD(nParamExec);
COPY_SCALAR_FIELD(hasRowSecurity);
COPY_SCALAR_FIELD(parallelModeNeeded);
COPY_SCALAR_FIELD(hasForeignJoin);

return newnode;
}
Expand Down
2 changes: 2 additions & 0 deletionssrc/backend/nodes/outfuncs.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -259,6 +259,7 @@ _outPlannedStmt(StringInfo str, const PlannedStmt *node)
WRITE_INT_FIELD(nParamExec);
WRITE_BOOL_FIELD(hasRowSecurity);
WRITE_BOOL_FIELD(parallelModeNeeded);
WRITE_BOOL_FIELD(hasForeignJoin);
}

/*
Expand DownExpand Up@@ -1825,6 +1826,7 @@ _outPlannerGlobal(StringInfo str, const PlannerGlobal *node)
WRITE_BOOL_FIELD(hasRowSecurity);
WRITE_BOOL_FIELD(parallelModeOK);
WRITE_BOOL_FIELD(parallelModeNeeded);
WRITE_BOOL_FIELD(hasForeignJoin);
}

static void
Expand Down
1 change: 1 addition & 0 deletionssrc/backend/nodes/readfuncs.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1396,6 +1396,7 @@ _readPlannedStmt(void)
READ_INT_FIELD(nParamExec);
READ_BOOL_FIELD(hasRowSecurity);
READ_BOOL_FIELD(parallelModeNeeded);
READ_BOOL_FIELD(hasForeignJoin);

READ_DONE();
}
Expand Down
9 changes: 9 additions & 0 deletionssrc/backend/optimizer/plan/createplan.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2151,6 +2151,15 @@ create_foreignscan_plan(PlannerInfo *root, ForeignPath *best_path,
/* Likewise, copy the relids that are represented by this foreign scan */
scan_plan->fs_relids = best_path->path.parent->relids;

/*
* If a join between foreign relations was pushed down, remember it. The
* push-down safety of the join depends upon the server and user mapping
* being same. That can change between planning and execution time, in which
* case the plan should be invalidated.
*/
if (scan_relid == 0)
root->glob->hasForeignJoin = true;

/*
* Replace any outer-relation variables with nestloop params in the qual,
* fdw_exprs and fdw_recheck_quals expressions. We do this last so that
Expand Down
2 changes: 2 additions & 0 deletionssrc/backend/optimizer/plan/planner.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -200,6 +200,7 @@ standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
glob->lastPlanNodeId = 0;
glob->transientPlan = false;
glob->hasRowSecurity = false;
glob->hasForeignJoin = false;

/*
* Assess whether it's feasible to use parallel mode for this query. We
Expand DownExpand Up@@ -346,6 +347,7 @@ standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
result->nParamExec = glob->nParamExec;
result->hasRowSecurity = glob->hasRowSecurity;
result->parallelModeNeeded = glob->parallelModeNeeded;
result->hasForeignJoin = glob->hasForeignJoin;

return result;
}
Expand Down
36 changes: 34 additions & 2 deletionssrc/backend/optimizer/util/relnode.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,6 +14,9 @@
*/
#include "postgres.h"

#include "miscadmin.h"
#include "catalog/pg_class.h"
#include "foreign/foreign.h"
#include "optimizer/clauses.h"
#include "optimizer/cost.h"
#include "optimizer/pathnode.h"
Expand DownExpand Up@@ -127,6 +130,7 @@ build_simple_rel(PlannerInfo *root, int relid, RelOptKind reloptkind)
rel->subroot = NULL;
rel->subplan_params = NIL;
rel->serverid = InvalidOid;
rel->umid = InvalidOid;
rel->fdwroutine = NULL;
rel->fdw_private = NULL;
rel->baserestrictinfo = NIL;
Expand DownExpand Up@@ -166,6 +170,26 @@ build_simple_rel(PlannerInfo *root, int relid, RelOptKind reloptkind)
break;
}

/* For foreign tables get the user mapping */
if (rte->relkind == RELKIND_FOREIGN_TABLE)
{
/*
* This should match what ExecCheckRTEPerms() does.
*
* Note that if the plan ends up depending on the user OID in any
* way - e.g. if it depends on the computed user mapping OID - we must
* ensure that it gets invalidated in the case of a user OID change.
* See RevalidateCachedQuery and more generally the hasForeignJoin
* flags in PlannerGlobal and PlannedStmt.
*/
Oiduserid;

userid = OidIsValid(rte->checkAsUser) ? rte->checkAsUser : GetUserId();
rel->umid = GetUserMappingId(userid, rel->serverid);
}
else
rel->umid = InvalidOid;

/* Save the finished struct in the query's simple_rel_array */
root->simple_rel_array[relid] = rel;

Expand DownExpand Up@@ -398,6 +422,7 @@ build_join_rel(PlannerInfo *root,
joinrel->subroot = NULL;
joinrel->subplan_params = NIL;
joinrel->serverid = InvalidOid;
joinrel->umid = InvalidOid;
joinrel->fdwroutine = NULL;
joinrel->fdw_private = NULL;
joinrel->baserestrictinfo = NIL;
Expand All@@ -408,12 +433,19 @@ build_join_rel(PlannerInfo *root,

/*
* Set up foreign-join fields if outer and inner relation are foreign
* tables (or joins) belonging to the same server.
* tables (or joins) belonging to the same server and using the same
* user mapping.
*
* Otherwise those fields are left invalid, so FDW API will not be called
* for the join relation.
*/
if (OidIsValid(outer_rel->serverid) &&
inner_rel->serverid == outer_rel->serverid)
inner_rel->serverid == outer_rel->serverid &&
inner_rel->umid == outer_rel->umid)
{
Assert(OidIsValid(outer_rel->umid));
joinrel->serverid = outer_rel->serverid;
joinrel->umid = outer_rel->umid;
joinrel->fdwroutine = outer_rel->fdwroutine;
}

Expand Down
68 changes: 67 additions & 1 deletionsrc/backend/utils/cache/plancache.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -104,6 +104,8 @@ static TupleDesc PlanCacheComputeResultDesc(List *stmt_list);
static void PlanCacheRelCallback(Datum arg, Oid relid);
static void PlanCacheFuncCallback(Datum arg, int cacheid, uint32 hashvalue);
static void PlanCacheSysCallback(Datum arg, int cacheid, uint32 hashvalue);
static void PlanCacheUserMappingCallback(Datum arg, int cacheid,
uint32 hashvalue);


/*
Expand All@@ -119,6 +121,8 @@ InitPlanCache(void)
CacheRegisterSyscacheCallback(NAMESPACEOID, PlanCacheSysCallback, (Datum) 0);
CacheRegisterSyscacheCallback(OPEROID, PlanCacheSysCallback, (Datum) 0);
CacheRegisterSyscacheCallback(AMOPOPID, PlanCacheSysCallback, (Datum) 0);
/* User mapping change may invalidate plans with pushed down foreign join */
CacheRegisterSyscacheCallback(USERMAPPINGOID, PlanCacheUserMappingCallback, (Datum) 0);
}

/*
Expand DownExpand Up@@ -574,7 +578,8 @@ RevalidateCachedQuery(CachedPlanSource *plansource)
/*
* If this is a new cached plan, then set the user id it was planned by
* and under what row security settings; these are needed to determine
* plan invalidation when RLS is involved.
* plan invalidation when RLS is involved or foreign joins are pushed
* down.
*/
if (!OidIsValid(plansource->planUserId))
{
Expand DownExpand Up@@ -609,6 +614,18 @@ RevalidateCachedQuery(CachedPlanSource *plansource)
|| plansource->row_security_env != row_security))
plansource->is_valid = false;

/*
* If we have a join pushed down to the foreign server and the current user
* is different from the one for which the plan was created, invalidate the
* generic plan since user mapping for the new user might make the join
* unsafe to push down, or change which user mapping is used.
*/
if (plansource->is_valid &&
plansource->gplan &&
plansource->gplan->has_foreign_join &&
plansource->planUserId != GetUserId())
plansource->gplan->is_valid = false;

/*
* If the query is currently valid, acquire locks on the referenced
* objects; then check again. We need to do it this way to cover the race
Expand DownExpand Up@@ -881,6 +898,7 @@ BuildCachedPlan(CachedPlanSource *plansource, List *qlist,
boolspi_pushed;
MemoryContext plan_context;
MemoryContext oldcxt = CurrentMemoryContext;
ListCell*lc;

/*
* Normally the querytree should be valid already, but if it's not,
Expand DownExpand Up@@ -988,6 +1006,20 @@ BuildCachedPlan(CachedPlanSource *plansource, List *qlist,
plan->is_saved = false;
plan->is_valid = true;

/*
* Walk through the plist and set hasForeignJoin if any of the plans have
* it set.
*/
plan->has_foreign_join = false;
foreach(lc, plist)
{
PlannedStmt*plan_stmt = (PlannedStmt *) lfirst(lc);

if (IsA(plan_stmt, PlannedStmt))
plan->has_foreign_join =
plan->has_foreign_join || plan_stmt->hasForeignJoin;
}

/* assign generation number to new plan */
plan->generation = ++(plansource->generation);

Expand DownExpand Up@@ -1843,6 +1875,40 @@ PlanCacheSysCallback(Datum arg, int cacheid, uint32 hashvalue)
ResetPlanCache();
}

/*
* PlanCacheUserMappingCallback
* Syscache inval callback function for user mapping cache invalidation.
*
* Invalidates plans which have pushed down foreign joins.
*/
static void
PlanCacheUserMappingCallback(Datum arg, int cacheid, uint32 hashvalue)
{
CachedPlanSource *plansource;

for (plansource = first_saved_plan; plansource; plansource = plansource->next_saved)
{
Assert(plansource->magic == CACHEDPLANSOURCE_MAGIC);

/* No work if it's already invalidated */
if (!plansource->is_valid)
continue;

/* Never invalidate transaction control commands */
if (IsTransactionStmtPlan(plansource))
continue;

/*
* If the plan has pushed down foreign joins, those join may become
* unsafe to push down because of user mapping changes. Invalidate only
* the generic plan, since changes to user mapping do not invalidate the
* parse tree.
*/
if (plansource->gplan && plansource->gplan->has_foreign_join)
plansource->gplan->is_valid = false;
}
}

/*
* ResetPlanCache: invalidate all cached plans.
*/
Expand Down
1 change: 1 addition & 0 deletionssrc/include/foreign/foreign.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,6 +72,7 @@ typedef struct ForeignTable
extern ForeignServer *GetForeignServer(Oid serverid);
extern ForeignServer *GetForeignServerByName(const char *name, bool missing_ok);
extern UserMapping *GetUserMapping(Oid userid, Oid serverid);
extern Oid GetUserMappingId(Oid userid, Oid serverid);
extern ForeignDataWrapper *GetForeignDataWrapper(Oid fdwid);
extern ForeignDataWrapper *GetForeignDataWrapperByName(const char *name,
bool missing_ok);
Expand Down
1 change: 1 addition & 0 deletionssrc/include/nodes/plannodes.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -73,6 +73,7 @@ typedef struct PlannedStmt
boolhasRowSecurity; /* row security applied? */

boolparallelModeNeeded; /* parallel mode required to execute? */
boolhasForeignJoin;/* Plan has a pushed down foreign join */
} PlannedStmt;

/* macro for fetching the Plan associated with a SubPlan node */
Expand Down
2 changes: 2 additions & 0 deletionssrc/include/nodes/relation.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -108,6 +108,7 @@ typedef struct PlannerGlobal
boolparallelModeOK; /* parallel mode potentially OK? */

boolparallelModeNeeded;/* parallel mode actually required? */
boolhasForeignJoin;/* does have a pushed down foreign join */
} PlannerGlobal;

/* macro for fetching the Plan associated with a SubPlan node */
Expand DownExpand Up@@ -490,6 +491,7 @@ typedef struct RelOptInfo

/* Information about foreign tables and foreign joins */
Oidserverid;/* identifies server for the table or join */
Oidumid;/* identifies user mapping for the table or join */
/* use "struct FdwRoutine" to avoid including fdwapi.h here */
struct FdwRoutine *fdwroutine;
void *fdw_private;
Expand Down
1 change: 1 addition & 0 deletionssrc/include/utils/plancache.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -135,6 +135,7 @@ typedef struct CachedPlan
* changes from this value */
intgeneration;/* parent's generation number for this plan */
intrefcount;/* count of live references to this struct */
boolhas_foreign_join; /* plan has pushed down a foreign join */
MemoryContext context;/* context containing this CachedPlan */
} CachedPlan;

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp