Re: information_schema.check_constraints Inconsistencies

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Hristo Ivanov <hristo(dot)atanassov(at)gmail(dot)com>
Cc: Postgres Bug <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: information_schema.check_constraints Inconsistencies
Date: 2018-09-18 19:28:10
Message-ID: CAKFQuwZM3a4YhtEx7TJxM4wxrvCRcLq1b_MpjvuHHGgmoePwPQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Sep 18, 2018 at 11:16 AM, Hristo Ivanov <hristo(dot)atanassov(at)gmail(dot)com>
wrote:

> Hello,
>
> I am writing with regards to some wrong results I keep on receiving when
> using check_constraints view from information_schema:
>
> (1) First, it shows constraints grouped by name, regardless of the
> relation used: when having two constraints with the same name in different
> tables, it shows both in both tables, regardless of their belonging;
>

Per the note here:

https://www.postgresql.org/docs/current/static/information-schema.html

You cannot use the standard information_schema.check_constraints in your
database because you have not conformed to the standard when naming your
constraints. Either ensure unique names for all constraints (in a schema)
or use pg_catalog.

> (2) Second, it also lists NOT NULL constraints, even though they are not
> created as check constraints.
>

That is has special syntax for its creation doesn't mean it isn't
functionally a check constraint...so on its face this seems OK.

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrew Gierth 2018-09-18 19:59:10 Re: information_schema.check_constraints Inconsistencies
Previous Message Tom Lane 2018-09-18 18:27:50 Re: BUG #15388: time convert error when use AT TIME ZONE '+8'