Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foreign keys on partitions #148

Open
did16 opened this issue Feb 20, 2018 · 12 comments
Open

Foreign keys on partitions #148

did16 opened this issue Feb 20, 2018 · 12 comments
Labels

Comments

@did16
Copy link

did16 commented Feb 20, 2018

Problem description

What is the availability date of pg_pathman 1.5 release ?.
Several projets in my firm do not want to migrate to Postgresql, because Partitioning 10 does not support primary and foreign keys. It is a big missing funtionnality.

Environment

@funbringer funbringer changed the title Availability Date Availability Date (release 1.5) Feb 20, 2018
@funbringer
Copy link
Collaborator

Hi @did16

We had some plans for 1.5, but, unfortunately, the focus has changed significantly. Our main goal now is to develop native partitioning. This effectively means that all development progress in this repo has been frozen.

However, this is not to say that we're abandoning the project completely. We will fix crucial bugs until pg_pathman becomes obsolete.

@did16
Copy link
Author

did16 commented Feb 20, 2018

Hi @funbringer
Thank you for your answer. Can you tell me if native partitioning will support primary and foreign keys and in what PostgreSQL release ?
Thanks in advance

@funbringer
Copy link
Collaborator

Can you tell me if native partitioning will support primary and foreign keys and in what PostgreSQL release?

Both primary and foreign keys require global indexes, which have not been proposed yet. Perhaps @zilder could provide a more meaningful commentary.

@did16
Copy link
Author

did16 commented Feb 20, 2018

It is a big lack.
So we need to have pg_pathman 1.5 release very soon. How can we speed the process ?

@funbringer
Copy link
Collaborator

So we need to have pg_pathman 1.5 release very soon. How can we speed the process?

Basically, you can't. We see no point in further development. Moreover, pg_pathman also requires global indexes. What we wanted to do is provide some basic support for foreign keys on partitioning key.

@funbringer
Copy link
Collaborator

You could try rel_future_beta branch, but it's rough around the edges.

@maksm90
Copy link
Contributor

maksm90 commented Feb 20, 2018

pg_pathman also requires global indexes

@funbringer, did you consider the case when global uniqueness of field that's not related with partitioning key is provided via checks on local unique indexes of partitions?

@funbringer
Copy link
Collaborator

@maksm90 Actually, I didn't. Maybe you could shed some light on this case?

@did16
Copy link
Author

did16 commented Feb 21, 2018

Hi
Can you read that post .
It is said that global unique indexes on partitioned tables is possible.

@funbringer
Copy link
Collaborator

funbringer commented Feb 21, 2018

@did16

It is said that global unique indexes on partitioned tables is possible.

This commit message is not about global indexes; it's all about a special case with partition key.

@zilder
Copy link
Collaborator

zilder commented Feb 21, 2018

I haven't seen the whole patch, but ISTM what Alvaro Herrera did is allowed to create unique constraint on partitioned tables when it is built on the same attributes as partitioning key. This doesn't mean they added global index (they use bunch of local indexes to guarantee uniqueness). And it doesn't mean you can use it for foreign key yet. But there is actually one more step left to implement that too.

In pg_pathman we experimented with that and it even worked for single level partitioning (see rel_future_ri branch). But it gets complicated with multilevel. Now we would rather focus on developing patches for postgres core itself as it will replace most of pg_pathman's features.

@ildus ildus changed the title Availability Date (release 1.5) Foreign keys on partitions Sep 24, 2018
@tarkhil
Copy link

tarkhil commented Mar 3, 2019

Hi @did16

We had some plans for 1.5, but, unfortunately, the focus has changed significantly. Our main goal now is to develop native partitioning. This effectively means that all development progress in this repo has been frozen.

Will it be available in opensource Postgres, or only in PostgresPro?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants