Re: Separate the attribute physical order from logical order

2022-06-28 Thread Tom Lane
Peter Geoghegan writes: > On Tue, Jun 28, 2022 at 11:47 AM Tom Lane wrote: >> Now you do need something that will make the three meanings different >> in order to test that step. But I'd suggest some bit of throwaway code >> that just assigns randomly different logical and physical orders. >

Re: Separate the attribute physical order from logical order

2022-06-28 Thread Peter Geoghegan
On Tue, Jun 28, 2022 at 11:47 AM Tom Lane wrote: > Now you do need something that will make the three meanings different > in order to test that step. But I'd suggest some bit of throwaway code > that just assigns randomly different logical and physical orders. That seems like a good idea.

Re: Separate the attribute physical order from logical order

2022-06-28 Thread Tom Lane
Alvaro Herrera writes: > If you do not provide a column identity number or you use something else > (e.g. attlognum) to cross-references attributes from other catalogs, > then you'll have to edit pg_attrdef when a column moves; and any other > reference to a column number will have to change. Or

Re: Separate the attribute physical order from logical order

2022-06-28 Thread Alvaro Herrera
On 2022-Jun-28, Julien Rouhaud wrote: > On Tue, Jun 28, 2022 at 10:53:14AM +0200, Alvaro Herrera wrote: > > My feeling is that every aspect of user interaction should show > > columns ordered in logical order. > > I'm not entirely sure of what you meant. Assuming tables a(a, z) and b(b, z), >

Re: Separate the attribute physical order from logical order

2022-06-28 Thread Julien Rouhaud
Hi, On Tue, Jun 28, 2022 at 08:38:56AM -0500, Justin Pryzby wrote: > On Tue, Jun 28, 2022 at 04:32:30PM +0800, Julien Rouhaud wrote: > > psql displays a table columns information using the logical order rather the > > physical order, and if verbose emits an addition "Physical order" footer if >

Re: Separate the attribute physical order from logical order

2022-06-28 Thread Justin Pryzby
On Tue, Jun 28, 2022 at 04:32:30PM +0800, Julien Rouhaud wrote: > psql displays a table columns information using the logical order rather the > physical order, and if verbose emits an addition "Physical order" footer if > the > logical layout is different from the physical one. FYI: the footer

Re: Separate the attribute physical order from logical order

2022-06-28 Thread Julien Rouhaud
Hi, On Tue, Jun 28, 2022 at 09:00:05AM -0400, Isaac Morland wrote: > On Tue, 28 Jun 2022 at 05:32, Julien Rouhaud wrote: > > > I think that supporting at least a way to specify the logical order during > > the > > table creation should be easy to implement (there shouldn't be any > > question on

Re: Separate the attribute physical order from logical order

2022-06-28 Thread Isaac Morland
On Tue, 28 Jun 2022 at 05:32, Julien Rouhaud wrote: > I think that supporting at least a way to specify the logical order during > the > table creation should be easy to implement (there shouldn't be any > question on whether it needs to invalidate any cache or what lock level to > use), and

Re: Separate the attribute physical order from logical order

2022-06-28 Thread Julien Rouhaud
Hi, On Tue, Jun 28, 2022 at 10:53:14AM +0200, Alvaro Herrera wrote: > On 2022-Jun-28, Julien Rouhaud wrote: > > > So, assuming that the current JOIN expansion order shouldn't be > > changed, I implemented the last approach I mentioned. > > Yeah, I'm not sure that this is a good assumption. I

Re: Separate the attribute physical order from logical order

2022-06-28 Thread Alvaro Herrera
On 2022-Jun-28, Julien Rouhaud wrote: > So, assuming that the current JOIN expansion order shouldn't be > changed, I implemented the last approach I mentioned. Yeah, I'm not sure that this is a good assumption. I mean, if logical order is the order in which users see the table columns, then why