Re: Where the info is stored - Mailing list pgsql-general

From David G. Johnston
Subject Re: Where the info is stored
Date
Msg-id CAKFQuwbTpwDiUy=azMGk8tMo7w2ysWC1h02NmURCqGRqcAhSCw@mail.gmail.com
Whole thread
In response to Re: Where the info is stored  (Igor Korot <ikorot01@gmail.com>)
Responses Re: Where the info is stored
List pgsql-general
On Sat, Feb 28, 2026 at 6:34 PM Igor Korot <ikorot01@gmail.com> wrote:
And why there is no WHERE populated?

Thank you.

On Sat, Feb 28, 2026 at 7:05 PM Igor Korot <ikorot01@gmail.com> wrote:
>
> Hi, David,
>
> On Sat, Feb 28, 2026 at 7:02 PM David G. Johnston
> <david.g.johnston@gmail.com> wrote:
> >
> > On Saturday, February 28, 2026, Igor Korot <ikorot01@gmail.com> wrote:
> >>
> >> FROM pg_constraint co, pg_namespace n, pg_class
> >>
> >> As you can see only the constraint name and the tablespace are
> >> populated correctly.
> >
> >
> > Constraints don’t have included columns.  Only indexes do.  You need to query the index, not the constraint.
>
> I literally copied your query into my code and it didn't populated
> anything...
>
> Am I missing something?


I trimmed your query to emphasize/point-out that you were querying pg_constraint and that doing so to find included columns is doomed to failure (I suppose it could have been used to find the index, but in this case it wasn't.  I haven't explored that approach.).  You should step back and consider why you thought the fragment I included in my reply, a bare FROM clause, would somehow be executable since it is in no way a valid query.

David J.

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Where the info is stored
Next
From: Igor Korot
Date:
Subject: Re: Where the info is stored