Re: pg_comments - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_comments
Date
Msg-id 13599.1285335674@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_comments  (KaiGai Kohei <kaigai@ak.jp.nec.com>)
List pgsql-hackers
KaiGai Kohei <kaigai@ak.jp.nec.com> writes:
> It seems to me the query should be fixed up as follows:

>     :
> WHERE
>     d.classoid = (SELECT oid FROM pg_class WHERE relname = 'pg_largeobject'
>               AND relnamespace = (SELECT oid FROM pg_namespace
>                       WHERE nspname = 'pg_catalog'))
>     :

Actually, the preferred way to spell that sort of thing is
WHERE    d.classoid = 'pg_catalog.pg_largeobject'::regclass

which is not only shorter but orders of magnitude more efficient.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running
Next
From: Heikki Linnakangas
Date:
Subject: Re: Configuring synchronous replication