mirror of https://github.com/citusdata/citus.git
Merge pull request #2914 from citusdata/propagate_column_collate
create_distributed_table: include COLLATE on columnspull/2917/head^2
commit
169d2f193f
|
@ -8,7 +8,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
#include "c.h"
|
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
@ -28,6 +27,7 @@
|
||||||
#include "catalog/pg_attribute.h"
|
#include "catalog/pg_attribute.h"
|
||||||
#include "catalog/pg_authid.h"
|
#include "catalog/pg_authid.h"
|
||||||
#include "catalog/pg_class.h"
|
#include "catalog/pg_class.h"
|
||||||
|
#include "catalog/pg_collation.h"
|
||||||
#include "catalog/pg_extension.h"
|
#include "catalog/pg_extension.h"
|
||||||
#include "catalog/pg_foreign_data_wrapper.h"
|
#include "catalog/pg_foreign_data_wrapper.h"
|
||||||
#include "catalog/pg_index.h"
|
#include "catalog/pg_index.h"
|
||||||
|
@ -380,6 +380,13 @@ pg_get_tableschemadef_string(Oid tableRelationId, bool includeSequenceDefaults)
|
||||||
{
|
{
|
||||||
appendStringInfoString(&buffer, " NOT NULL");
|
appendStringInfoString(&buffer, " NOT NULL");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (attributeForm->attcollation != InvalidOid &&
|
||||||
|
attributeForm->attcollation != DEFAULT_COLLATION_OID)
|
||||||
|
{
|
||||||
|
appendStringInfo(&buffer, " COLLATE %s", generate_collation_name(
|
||||||
|
attributeForm->attcollation));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -448,6 +448,13 @@ CREATE TABLE test_schema_support.nation_hash_collation(
|
||||||
n_regionkey integer not null,
|
n_regionkey integer not null,
|
||||||
n_comment varchar(152)
|
n_comment varchar(152)
|
||||||
);
|
);
|
||||||
|
SELECT master_get_table_ddl_events('test_schema_support.nation_hash_collation') ORDER BY 1;
|
||||||
|
master_get_table_ddl_events
|
||||||
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
ALTER TABLE test_schema_support.nation_hash_collation OWNER TO postgres
|
||||||
|
CREATE TABLE test_schema_support.nation_hash_collation (n_nationkey integer NOT NULL, n_name character(25) NOT NULL COLLATE test_schema_support.english, n_regionkey integer NOT NULL, n_comment character varying(152))
|
||||||
|
(2 rows)
|
||||||
|
|
||||||
SELECT master_create_distributed_table('test_schema_support.nation_hash_collation', 'n_nationkey', 'hash');
|
SELECT master_create_distributed_table('test_schema_support.nation_hash_collation', 'n_nationkey', 'hash');
|
||||||
master_create_distributed_table
|
master_create_distributed_table
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
|
@ -338,6 +338,7 @@ CREATE TABLE test_schema_support.nation_hash_collation(
|
||||||
n_regionkey integer not null,
|
n_regionkey integer not null,
|
||||||
n_comment varchar(152)
|
n_comment varchar(152)
|
||||||
);
|
);
|
||||||
|
SELECT master_get_table_ddl_events('test_schema_support.nation_hash_collation') ORDER BY 1;
|
||||||
SELECT master_create_distributed_table('test_schema_support.nation_hash_collation', 'n_nationkey', 'hash');
|
SELECT master_create_distributed_table('test_schema_support.nation_hash_collation', 'n_nationkey', 'hash');
|
||||||
SELECT master_create_worker_shards('test_schema_support.nation_hash_collation', 4, 2);
|
SELECT master_create_worker_shards('test_schema_support.nation_hash_collation', 4, 2);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue