Re: Why there is no records?

From: Igor Korot <ikorot01(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Why there is no records?
Date: 2026-02-17 00:15:23
Message-ID: CA+FnnTyio1AUiz48jHwHXXgr149c=YMRObJeKci+rGF9BkvSrw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thx.

On Mon, Feb 16, 2026 at 6:03 PM Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> wrote:
>
> On 2/16/26 15:59, Igor Korot wrote:
> > Hi,
> >
> > draft=# SELECT n.nspname, c.oid FROM pg_constraint c, pg_namespace n
> > WHERE c.oid = n.oid AND c.conname = 'leagues_pkey';
>
> Because you are doing:
>
> c.oid = n.oid
>
> which is comparing the pg_constraint.oid to the pg_namespace.oid which
> are not the same thing.
>
> You need:
>
> c.connamespace = n.oid
>
>
> > nspname | oid
> > ---------+-----
> > (0 rows)
> >
> > draft=# SELECT * FROM pg_constraint WHERE conname = 'leagues_pkey';
> > oid | conname | connamespace | contype | condeferrable |
> > condeferred | convalidated | conrelid | contypid | conindid |
> > conparentid | confrelid | confupdtype | confdeltype | confmatchtype |
> > conislocal | coninhcount | connoinherit | conkey | confkey | conpfeqop
> > | conppeqop | conffeqop | confdelsetcols | conexclop | conbin
> > -------+--------------+--------------+---------+---------------+-------------+--------------+----------+----------+----------+-------------+-----------+-------------+-------------+---------------+------------+-------------+--------------+--------+---------+-----------+-----------+-----------+----------------+-----------+--------
> > 16395 | leagues_pkey | 2200 | p | f | f
> > | t | 16390 | 0 | 16394 | 0 |
> > 0 | | | | t |
> > 0 | t | {1} | | | |
> > | | |
> > (1 row)
> >
> > Thank you.
> >
> >
>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2026-02-17 00:38:48 Where the info is stored
Previous Message Adrian Klaver 2026-02-17 00:03:46 Re: Why there is no records?