Support for Physical Column Reordering in PG

From: Srinath Reddy Sadipiralla <srinath2133(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Support for Physical Column Reordering in PG
Date: 2025-05-18 17:26:54
Message-ID: CAFC+b6o2_0f9kF84ofX_yr63SLvoXvWrZxZascMFwRDXo48WDw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,is there any better way to change the order of a column except
1) creating a new table and do insert with select with rearranged columns
2) using views

use case:
there are cases where we might be using delta compression between tuples we
have a table like
"create table temp(x bigint,y char(3),z integer);"
If we have tuple values,for the column y less than 3, SQL standard does
padding to make the length = 3,which causes delta noise,so to reduce this
noise we reposition the column y at the end ,which helps us to reduce the
delta between tuples.

So is making a patch to have a sql command to reposition the column like
other databases makes sense? thoughts ?

--
Thanks,
Srinath Reddy Sadipiralla
EDB: https://www.enterprisedb.com/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-05-18 18:36:42 Re: PG 17.2 compilation fails with -std=c11 on mac
Previous Message Mihail Nikalayeu 2025-05-18 16:09:29 Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements