![]() ![]() HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF Moat, Inc. Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies. AuthorĬorey Huinker, while working at Moat Copyright and License Submit issues to the GitHub issue tracker. range: text representation of the range enforced by the check constraint.partition_number: the number of this partition, used only to ensure unique partition names.partition_class: points to the pg_class entry for the partition.Master_class oid not null references master(master_class), Partition_class oid not null primary key, nsert_trigger_function: name of the trigger function created for this tableĮvery partition must have an entry in this table.range_type: points to the range pg_type.partition_attribute: the name of the column on which the table is partitioned.master_class: points to the pg_class entry for the table that is partitioned.Part_test.bar | part_test.bar_p1 | (,A) | str = 'A' and str < 'C'Įvery table that is range partitioned will have an entry here. The fragment will be expressed as simple >= '4' and y = '4' and z = 'C' Given the oid of a partition, return the WHERE-clause fragment that fits the range for that partition. ![]() Select drop_partition('part_test.foo_p1','part_test.foo_p0') drop_partition p_new_partition_range: The name of a partiiton that is adjacent to p_drop_partition_name, that will annex the range of the dropped partition.p_drop_partition_name: The name of the partition to be dropped.P_adjacent_partition_name text) returns void Merge one partition into an existing adjacent partition.įunction drop_partition (p_drop_partition_name text, Select create_partition('part_test.foo','[5000,)') create_partition This value must be a perfect subset of one of the existing partitions in the table. p_new_partition_range: The range of the new partition.Select c.relname, p.partition_number, p.rangeĬreate a new partition by splitting it off from an existing, unspecified partition.įunction create_partition ( p_qual_table_name text, Select create_parent('part_test.foo','x') create_parent The default is to use the schema of the parent table. p_dest_schema_name: The name of the schema where new partitions should be created.p_range_column_name: The column in the parent table which will be the partition key.p_qual_table_name: The qualified name of the table to be partitioned.P_dest_schema text default null) returns voidĬonvert a table from a normal table to the parent of a single partition.Ĭreate the metadata entries in master and partition to reflect this change.Ĭreate the necessary trigger such that rows inserted into the parent table actually go into the appropriate partiiton. The extension is relocatable, and it is suggested that a schema be specified.ĬREATE EXTENSION range_partitioning SCHEMA range_partitioning įunction create_parent( p_qual_table_name text, Partition by ranges, leveraging the range types available in PostgreSQL. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |