Re: making relfilenodes 56 bits
От | Ashutosh Sharma |
---|---|
Тема | Re: making relfilenodes 56 bits |
Дата | |
Msg-id | CAE9k0P=VUwMpoArRrg-Pb6h=c0tK8jU=MTcOMFxpQ801BprPjQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: making relfilenodes 56 bits (Dilip Kumar <dilipbalaut@gmail.com>) |
Ответы |
Re: making relfilenodes 56 bits
|
Список | pgsql-hackers |
On Thu, Jul 28, 2022 at 5:02 PM Dilip Kumar <dilipbalaut@gmail.com> wrote:
+/* ----------
+ * RelFileNumber zero is InvalidRelFileNumber.
+ *
+ * For the system tables (OID < FirstNormalObjectId) the initial storage
Above comment says that RelFileNumber zero is invalid which is technically correct because we don't have any relation file in disk with zero number. But the point is that if someone reads below definition of CHECK_RELFILENUMBER_RANGE he/she might get confused because as per this definition relfilenumber zero is valid.
+#define CHECK_RELFILENUMBER_RANGE(relfilenumber) \
+do { \
+ if ((relfilenumber) < 0 || (relfilenumber) > MAX_RELFILENUMBER) \
+ ereport(ERROR, \
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE), \
+ errmsg("relfilenumber " INT64_FORMAT " is out of range", \
+ (relfilenumber)))); \
+} while (0)
+
+ * RelFileNumber zero is InvalidRelFileNumber.
+ *
+ * For the system tables (OID < FirstNormalObjectId) the initial storage
Above comment says that RelFileNumber zero is invalid which is technically correct because we don't have any relation file in disk with zero number. But the point is that if someone reads below definition of CHECK_RELFILENUMBER_RANGE he/she might get confused because as per this definition relfilenumber zero is valid.
+#define CHECK_RELFILENUMBER_RANGE(relfilenumber) \
+do { \
+ if ((relfilenumber) < 0 || (relfilenumber) > MAX_RELFILENUMBER) \
+ ereport(ERROR, \
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE), \
+ errmsg("relfilenumber " INT64_FORMAT " is out of range", \
+ (relfilenumber)))); \
+} while (0)
+
+ RelFileNumber relfilenumber = PG_GETARG_INT64(0);
+ CHECK_RELFILENUMBER_RANGE(relfilenumber);
+ CHECK_RELFILENUMBER_RANGE(relfilenumber);
It seems like the relfilenumber in above definition represents relfilenode value in pg_class which can hold zero value which actually means it's a mapped relation. I think it would be good to provide some clarity here.
--
With Regards,
Ashutosh Sharma.
В списке pgsql-hackers по дате отправления: