Re: Problem about partitioned table - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Problem about partitioned table
Date
Msg-id cd6eb200-2e23-cc67-8637-6dab57cee47d@aklaver.com
Whole thread Raw
In response to Problem about partitioned table  (Mehman Jafarov <mehmanjafarov84@gmail.com>)
List pgsql-general
On 10/19/18 2:03 AM, Mehman Jafarov wrote:
> Hi everyone,
> 
> I have a problem with partitioned table in PostgreSql.
> Actually I use the version 10. I created the partitioned table in test 
> environment but face some problems with partitioned table constraint.
> I google all about it last week and from the official site I get that 
> version 11 will be released and that feature will be supported as I 
> understand it.
>  From version 11 documentation
> "/Add support for |PRIMARY KEY|, |FOREIGN KEY|, indexes, and triggers on 
> partitioned tables/"
> I install and configure yesterday as new 11 version released. And test 
> it. Unfortunately I didn't achieve again.
> Neither I don't understand the new feature nor this case is actually not 
> supported.
> Please help me about the problem.

As you found out:

https://www.postgresql.org/docs/11/static/ddl-partitioning.html

5.10.2.3. Limitations

"While primary keys are supported on partitioned tables, foreign keys 
referencing partitioned tables are not supported. (Foreign key 
references from a partitioned table to some other table are supported.)"


> 
>    Note: I want to create constraint only one-to-one column 
> (/fk_to_user_doc_rel - oid/)
> 
> BIG QUESTION IS THAT
> 
> How can I solve this problem?  What is your recommendations?

Well a FK is a form of a trigger, so maybe create your own trigger on 
the child table(s).

> 
> *PLEASE HELP ME !!!*
> 
> -- 
> */Best Regards,/*
> */Mehman Jafarov/*
> */DBA Aministrator at CyberNet LLC/*
> */
> /*


-- 
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: Igor Korot
Date:
Subject: Fwd: What is the problem with this code?
Next
From: Adrian Klaver
Date:
Subject: Re: PGDG status and policy