2

There is this question that is important to answer. I tend to think that since 'regclass' is an alias for OID the answer is 'OID'. Am I right here? Help will be appreciated

1 Answer 1

3

regclass and the other reg types are "object identifier types". As the documentation says:

The oid type is currently implemented as an unsigned four-byte integer.

[...]

The OID alias types have no operations of their own except for specialized input and output routines. These routines are able to accept and display symbolic names for system objects, rather than the raw numeric value that type oid would use.

So it is just a convenience: it really is the numeric object ID, but is displayed as the object name.

regclass can be cast to numerical data types: then it will become the oid value.

regclass can also be cast to text: then it will become the table name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.