Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-28 Thread Gilles Darold
Le 28/10/2021 à 16:31, Bruce Momjian a écrit : > On Thu, Oct 28, 2021 at 11:30:27AM +0200, Gilles Darold wrote: >> Fixed with new patch version v7 attached. It also fixes unwanted change >> of some regression tests output reported by the cfbot because I forgot >> to change my locale. >> >> >> I

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-28 Thread Bruce Momjian
On Thu, Oct 28, 2021 at 11:30:27AM +0200, Gilles Darold wrote: > Fixed with new patch version v7 attached. It also fixes unwanted change > of some regression tests output reported by the cfbot because I forgot > to change my locale. > > > I will also add a pg_dump test to verify that ALTER ...

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-28 Thread Erik Rijkers
Op 27-10-2021 om 18:02 schreef Gilles Darold: Otherwise, build, make check, chekc-world are OK.  Also the pdf builds ok. Thanks Erik, new version v6 attached. Hi, Anther small thing: the test_decoding module was overlooked, I think. Below is output from make check-world (this error does

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-27 Thread Erik Rijkers
Op 27-10-2021 om 16:33 schreef Gilles Darold: - Fix documentation about some sgml tag broken. About ROWTYPE generating an error when SELECT * INTO or RETURNING * INTO is used with unexpanded column, I have kept things like that because it is the normal behavior. I have checked on others

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-18 Thread Alvaro Herrera
On 2021-Oct-18, Gilles Darold wrote: > Le 18/10/2021 à 18:54, Alvaro Herrera a écrit : > > I suggest to look for output test files that are being massively > > modified by this patch. I think those are likely unintended: > > > >> diff --git a/src/test/regress/expected/collate.icu.utf8.out > >>

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-18 Thread Alvaro Herrera
I suggest to look for output test files that are being massively modified by this patch. I think those are likely unintended: > diff --git a/src/test/regress/expected/collate.icu.utf8.out > b/src/test/regress/expected/collate.icu.utf8.out > diff --git

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-18 Thread Gilles Darold
Le 18/10/2021 à 17:24, Vik Fearing a écrit : > On 10/18/21 8:44 AM, Gilles Darold wrote: >> Le 17/10/2021 à 23:48, Isaac Morland a écrit : >>> On Sun, 17 Oct 2021 at 17:42, Gilles Darold >> > wrote: >>> >>> Note that psql doesn't display a separate line for each row in

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-18 Thread Vik Fearing
On 10/18/21 8:44 AM, Gilles Darold wrote: > Le 17/10/2021 à 23:48, Isaac Morland a écrit : >> On Sun, 17 Oct 2021 at 17:42, Gilles Darold > > wrote: >> >> Note that psql doesn't display a separate line for each row in this >> case, but the actual result coming back from

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-18 Thread Gilles Darold
Le 17/10/2021 à 23:48, Isaac Morland a écrit : > On Sun, 17 Oct 2021 at 17:42, Gilles Darold > wrote: > > Perhaps I misunderstand what you are saying, but a no-columns table > definitely can return rows: > > psql (12.2) > Type "help" for help. > > postgres=# create table

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-17 Thread Isaac Morland
On Sun, 17 Oct 2021 at 17:42, Gilles Darold wrote: > Yes, my first though was to allow all columns to be unexpandable like a > table without column, but the the problem is that when you execute > "SELECT * FROM nada" it returns no rows which is not the case of a table > with hidden column. I

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-17 Thread Gilles Darold
Le 17/10/2021 à 23:04, Vik Fearing a écrit : > On 10/17/21 11:01 PM, Gilles Darold wrote: >>   - Add a check into SET UNEXPANDED code to verify that there is at >> least one column expanded. > What is the point of this? Postgres allows column-less tables. > > Both of these statements are valid: >

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-17 Thread Vik Fearing
On 10/17/21 11:01 PM, Gilles Darold wrote: > >   - Add a check into SET UNEXPANDED code to verify that there is at > least one column expanded. What is the point of this? Postgres allows column-less tables. Both of these statements are valid: - CREATE TABLE nada (); - SELECT; -- Vik

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-16 Thread Gilles Darold
Le 15/10/2021 à 20:51, Bruce Momjian a écrit : > Why is this not better addressed by creating a view on the original > table, even perhaps renaming the original table and create a view using > the old table name. Because when you use the view for the select you can not use the "hidden" column in

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-16 Thread Gilles Darold
Le 15/10/2021 à 18:42, Aleksander Alekseev a écrit : > Hi Gilles, > >> Yes, I don't wanted to offend you or to troll. This was just to point >> that the position of "SELECT * is bad practice" is not a good argument >> in my point of view, just because it is allowed for every one. I mean >> that in

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-15 Thread Gilles Darold
Le 15/10/2021 à 21:52, Andrew Dunstan a écrit : On 10/15/21 2:51 PM, Bruce Momjian wrote: On Fri, Oct 15, 2021 at 11:32:53AM +0200, Laurenz Albe wrote: On Thu, 2021-10-14 at 13:16 +0200, Gilles Darold wrote: Here is a proposal to implement HIDDEN columns feature in PostgreSQL. The user

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-15 Thread Andrew Dunstan
On 10/15/21 2:51 PM, Bruce Momjian wrote: > On Fri, Oct 15, 2021 at 11:32:53AM +0200, Laurenz Albe wrote: >> On Thu, 2021-10-14 at 13:16 +0200, Gilles Darold wrote: >>> Here is a proposal to implement HIDDEN columns feature in PostgreSQL. >>> >>> The user defined columns are always visible in

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-15 Thread Bruce Momjian
On Fri, Oct 15, 2021 at 11:32:53AM +0200, Laurenz Albe wrote: > On Thu, 2021-10-14 at 13:16 +0200, Gilles Darold wrote: > > Here is a proposal to implement HIDDEN columns feature in PostgreSQL. > > > > The user defined columns are always visible in the PostgreSQL. If user > > wants to hide some

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-15 Thread Julien Rouhaud
On Fri, Oct 15, 2021 at 9:40 PM Dave Cramer wrote: > > On Fri, 15 Oct 2021 at 09:29, Gilles Darold wrote: >> >> Yes, I don't wanted to offend you or to troll. This was just to point >> that the position of "SELECT * is bad practice" is not a good argument >> in my point of view, just because it

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-15 Thread Aleksander Alekseev
Hi Gilles, > Yes, I don't wanted to offend you or to troll. This was just to point > that the position of "SELECT * is bad practice" is not a good argument > in my point of view, just because it is allowed for every one. I mean > that in an extension or a client which allow user query input we

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-15 Thread Dave Cramer
On Fri, 15 Oct 2021 at 09:29, Gilles Darold wrote: > Le 15/10/2021 à 14:24, Aleksander Alekseev a écrit : > > Hi Gilles, > > > >> If we really want SELECT * to be reserved to DBA then why not removing > the > >> star from PG unless you have the admin privilege? > > Respectfully, I perceive this

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-15 Thread Gilles Darold
Le 15/10/2021 à 14:24, Aleksander Alekseev a écrit : Hi Gilles, If we really want SELECT * to be reserved to DBA then why not removing the star from PG unless you have the admin privilege? Respectfully, I perceive this as a trolling (presumably, non-intentional one) and not going to answer

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-15 Thread Aleksander Alekseev
Hi Gilles, > But we have more and more application coming from others RDBMS with sometime > no real possibility to modify the code or which requires lot of work. Somehow I feel everyone here very well understood the real motivation behind this proposal from the beginning, considering the e-mail

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-15 Thread Laurenz Albe
On Thu, 2021-10-14 at 13:16 +0200, Gilles Darold wrote: > Here is a proposal to implement HIDDEN columns feature in PostgreSQL. > > The user defined columns are always visible in the PostgreSQL. If user > wants to hide some column(s) from a SELECT * returned values then the > hidden columns

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-15 Thread Gilles Darold
Le 15/10/2021 à 10:37, Aleksander Alekseev a écrit : Hi Gilles, > I can turn the column hidden and I will not have to modify my old very good application. I see your point. At the same time, I believe the statement above shows the root reason why we have a different view on this feature.

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-15 Thread Aleksander Alekseev
Hi Gilles, > I can turn the column hidden and I will not have to modify my old very good application. I see your point. At the same time, I believe the statement above shows the root reason why we have a different view on this feature. The application should have never use SELECT * in the first

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-15 Thread Gilles Darold
Le 15/10/2021 à 09:47, Aleksander Alekseev a écrit : Just to remind here, there was recently a proposal to handle this problem another way - provide a list of columns to skip for "star selection" aka "SELECT * EXCEPT col1...".

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-15 Thread Aleksander Alekseev
Hi hackers, > > Just to remind here, there was recently a proposal to handle this > > problem another way - provide a list of columns to skip for "star > > selection" aka "SELECT * EXCEPT col1...". > > > > https://postgrespro.com/list/id/d51371a2-f221-1cf3-4a7d-b2242d4da...@gmail.com > > [...] >

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Gilles Darold
Le 14/10/2021 à 22:01, Gavin Flower a écrit : > On 15/10/21 07:01, Josef Šimánek wrote: >> čt 14. 10. 2021 v 13:17 odesílatel Gilles Darold >> napsal: >>> Hi, >>> >>> >>> Here is a proposal to implement HIDDEN columns feature in PostgreSQL. >>> >>> The user defined columns are always visible in

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Rod Taylor
On Thu, 14 Oct 2021 at 07:16, Gilles Darold wrote: > Hi, > > Here is a proposal to implement HIDDEN columns feature in PostgreSQL. > > The user defined columns are always visible in the PostgreSQL. If user > wants to hide some column(s) from a SELECT * returned values then the > hidden columns

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Gavin Flower
On 15/10/21 07:01, Josef Šimánek wrote: čt 14. 10. 2021 v 13:17 odesílatel Gilles Darold napsal: Hi, Here is a proposal to implement HIDDEN columns feature in PostgreSQL. The user defined columns are always visible in the PostgreSQL. If user wants to hide some column(s) from a SELECT *

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Gilles Darold
Le 14/10/2021 à 20:55, Gilles Darold a écrit : gilles=# SELECT row_to_json(t.*) FROM htest0 t;    row_to_json --  {"a":1,"b":"htest0 one"}  {"a":2,"b":"htest0 two"} (2 rows) gilles=# SELECT row_to_json(t) FROM htest0 t;    row_to_json --  

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Gilles Darold
Le 14/10/2021 à 20:26, Tom Lane a écrit : "David G. Johnston" writes: Taking this a bit further, I dislike tying the suppression of the column from the select-list star to the behavior of insert without a column list provided. I’m not fully on board with having an attribute that is not

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Gilles Darold
Le 14/10/2021 à 20:43, Tom Lane a écrit : Re-reading that, I realize I probably left way too much unstated, so let me spell it out. Should this feature affect SELECT * FROM my_table t; ? Yes, absolutely. How about SELECT t.* FROM my_table t; ? Yup, one would think so. Now

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Tom Lane
I wrote: > Yeah, me too. I think it would add a lot of clarity if we defined this > as "this affects the behavior of SELECT * and nothing else" ... although > even then, there are squishy questions about how much it affects the > behavior of composite datums that are using the column's rowtype.

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Gilles Darold
Le 14/10/2021 à 19:44, Tom Lane a écrit : As for the proposal itself, I'm kind of allergic to the terminology you've suggested, because the column is in no way hidden. It's still visible in the catalogs, you can still select it explicitly, etc. Anybody who thinks this is useful from a security

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Tom Lane
"David G. Johnston" writes: > Taking this a bit further, I dislike tying the suppression of the column > from the select-list star to the behavior of insert without a column list > provided. I’m not fully on board with having an attribute that is not > fundamental to the data model but rather an

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread David G. Johnston
On Thursday, October 14, 2021, Tom Lane wrote: > Gilles Darold writes: > > Le 14/10/2021 à 17:38, Jaime Casanova a écrit : > >> On Thu, Oct 14, 2021 at 01:16:45PM +0200, Gilles Darold wrote: > > > Why not, I will add it if there is a consencus about logging hidden > > column use, this is not a

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Josef Šimánek
čt 14. 10. 2021 v 13:17 odesílatel Gilles Darold napsal: > > Hi, > > > Here is a proposal to implement HIDDEN columns feature in PostgreSQL. > > The user defined columns are always visible in the PostgreSQL. If user > wants to hide some column(s) from a SELECT * returned values then the > hidden

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Tom Lane
Gilles Darold writes: > Le 14/10/2021 à 17:38, Jaime Casanova a écrit : >> On Thu, Oct 14, 2021 at 01:16:45PM +0200, Gilles Darold wrote: >>> Here is a proposal to implement HIDDEN columns feature in PostgreSQL. >> Another use case I can think of is not covered in this patch, but it >> could be

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Gilles Darold
Le 14/10/2021 à 17:38, Jaime Casanova a écrit : On Thu, Oct 14, 2021 at 01:16:45PM +0200, Gilles Darold wrote: Hi, Here is a proposal to implement HIDDEN columns feature in PostgreSQL. Great! Actually I found this very useful, especially for those people using big fields (geometry, files,

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Jaime Casanova
On Thu, Oct 14, 2021 at 01:16:45PM +0200, Gilles Darold wrote: > Hi, > > > Here is a proposal to implement HIDDEN columns feature in PostgreSQL. > Great! Actually I found this very useful, especially for those people using big fields (geometry, files, large texts). > The user defined columns

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Dave Page
On Thu, Oct 14, 2021 at 2:32 PM Gilles Darold wrote: > Le 14/10/2021 à 14:28, Pavel Stehule a écrit : > > > > čt 14. 10. 2021 v 14:13 odesílatel Vik Fearing > napsal: > >> On 10/14/21 1:47 PM, Aleksander Alekseev wrote: >> > Hi Gilles, >> > >> >> Any though and interest in this feature? >> > >>

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Gilles Darold
Le 14/10/2021 à 14:28, Pavel Stehule a écrit : čt 14. 10. 2021 v 14:13 odesílatel Vik Fearing mailto:v...@postgresfriends.org>> napsal: On 10/14/21 1:47 PM, Aleksander Alekseev wrote: > Hi Gilles, > >> Any though and interest in this feature? > > Personally, I

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Gilles Darold
Le 14/10/2021 à 14:09, Aleksander Alekseev a écrit : Hi again, > So all in all, -1. [...] Here is something I would like to add: 1. As far as I know, "all the rest of DBMS have this" was never a good argument in the PostgreSQL community. Generally, using it will turn people against you.

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Gilles Darold
Le 14/10/2021 à 13:47, Aleksander Alekseev a écrit : Hi Gilles, Any though and interest in this feature? Personally, I wouldn't call this feature particularly useful. `SELECT *` is intended for people who are working with DBMS directly e.g. via psql and want to see ALL columns. The

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Pavel Stehule
čt 14. 10. 2021 v 14:13 odesílatel Vik Fearing napsal: > On 10/14/21 1:47 PM, Aleksander Alekseev wrote: > > Hi Gilles, > > > >> Any though and interest in this feature? > > > > Personally, I wouldn't call this feature particularly useful. `SELECT > > *` is intended for people who are working

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Isaac Morland
On Thu, 14 Oct 2021 at 07:17, Gilles Darold wrote: > The user defined columns are always visible in the PostgreSQL. If user > wants to hide some column(s) from a SELECT * returned values then the > hidden columns feature is useful. Hidden column can always be used and > returned by explicitly

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Aleksander Alekseev
Hi Vik, > I have not looked at the patch, but +1 for the feature. Maybe you could describe your use case in a little more detail? How did you end up working with PostGIS geometry via psql on regular basis? What exactly do you find of annoyance? How will the proposed patch help? I find it great

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Vik Fearing
On 10/14/21 1:47 PM, Aleksander Alekseev wrote: > Hi Gilles, > >> Any though and interest in this feature? > > Personally, I wouldn't call this feature particularly useful. `SELECT > *` is intended for people who are working with DBMS directly e.g. via > psql and want to see ALL columns. I

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Aleksander Alekseev
Hi again, > So all in all, -1. [...] Here is something I would like to add: 1. As far as I know, "all the rest of DBMS have this" was never a good argument in the PostgreSQL community. Generally, using it will turn people against you. 2. I recall there was a proposal of making the SQL syntax

Re: [PATCH] Proposal for HIDDEN/INVISIBLE column

2021-10-14 Thread Aleksander Alekseev
Hi Gilles, > Any though and interest in this feature? Personally, I wouldn't call this feature particularly useful. `SELECT *` is intended for people who are working with DBMS directly e.g. via psql and want to see ALL columns. The applications should never use `SELECT *`. So I can't see any