relid of non user created tables

Started by Deepak Salmost 11 years ago3 messages
#1Deepak S
in.live.in@live.in

Hi, I find that the relid of tables in all user created databases are having a value greater than 10,000 while the non user created tables produces a relid of value less than 10,000.
For eg., the query transformed from the meta command "\dt" or "\l" gave me 'relid' values like 2615, 1259 and 1262 whereas a query to a table created by me gave 'relids' like 18414, 16565.
I wish to know if it is safe to assume that non user created tables always have a relid of less than 10,000 (I chose this value after trial and error).
Kindly reply.
ThanksDeepak

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Deepak S (#1)
Re: relid of non user created tables

Deepak S <in.live.in@live.in> writes:

I wish to know if it is safe to assume that non user created tables always have a relid of less than 10,000 (I chose this value after trial and error).

Depends what you consider "user created". System catalogs with
manually-assigned OIDs will have OIDs below 10K, but initdb creates
numerous things that don't have manually-assigned OIDs. And what of,
say, TOAST tables attached to user tables?

You might find the comments for FirstNormalObjectId in
src/include/access/transam.h enlightening.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Jim Nasby
Jim.Nasby@BlueTreble.com
In reply to: Tom Lane (#2)
Re: relid of non user created tables

On 2/7/15 5:55 AM, Tom Lane wrote:

Deepak S <in.live.in@live.in> writes:

I wish to know if it is safe to assume that non user created tables always have a relid of less than 10,000 (I chose this value after trial and error).

Depends what you consider "user created". System catalogs with
manually-assigned OIDs will have OIDs below 10K, but initdb creates
numerous things that don't have manually-assigned OIDs. And what of,
say, TOAST tables attached to user tables?

You might find the comments for FirstNormalObjectId in
src/include/access/transam.h enlightening.

I think the better question is "Why do you want to know this?" I suspect
there's a better way to do whatever you're trying to do.
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers