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) |
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
(1) |
16
(3) |
17
|
18
|
19
|
20
|
21
|
22
|
23
|
24
(2) |
25
|
26
|
27
(1) |
28
(1) |
29
(1) |
30
(1) |
|
|
|
From: mason_s <ma...@us...> - 2010-06-01 21:07:02
|
Project "Postgres-XC". The branch, master has been updated via ffe244ab59c464283ac1833e13377782bee1c122 (commit) from 63b0858e76a740e6b0a5e30fa27d7b1d761ac6af (commit) - Log ----------------------------------------------------------------- commit ffe244ab59c464283ac1833e13377782bee1c122 Author: Mason S <mas...@ma...> Date: Tue Jun 1 17:05:56 2010 -0400 Support for pg_dump and pg_restore. The CREATE TABLE command generation now includes distribution information. Written by Michael Paquier diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index fdb9564..ec86c18 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -3187,6 +3187,10 @@ getTables(int *numTables) int i_relfrozenxid; int i_owning_tab; int i_owning_col; +#ifdef PGXC + int i_pgxclocatortype; + int i_pgxcattnum; +#endif int i_reltablespace; int i_reloptions; int i_toastreloptions; @@ -3219,6 +3223,8 @@ getTables(int *numTables) /* * Left join to pick up dependency info linking sequences to their * owning column, if any (note this dependency is AUTO as of 8.2) + * PGXC is based on PostgreSQL version 8.4, it is not necessary to + * to modify the other SQL queries. */ appendPQExpBuffer(query, "SELECT c.tableoid, c.oid, c.relname, " @@ -3230,7 +3236,11 @@ getTables(int *numTables) "d.refobjid AS owning_tab, " "d.refobjsubid AS owning_col, " "(SELECT spcname FROM pg_tablespace t WHERE t.oid = c.reltablespace) AS reltablespace, " - "array_to_string(c.reloptions, ', ') AS reloptions, " +#ifdef PGXC + "(SELECT pclocatortype from pgxc_class v where v.pcrelid = c.oid) AS pgxclocatortype," + "(SELECT pcattnum from pgxc_class v where v.pcrelid = c.oid) AS pgxcattnum," +#endif + "array_to_string(c.reloptions, ', ') AS reloptions, " "array_to_string(array(SELECT 'toast.' || x FROM unnest(tc.reloptions) x), ', ') AS toast_reloptions " "FROM pg_class c " "LEFT JOIN pg_depend d ON " @@ -3448,6 +3458,10 @@ getTables(int *numTables) i_relfrozenxid = PQfnumber(res, "relfrozenxid"); i_owning_tab = PQfnumber(res, "owning_tab"); i_owning_col = PQfnumber(res, "owning_col"); +#ifdef PGXC + i_pgxclocatortype = PQfnumber(res, "pgxclocatortype"); + i_pgxcattnum = PQfnumber(res, "pgxcattnum"); +#endif i_reltablespace = PQfnumber(res, "reltablespace"); i_reloptions = PQfnumber(res, "reloptions"); i_toastreloptions = PQfnumber(res, "toast_reloptions"); @@ -3495,6 +3509,19 @@ getTables(int *numTables) tblinfo[i].owning_tab = atooid(PQgetvalue(res, i, i_owning_tab)); tblinfo[i].owning_col = atoi(PQgetvalue(res, i, i_owning_col)); } +#ifdef PGXC + /* Not all the tables have pgxc locator Data */ + if (PQgetisnull(res, i, i_pgxclocatortype)) + { + tblinfo[i].pgxclocatortype = 'E'; + tblinfo[i].pgxcattnum = 0; + } + else + { + tblinfo[i].pgxclocatortype = *(PQgetvalue(res, i, i_pgxclocatortype)); + tblinfo[i].pgxcattnum = atoi(PQgetvalue(res, i, i_pgxcattnum)); + } +#endif tblinfo[i].reltablespace = strdup(PQgetvalue(res, i, i_reltablespace)); tblinfo[i].reloptions = strdup(PQgetvalue(res, i, i_reloptions)); tblinfo[i].toast_reloptions = strdup(PQgetvalue(res, i, i_toastreloptions)); @@ -9939,6 +9966,30 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) appendPQExpBuffer(q, ")"); } +#ifdef PGXC + /* Add the grammar extension linked to PGXC depending on data got from pgxc_class */ + if (tbinfo->pgxclocatortype != 'E') + { + /* N: DISTRIBUTE BY ROUND ROBIN */ + if (tbinfo->pgxclocatortype == 'N') + { + appendPQExpBuffer(q, "\nDISTRIBUTE BY ROUND ROBIN"); + } + /* R: DISTRIBUTE BY REPLICATED */ + else if (tbinfo->pgxclocatortype == 'R') + { + appendPQExpBuffer(q, "\nDISTRIBUTE BY REPLICATION"); + } + /* H: DISTRIBUTE BY HASH */ + else if (tbinfo->pgxclocatortype == 'H') + { + int hashkey = tbinfo->pgxcattnum; + appendPQExpBuffer(q, "\nDISTRIBUTE BY HASH (%s)", + fmtId(tbinfo->attnames[hashkey - 1])); + } + } +#endif + appendPQExpBuffer(q, ";\n"); /* diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h index a9b3dae..276a3d6 100644 --- a/src/bin/pg_dump/pg_dump.h +++ b/src/bin/pg_dump/pg_dump.h @@ -16,6 +16,10 @@ #include "postgres_fe.h" +#ifdef PGXC +#include "pgxc/pgxc.h" +#endif + /* * pg_dump uses two different mechanisms for identifying database objects: * @@ -234,6 +238,11 @@ typedef struct _tableInfo bool interesting; /* true if need to collect more data */ +#ifdef PGXC + /* PGXC table locator Data */ + char pgxclocatortype; /* Type of PGXC table locator */ + int pgxcattnum; /* Number of the attribute the table is partitioned with */ +#endif /* * These fields are computed only if we decide the table is interesting * (it's either a table to dump, or a direct parent of a dumpable table). ----------------------------------------------------------------------- Summary of changes: src/bin/pg_dump/pg_dump.c | 53 ++++++++++++++++++++++++++++++++++++++++++++- src/bin/pg_dump/pg_dump.h | 9 +++++++ 2 files changed, 61 insertions(+), 1 deletions(-) hooks/post-receive -- Postgres-XC |
From: mason_s <ma...@us...> - 2010-06-01 20:14:49
|
Project "Postgres-XC". The branch, master has been updated via 63b0858e76a740e6b0a5e30fa27d7b1d761ac6af (commit) from 7b0d97791bdd0483e4ec9fe4079f494b76523b25 (commit) - Log ----------------------------------------------------------------- commit 63b0858e76a740e6b0a5e30fa27d7b1d761ac6af Author: Mason S <mas...@ma...> Date: Tue Jun 1 16:04:43 2010 -0400 Add support for immutable stored functions and enable support for many other DDL commands (some of which also depend on stored functions), like CREATE OPERATOR. Written by Michael Paquier diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index f0989bf..b1349de 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -875,6 +875,17 @@ CreateFunction(CreateFunctionStmt *stmt, const char *queryString) interpret_AS_clause(languageOid, languageName, funcname, as_clause, &prosrc_str, &probin_str); +#ifdef PGXC + /* + * For the time being, only immutable functions are allowed to be created + * for a user. A superuser can create volatile and stable functions freely. + */ + if (volatility != PROVOLATILE_IMMUTABLE && !superuser()) + ereport(ERROR, + (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION), + errmsg("stable and volatile not yet supported, function volatility has to be immutable"))); +#endif + /* * Set default values for COST and ROWS depending on other parameters; * reject ROWS if it's not returnsSet. NB: pg_dump knows these default diff --git a/src/backend/pgxc/plan/planner.c b/src/backend/pgxc/plan/planner.c index ffb2631..13a0f8b 100644 --- a/src/backend/pgxc/plan/planner.c +++ b/src/backend/pgxc/plan/planner.c @@ -1373,8 +1373,6 @@ GetQueryPlan(Node *parsetree, const char *sql_statement, List *querytree_list) break; /* Statements that we only want to execute on the Coordinator */ - case T_AlterSeqStmt: - case T_CommentStmt: case T_CreateSeqStmt: case T_VariableShowStmt: query_plan->exec_loc_type = EXEC_ON_COORD; @@ -1400,26 +1398,104 @@ GetQueryPlan(Node *parsetree, const char *sql_statement, List *querytree_list) query_plan->exec_loc_type = EXEC_ON_COORD | EXEC_ON_DATA_NODES; query_plan->force_autocommit = true; break; + case T_AlterObjectSchemaStmt: + /* Sequences are just defined on coordinator */ + if (((AlterObjectSchemaStmt *) parsetree)->objectType == OBJECT_SEQUENCE) + query_plan->exec_loc_type = EXEC_ON_COORD; + else + query_plan->exec_loc_type = EXEC_ON_COORD | EXEC_ON_DATA_NODES; + break; + case T_AlterSeqStmt: + /* Alter sequence is not supported yet, it needs complementary interactions with GTM */ + ereport(ERROR, + (errcode(ERRCODE_STATEMENT_TOO_COMPLEX), + (errmsg("This command is not yet supported")))); + break; + case T_AlterTableStmt: + /* + * ALTER SEQUENCE needs some interactions with GTM, + * this query is not supported yet. + */ + if (((AlterTableStmt *) parsetree)->relkind == OBJECT_SEQUENCE) + ereport(ERROR, + (errcode(ERRCODE_STATEMENT_TOO_COMPLEX), + (errmsg("Cannot yet alter a sequence")))); + else + query_plan->exec_loc_type = EXEC_ON_COORD | EXEC_ON_DATA_NODES; + break; + case T_CommentStmt: + /* Sequences are only defined on coordinator */ + if (((CommentStmt *) parsetree)->objtype == OBJECT_SEQUENCE) + query_plan->exec_loc_type = EXEC_ON_COORD; + else + query_plan->exec_loc_type = EXEC_ON_COORD | EXEC_ON_DATA_NODES; + break; + case T_RenameStmt: + /* Sequences are only defined on coordinator */ + if (((RenameStmt *) parsetree)->renameType == OBJECT_SEQUENCE) + /* + * Renaming a sequence requires interactions with GTM + * what is not supported yet + */ + ereport(ERROR, + (errcode(ERRCODE_STATEMENT_TOO_COMPLEX), + (errmsg("Sequence renaming not yet supported, you should drop it and created a new one")))); + else + query_plan->exec_loc_type = EXEC_ON_COORD | EXEC_ON_DATA_NODES; + break; + case T_DropPropertyStmt: + /* + * Triggers are not yet supported by PGXC + * all other queries are executed on both Coordinator and Datanode + * On the same point, assert also is not supported + */ + if (((DropPropertyStmt *)parsetree)->removeType == OBJECT_TRIGGER) + ereport(ERROR, + (errcode(ERRCODE_STATEMENT_TOO_COMPLEX), + (errmsg("This command is not yet supported.")))); + else + query_plan->exec_loc_type = EXEC_ON_COORD | EXEC_ON_DATA_NODES; + break; /* * Statements that we execute on both the Coordinator and Data Nodes */ - case T_AlterTableStmt: case T_AlterDatabaseStmt: case T_AlterDatabaseSetStmt: case T_AlterDomainStmt: - case T_AlterObjectSchemaStmt: + case T_AlterFdwStmt: + case T_AlterForeignServerStmt: + case T_AlterFunctionStmt: + case T_AlterOpFamilyStmt: + case T_AlterTSConfigurationStmt: + case T_AlterTSDictionaryStmt: + case T_ClosePortalStmt: /* In case CLOSE ALL is issued */ + case T_CompositeTypeStmt: case T_ConstraintsSetStmt: + case T_CreateCastStmt: + case T_CreateConversionStmt: case T_CreateDomainStmt: case T_CreateEnumStmt: + case T_CreateFdwStmt: + case T_CreateForeignServerStmt: + case T_CreateFunctionStmt: /* Only global functions are supported */ + case T_CreateOpClassStmt: + case T_CreateOpFamilyStmt: + case T_CreatePLangStmt: case T_CreateStmt: case T_CreateSchemaStmt: case T_DeallocateStmt: /* Allow for DEALLOCATE ALL */ case T_DiscardStmt: + case T_DropCastStmt: + case T_DropFdwStmt: + case T_DropForeignServerStmt: + case T_DropPLangStmt: case T_IndexStmt: case T_LockStmt: case T_ReindexStmt: - case T_RenameStmt: + case T_RemoveFuncStmt: + case T_RemoveOpClassStmt: + case T_RemoveOpFamilyStmt: case T_TruncateStmt: case T_VariableSetStmt: @@ -1431,15 +1507,18 @@ GetQueryPlan(Node *parsetree, const char *sql_statement, List *querytree_list) case T_GrantRoleStmt: case T_CreateRoleStmt: case T_AlterRoleStmt: + case T_AlterRoleSetStmt: + case T_AlterUserMappingStmt: + case T_CreateUserMappingStmt: case T_DropRoleStmt: case T_AlterOwnerStmt: case T_DropOwnedStmt: + case T_DropUserMappingStmt: case T_ReassignOwnedStmt: case T_DefineStmt: /* used for aggregates, some types */ query_plan->exec_loc_type = EXEC_ON_COORD | EXEC_ON_DATA_NODES; break; - case T_TransactionStmt: switch (((TransactionStmt *) parsetree)->kind) { @@ -1463,52 +1542,43 @@ GetQueryPlan(Node *parsetree, const char *sql_statement, List *querytree_list) * data node will do */ case T_ExplainStmt: + if (((ExplainStmt *) parsetree)->analyze) + ereport(ERROR, + (errcode(ERRCODE_STATEMENT_TOO_COMPLEX), + (errmsg("ANALYZE with EXPLAIN is currently not supported.")))); + + query_step->exec_nodes = palloc0(sizeof(Exec_Nodes)); query_step->exec_nodes->nodelist = GetAnyDataNode(); + query_step->exec_nodes->baselocatortype = LOCATOR_TYPE_RROBIN; query_plan->exec_loc_type = EXEC_ON_DATA_NODES; break; /* - * Statements we do not yet want to handle. + * Trigger queries are not yet supported by PGXC. + * Tablespace queries are also not yet supported. + * Two nodes on the same servers cannot use the same tablespace. + */ + case T_CreateTableSpaceStmt: + case T_CreateTrigStmt: + case T_DropTableSpaceStmt: + ereport(ERROR, + (errcode(ERRCODE_STATEMENT_TOO_COMPLEX), + (errmsg("This command is not yet supported.")))); + break; + + /* + * Other statements we do not yet want to handle. * By default they would be fobidden, but we list these for reference. * Note that there is not a 1-1 correspndence between * SQL command and the T_*Stmt structures. */ - case T_AlterFdwStmt: - case T_AlterForeignServerStmt: - case T_AlterFunctionStmt: - case T_AlterOpFamilyStmt: - case T_AlterTSConfigurationStmt: - case T_AlterTSDictionaryStmt: - case T_AlterUserMappingStmt: - case T_ClosePortalStmt: - case T_CompositeTypeStmt: - case T_CreateCastStmt: - case T_CreateConversionStmt: - case T_CreateFdwStmt: - case T_CreateFunctionStmt: - case T_CreateForeignServerStmt: - case T_CreateOpClassStmt: - case T_CreateOpFamilyStmt: - case T_CreatePLangStmt: - case T_CreateTableSpaceStmt: - case T_CreateTrigStmt: - case T_CreateUserMappingStmt: case T_DeclareCursorStmt: - case T_DropCastStmt: - case T_DropFdwStmt: - case T_DropForeignServerStmt: - case T_DropPLangStmt: - case T_DropPropertyStmt: - case T_DropTableSpaceStmt: case T_ExecuteStmt: case T_FetchStmt: case T_ListenStmt: case T_LoadStmt: case T_NotifyStmt: case T_PrepareStmt: - case T_RemoveFuncStmt: - case T_RemoveOpClassStmt: - case T_RemoveOpFamilyStmt: case T_RuleStmt: case T_UnlistenStmt: case T_ViewStmt: ----------------------------------------------------------------------- Summary of changes: src/backend/commands/functioncmds.c | 11 +++ src/backend/pgxc/plan/planner.c | 142 ++++++++++++++++++++++++++--------- 2 files changed, 117 insertions(+), 36 deletions(-) hooks/post-receive -- Postgres-XC |