Re: Oracle to Postgres - Transform Hash Partition

From: Christoph Moench-Tegeder <cmt(at)burggraben(dot)net>
To: David Barbour <dbarbour(at)istation(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Oracle to Postgres - Transform Hash Partition
Date: 2024-06-06 18:41:40
Message-ID: ZmIC5LqJhqkaEnS-@sciurus.exwg.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

## David Barbour (dbarbour(at)istation(dot)com):

> Now I need to 'attach' the original table. The problem I'm running into is
> there are no good examples of how to define the values.

The syntax is the same as with CREATE TABLE ... PARTITION OF, e.g.
ALTER TABLE parent ATTACH TABLE part FOR VALUES WITH (MODULUS m, REMAINDER r);

> Here's an example:
> alter table idev.assessment_result_2023_dab_part
> attach partition idev.assessment_result_2023_dab for values with(modulus 8,
> remainder 1) to (modulus 8, remainder 7)

There's only one (modulus, remainder) tuple in the partition bound
definition for hash partitions, and always only one partition bound
specification per partition.
Maybe what you actually want is a DEFAULT partition (specified as
PARTITION OF parent DEFAULT), or maybe a completely different approach?

Regards,
Christoph

--
Spare Space.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alan Hodgson 2024-06-06 18:47:32 Re: Can't Remote connection by IpV6
Previous Message Avi Weinberg 2024-06-06 16:38:39 Tables get stuck at srsubstate = f