pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Mehman Jafarov <mehmanjafarov84@gmail.com>
To: pgsql-general@postgresql.org
Cc: pgsql-hackers@postgresql.org
Cc: support@enterprisedb.com
Cc: de@postgresql.org
Cc: contact@postgresql.tw
Cc: info@itpug.org
Cc: webmaster@itpug.org
Cc: majordomo@postgresql.org
Cc: info@postgres.de
Subject: Re: Problem about partitioned table
Date: Fri, 19 Oct 2018 07:31:24 -0700
Message-ID: <cd6eb200-2e23-cc67-8637-6dab57cee47d@aklaver.com> (raw)
In-Reply-To: <CAMZYErRSQd8jwp2EOFC12_avknpAUm32Rp1qSJcfHe7Ri42aWw@mail.gmail.com>
References: <CAMZYErRSQd8jwp2EOFC12_avknpAUm32Rp1qSJcfHe7Ri42aWw@mail.gmail.com>

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




view thread (2+ messages)

Message-ID: <cd6eb200-2e23-cc67-8637-6dab57cee47d@aklaver.com>
Permalink:  ../cd6eb200-2e23-cc67-8637-6dab57cee47d@aklaver.com/
Also on:    postgresql.org/message-id/cd6eb200-2e23-cc67-8637-6dab57cee47d@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, mehmanjafarov84@gmail.com, pgsql-hackers@postgresql.org, support@enterprisedb.com, de@postgresql.org, contact@postgresql.tw, info@itpug.org, webmaster@itpug.org, majordomo@postgresql.org, info@postgres.de
  Subject: Re: Problem about partitioned table
  In-Reply-To: <cd6eb200-2e23-cc67-8637-6dab57cee47d@aklaver.com>
  References: <CAMZYErRSQd8jwp2EOFC12_avknpAUm32Rp1qSJcfHe7Ri42aWw@mail.gmail.com> <cd6eb200-2e23-cc67-8637-6dab57cee47d@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox