tablespace_oid alias?

Started by Thalis Kalfigkopoulosover 13 years ago2 messagesgeneral
Jump to latest
#1Thalis Kalfigkopoulos
tkalfigo@gmail.com

Hi all,

I want to get the databases that correspond to a certain tablespace
through a call to pg_tablespace_databases(tablespace_oid)

Which would be the OID alias type for tablespace_oid?

I've tried:
# select pg_tablespace_databases('pg_default'::XXX);

with XXΧ as any of the OID aliases mentioned in the manual's chapter 8
section on "Object Iddentifier Types", but without success.

Any hints? Missing something?

TIA,
Thalis K.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Thalis Kalfigkopoulos (#1)
Re: tablespace_oid alias?

Thalis Kalfigkopoulos <tkalfigo@gmail.com> writes:

Which would be the OID alias type for tablespace_oid?

There is none. Use "select oid from pg_tablespace where spcname =
'whatever'". (In general, OID alias types only get invented for
object types where the lookup rules are more complicated than that,
eg where you have schema qualification or arguments to think about.)

regards, tom lane