Questions tagged [pg-partman]

18 questions
3
votes
1 answer

add postgres partitioning to existing table

All examples show: CREATE TABLE ... PARTITION BY ... Which is kind of ridiculous, because the only time you would use partitioning is when a dataset has become too large, which by definition is not going to be a new table. If someone is making a…
quinn
  • 5,508
  • 10
  • 34
  • 54
2
votes
0 answers

Partitioning a postgres database by both a tenant ID and time

CREATE SCHEMA plugin_work_queue; CREATE TABLE IF NOT EXISTS plugin_work_queue.plugin_executions ( execution_key bigserial NOT NULL, tenant_id uuid NOT NULL, creation_time timestamptz NOT NULL, …
IBit
  • 380
  • 2
  • 9
2
votes
1 answer

Postgress pg_partman weekly partitioning, change week start day

I am using pg_partman on PostgreSQL DB, for creating auto partitioning for weekly data. The weeks are always created from Monday to Monday. This is the query I am using: SELECT partman.create_parent(p_parent_table => 'schema.table', …
2
votes
0 answers

pg_partman with PostgreSQL native (declarative) partitioning

This question is on the relative merits of using pg_partman with PostgreSQL 12 when relying on its native or declarative partitioning mechanism where things are a lot simplified compared to the older (and more advanced) explicit table inheritance…
lmk
  • 654
  • 5
  • 21
2
votes
1 answer

Using pg_partman with Rails and HerokuCI

In my Rails 6 app, I'm creating a table that I know will get large. So I'm partitioning it by month using pg_partman. It's hosted on Heroku, so I've followed their instructions. The migration looks something like this: class CreateReceipts <…
Schwern
  • 153,029
  • 25
  • 195
  • 336
2
votes
0 answers

Partman on PostgreSQL - Remove partition

I would like to be able to explicitly remove a partition (and its data). It would be nice if I could say: "remove the oldest table", but assuming this is not available, I'm ready to compromise on which exact partition I want to remove. I know I can…
danieln
  • 4,795
  • 10
  • 42
  • 64
1
vote
0 answers

Create pg_partman extension to docker Postgres 14

How can we add pg_partman extension to docker postgres:14 image. I have DB that needs this extension.. https://gist.github.com/jgould22/3280fc0f531485f4fe19a2ef1ef67361 this does not work
1
vote
1 answer

Error when installing pg_partman and pg_squeeze with postgres 12 on ubuntu 18

I have a dedicated server (ubuntu 18) for database, which has postgres 10,11 and 12 installed. I am currently using postgres 12. I am trying to install pg_partman and pg_squeeze extension on postgres 12. I have downloaded the git repo in…
Omer Farooq
  • 3,754
  • 6
  • 31
  • 60
0
votes
0 answers

pg_cron Multiple Statements to run pg_partman maintenance

I'm trying to implement automation on pg_partman maintenance using pg_cron, but the cron job needs to run with a role that doesn't have LOGIN permissions. My though was that I could do something like this: SELECT cron.schedule('Partition…
0
votes
0 answers

Create parent without template table using pg_partman

I installed pg_partman extension and it seems to work well, but I have a problem, using the function create_parent. Using it without specifying p_template_table will generate a template table automatically. But I don't want that, because I don't…
kovalensue
  • 124
  • 11
0
votes
0 answers

pg_partman offline partitioning is moving 0 rows at final step despite identical source and destination tables

I've been following the official documentation for pg_partman, specifically partitoning an existing table using offline partitioning (https://github.com/pgpartman/pg_partman/blob/master/doc/pg_partman_howto_native.md). The reason for this change is…
CODon
  • 1
  • 1
0
votes
0 answers

Postgres 12: Does partman still rely on template table?

I am using PostgreSQL 12 and wish to use native partitioning only (no inheritance with template table). I tried partman 4.5.1 to create the partitions for an existing partitioned table. SELECT partman.create_parent( p_parent_table =>…
Hung Ha
  • 89
  • 1
  • 4
0
votes
1 answer

Cannot install PG Partman on MacOS - Make returning error `missing separator`

I am trying to install pg_partman on my Mac. I have tried both my M1 mac and Intel mac. Both of them return the following error when I run make install: Makefile:27: *** missing separator. Stop. Line 27…
hummmingbear
  • 2,294
  • 5
  • 25
  • 42
0
votes
1 answer

creating pg_partman parent table generates error `invalid input syntax for type bigint: "monthly"`

I'm trying to use pg_partman extension for the first time but cannot create the parent table. This is my command: SELECT partman.create_parent('public.mytable_by_date','start_time','native','monthly'); That generates this error: ERROR: invalid…
rostamiani
  • 2,859
  • 7
  • 38
  • 74
0
votes
2 answers

Hide POSTGRESQL partitioned tables

I'm using pg_partman to partition three of my tables and and ended up with a large number of child tables. Some users find it difficult to navigate whit their database tool (DBeaver or SQuirreL) with this increasing number of tables showing up. Is…
1
2