Try adding type cast with tablespace

From: 程ゆき <yukiteipg(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Try adding type cast with tablespace
Date: 2023-09-22 04:49:56
Message-ID: CAL2RU8oOdg0iQQZBEUFhU+9PbCcCYDaTKk2uLb+fhkiZMS0L6Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

Good day!

I am a newbee to PostgreSQL and recently came across an idea about
type-casting tablespace OID.

The motibation is that when I have to upgrade a PostgreSQL database, we
need to join other tables to

track tablespace name. I have just created a simple patch to resolve this.

Hope you can take a look with this.

My Execution Sample:

# After Patch:

------------------------------------------------------------------------

postgres=# SELECT oid,oid::regtablespace,spcname from pg_tablespace ;

oid | oid | spcname

------+------------+------------

1663 | pg_default | pg_default

1664 | pg_global | pg_global

(2 rows)

------------------------------------------------------------------------

# Before Patch

------------------------------------------------------------------------

postgres-# SELECT oid,oid::regtablespace,spcname from pg_tablespace ;

ERROR: syntax error at or near "oid"

LINE 1: oid | oid | spcname

^

------------------------------------------------------------------------

I added the "::regtablespace" part to source.

Note: While developing, I also had to add several rows to pgcatalog tables.

Please point out if any OID newly assigned is not appropriate.

Kind Regards,

Yuki Tei

Attachment Content-Type Size
regproc_new_feature.patch text/x-diff 7.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2023-09-22 04:53:02 Re: [HACKERS] Should logtape.c blocks be of type long?
Previous Message Michael Paquier 2023-09-22 04:46:07 Re: [HACKERS] Should logtape.c blocks be of type long?