Re: Try adding type cast with tablespace

Поиск
Список
Период
Сортировка
От Kenichiro Tanaka
Тема Re: Try adding type cast with tablespace
Дата
Msg-id CALyBiZ+jhTTL7ZwDk7cPP8Z8_ey96maZLqNhKR0eQz1i89a_hQ@mail.gmail.com
обсуждение исходный текст
Ответ на Try adding type cast with tablespace  (程ゆき <yukiteipg@gmail.com>)
Ответы Re: Try adding type cast with tablespace  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hello,Yuki.

My understanding is that your patch is aimed to enrich an alias type for oid.
There are already some alias types for oid so I think it is good to
add regtablespace for convenience.

https://www.postgresql.org/docs/16/datatype-oid.html#DATATYPE-OID-TABLE

Actually,I also felt it is a bit of a hassle to join tables to find
tablespace name from pg_database,
it is convenient if I can use regtablespace alias.

Therefore I think it is good to add regtablespace alias,but I’m also
newbie pgsql-hackers.
We need some senior hackers’s opinions.

Kind Regards,
Kenichiro Tanaka
>
> 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Vik Fearing
Дата:
Сообщение: Re: Allow deleting enumerated values from an existing enumerated data type
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Try adding type cast with tablespace