Skip site navigation (1) Skip section navigation (2)

Re: pg_comments

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_comments
Date: 2010-09-24 13:41:14
Message-ID: 13599.1285335674@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)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

In response to

pgsql-hackers by date

Next:From: Heikki LinnakangasDate: 2010-09-24 13:51:42
Subject: Re: Configuring synchronous replication
Previous:From: Magnus HaganderDate: 2010-09-24 13:23:32
Subject: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group