You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(28) |
Jun
(12) |
Jul
(11) |
Aug
(12) |
Sep
(5) |
Oct
(19) |
Nov
(14) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(18) |
Feb
(30) |
Mar
(115) |
Apr
(89) |
May
(50) |
Jun
(44) |
Jul
(22) |
Aug
(13) |
Sep
(11) |
Oct
(30) |
Nov
(28) |
Dec
(39) |
2012 |
Jan
(38) |
Feb
(18) |
Mar
(43) |
Apr
(91) |
May
(108) |
Jun
(46) |
Jul
(37) |
Aug
(44) |
Sep
(33) |
Oct
(29) |
Nov
(36) |
Dec
(15) |
2013 |
Jan
(35) |
Feb
(611) |
Mar
(5) |
Apr
(55) |
May
(30) |
Jun
(28) |
Jul
(458) |
Aug
(34) |
Sep
(9) |
Oct
(39) |
Nov
(22) |
Dec
(32) |
2014 |
Jan
(16) |
Feb
(16) |
Mar
(42) |
Apr
(179) |
May
(7) |
Jun
(6) |
Jul
(9) |
Aug
|
Sep
(4) |
Oct
|
Nov
(3) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
|
|
1
|
2
|
3
(1) |
4
|
5
|
6
|
7
|
8
|
9
|
10
(1) |
11
|
12
|
13
(5) |
14
(1) |
15
(1) |
16
|
17
(3) |
18
(1) |
19
(11) |
20
|
21
|
22
|
23
(1) |
24
|
25
|
26
(1) |
27
|
28
(2) |
29
|
30
|
31
|
|
|
|
|
|
From: mason_s <ma...@us...> - 2010-05-26 18:09:07
|
Project "Postgres-XC". The branch, master has been updated via 54529d7ad914e2959d7243055bbec08302c7e8dc (commit) from 45617c6321fa7a95d0b062f0918c9d9935f7fe53 (commit) - Log ----------------------------------------------------------------- commit 54529d7ad914e2959d7243055bbec08302c7e8dc Author: Mason S <mas...@ma...> Date: Wed May 26 14:08:02 2010 -0400 Minor change that updates COPY so that it knows ahead of time whether or not it should only execute on the Coordinator (pg_catalog tables). Written by Michael Paquier diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index 0fd4cb9..d641df8 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -800,6 +800,32 @@ CopyQuoteIdentifier(StringInfo query_buf, char *value) } #endif +#ifdef PGXC +/* + * In case there is no locator info available, copy to/from is launched in portal on coordinator. + * This happens for pg_catalog tables (not user defined ones) + * such as pg_catalog, pg_attribute, etc. + * This part is launched before the portal is activated, so check a first time if there + * some locator data for this relid and if no, return and launch the portal. + */ +bool +IsCoordPortalCopy(const CopyStmt *stmt) +{ + RelationLocInfo *rel_loc; /* the locator key */ + + /* In the case of a COPY SELECT, this is launched on datanodes */ + if(!stmt->relation) + return false; + + rel_loc = GetRelationLocInfo(RangeVarGetRelid(stmt->relation, true)); + + if (!rel_loc) + return true; + + return false; +} +#endif + /* * DoCopy executes the SQL COPY statement * @@ -832,7 +858,7 @@ CopyQuoteIdentifier(StringInfo query_buf, char *value) */ uint64 #ifdef PGXC -DoCopy(const CopyStmt *stmt, const char *queryString, bool exec_on_coord_portal, bool *executed) +DoCopy(const CopyStmt *stmt, const char *queryString, bool exec_on_coord_portal) #else DoCopy(const CopyStmt *stmt, const char *queryString) #endif @@ -1155,21 +1181,6 @@ DoCopy(const CopyStmt *stmt, const char *queryString) exec_nodes = (Exec_Nodes *) palloc0(sizeof(Exec_Nodes)); cstate->rel_loc = GetRelationLocInfo(RelationGetRelid(cstate->rel)); - /* - * In case there is no locator info available, copy to/from is launched in portal on coordinator. - * This happens for pg_catalog tables (not user defined ones) - * such as pg_catalog, pg_attribute, etc. - * This part is launched before the portal is activated, so check a first time if there - * some locator data for this relid and if no, return and launch the portal. - */ - if (!cstate->rel_loc && !exec_on_coord_portal) - { - /* close lock before leaving */ - if (cstate->rel) - heap_close(cstate->rel, (is_from ? NoLock : AccessShareLock)); - *executed = false; - return 0; - } if (exec_on_coord_portal) cstate->on_coord = true; @@ -1552,9 +1563,6 @@ DoCopy(const CopyStmt *stmt, const char *queryString) pfree(cstate->raw_buf); pfree(cstate); -#ifdef PGXC - *executed = true; -#endif return processed; } diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index cce476d..a0c0d90 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -992,17 +992,18 @@ exec_simple_query(const char *query_string) /* * A check on locator is made in DoCopy to determine if the copy can be launched on * Datanode or on Coordinator. - * If a table has no locator data, then done is set to false and copy is launched + * If a table has no locator data, then IsCoordPortalCopy returns false and copy is launched * on Coordinator instead (e.g., using pg_catalog tables). - * If a table has some locator data (user tables), then copy was launched normally + * If a table has some locator data (user tables), then copy is launched normally * in Datanodes */ - DoCopy(copy, query_string, false, &done); - - if (!done) - exec_on_coord = true; - else + if (!IsCoordPortalCopy(copy)) + { + DoCopy(copy, query_string, false); exec_on_coord = false; + } + else + exec_on_coord = true; } else { diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index b6275d9..6965e2e 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -602,7 +602,7 @@ ProcessUtility(Node *parsetree, uint64 processed; #ifdef PGXC bool done; - processed = DoCopy((CopyStmt *) parsetree, queryString, true, &done); + processed = DoCopy((CopyStmt *) parsetree, queryString, true); #else processed = DoCopy((CopyStmt *) parsetree, queryString): #endif diff --git a/src/include/commands/copy.h b/src/include/commands/copy.h index 7c0b4ca..5e7830a 100644 --- a/src/include/commands/copy.h +++ b/src/include/commands/copy.h @@ -18,7 +18,8 @@ #include "tcop/dest.h" #ifdef PGXC -extern uint64 DoCopy(const CopyStmt *stmt, const char *queryString, bool exec_on_coord_portal, bool *executed); +extern uint64 DoCopy(const CopyStmt *stmt, const char *queryString, bool exec_on_coord_portal); +extern bool IsCoordPortalCopy(const CopyStmt *stmt); #else extern uint64 DoCopy(const CopyStmt *stmt, const char *queryString); #endif ----------------------------------------------------------------------- Summary of changes: src/backend/commands/copy.c | 46 +++++++++++++++++++++++++----------------- src/backend/tcop/postgres.c | 15 +++++++------ src/backend/tcop/utility.c | 2 +- src/include/commands/copy.h | 3 +- 4 files changed, 38 insertions(+), 28 deletions(-) hooks/post-receive -- Postgres-XC |