Re: logical column ordering

From: Arthur Silva <arthurprs(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>
Subject: Re: logical column ordering
Date: 2015-02-27 22:04:07
Message-ID: CAO_YK0WFdagCBQhs8AierEknm9Ckynfxg7LumDmZpkBbcvPJ8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Feb 27, 2015 5:02 PM, "Alvaro Herrera" <alvherre(at)2ndquadrant(dot)com> wrote:
>
> Arthur Silva wrote:
>
> > Sorry to intrude, I've been following this post and I was wondering if
it
> > would allow (in the currently planed form or in the future) a wider set
of
> > non-rewriting DDLs to Postgres. For example, drop a column without
> > rewriting the table.
>
> Perhaps. But dropping a column already does not rewrite the table, only
> marks the column as dropped in system catalogs, so do you have a better
> example.
>
> One obvious example is that you have
>
> CREATE TABLE t (
> t1 int,
> t3 int
> );
>
> and later want to add t2 in the middle, the only way currently is to
> drop the table and start again (re-creating all dependant views, FKs,
> etc). With the patch you will be able to add the column at the right
> place. If no default value is supplied for the new column, no table
> rewrite is necessary at all.
>
> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Cool! I didn't know I could drop stuff without rewriting.

Ya, that's another example, people do these from GUI tools. That's a nice
side effect. Cool (again)!

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-02-27 22:17:01 pgsql: Invent a memory context reset/delete callback mechanism.
Previous Message Pavel Stehule 2015-02-27 22:00:44 Re: Providing catalog view to pg_hba.conf file - Patch submission