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: (view raw, whole thread or download thread mbox)
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:

> 	:
> 	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

		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-2017 The PostgreSQL Global Development Group