LEFT JOIN used in psql describe.c

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: LEFT JOIN used in psql describe.c
Date: 2005-04-02 03:15:51
Message-ID: 200504020315.j323Fp909810@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Does anyone know why so many LEFT JOINs are used in psql/describe.c to
join to the pg_namespace table, like here:

printfPQExpBuffer(&buf,
"SELECT c.oid,\n"
" n.nspname,\n"
" c.relname\n"
"FROM pg_catalog.pg_class c\n"
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n");

processNamePattern(&buf, pattern, false, false,
"n.nspname", "c.relname", NULL,
"pg_catalog.pg_table_is_visible(c.oid)");

I thought a pg_class row always pointed to a valid pg_namespace row because
of our dependency restrictions.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-04-02 03:16:16 Re: [HACKERS] plPHP in core?
Previous Message Paul Tillotson 2005-04-02 03:14:07 Re: Debugging deadlocks