pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Docs for Generated Columns
4+ messages / 3 participants
[nested] [flat]

* Docs for Generated Columns
@ 2019-05-23 21:50 Tobias Bussmann <t.bussmann@gmx.net>
  2019-05-24 12:21 ` Re: Docs for Generated Columns Joe Conway <mail@joeconway.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tobias Bussmann @ 2019-05-23 21:50 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org

Hi,

while reading though the docs of the upcoming pg12 features, I stumbled upon some wording regarding generated columns:

both in create_table.sgml [1] and create_foreign_table.sgml [2] the paragraph for the GENERATED ALWAYS AS clause is introduced with 

> This clause creates the column as a generated column. The column cannot be written to, and when read it will be computed from the specified expression.

To me this sounds confusing, if not wrong. Till v8 of the patch were STORED and VIRTUAL generated columns were described afterwards this was less obvious but now with only STORED it sounds like a reference to the VIRTUAL variant. Not being I native english speaker I'm restrained to send a patch but may I suggest the following for discussion:

  The column cannot be written to, and when read the result of the specified expression will be returned.

Best regards
Tobias Bussmann

[1]: https://www.postgresql.org/docs/devel/sql-createtable.html
[2]: https://www.postgresql.org/docs/devel/sql-createforeigntable.html




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Docs for Generated Columns
  2019-05-23 21:50 Docs for Generated Columns Tobias Bussmann <t.bussmann@gmx.net>
@ 2019-05-24 12:21 ` Joe Conway <mail@joeconway.com>
  2019-05-26 20:42   ` Re: Docs for Generated Columns Tobias Bussmann <t.bussmann@gmx.net>
  0 siblings, 1 reply; 4+ messages in thread

From: Joe Conway @ 2019-05-24 12:21 UTC (permalink / raw)
  To: Tobias Bussmann <t.bussmann@gmx.net>; pgsql-docs@lists.postgresql.org

On 5/23/19 5:50 PM, Tobias Bussmann wrote:
> while reading though the docs of the upcoming pg12 features, I
> stumbled upon some wording regarding generated columns: both in
> create_table.sgml [1] and create_foreign_table.sgml [2] the paragraph
> for the GENERATED ALWAYS AS clause is introduced with
>> This clause creates the column as a generated column. The column
>> cannot be written to, and when read it will be computed from the
>> specified expression.

> To me this sounds confusing, if not wrong. Till v8 of the patch were
> STORED and VIRTUAL generated columns were described afterwards this
> was less obvious but now with only STORED it sounds like a reference
> to the VIRTUAL variant.

No doubt this is flat out wrong.


> Not being I native english speaker I'm restrained to send a patch but
> may I suggest the following for discussion:

> The column cannot be written to, and when read the result of the
> specified expression will be returned.


That sounds reasonable to me.

Joe

-- 
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Docs for Generated Columns
  2019-05-23 21:50 Docs for Generated Columns Tobias Bussmann <t.bussmann@gmx.net>
  2019-05-24 12:21 ` Re: Docs for Generated Columns Joe Conway <mail@joeconway.com>
@ 2019-05-26 20:42   ` Tobias Bussmann <t.bussmann@gmx.net>
  2019-05-27 16:38     ` Re: Docs for Generated Columns Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tobias Bussmann @ 2019-05-26 20:42 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org; +Cc: Joe Conway <mail@joeconway.com>

On 24.05.2019 14:21, Joe Conway <mail@joeconway.com> wrote:
>> The column cannot be written to, and when read the result of the
>> specified expression will be returned.
> That sounds reasonable to me.

Thank you for confirmation and review. Please find attached my proposed little doc patch for this issue.

Tobias

Attachments:

001-reword-gen-col-docs.patch (application/octet-stream, 1.4K) download diff --git a/doc/src/sgml/ref/create_foreign_table.sgml b/doc/src/sgml/ref/create_foreign_table.sgml index 5db15eb73e..25d2f09ed2 100644 --- a/doc/src/sgml/ref/create_foreign_table.sgml +++ b/doc/src/sgml/ref/create_foreign_table.sgml @@ -268,8 +268,8 @@ CHECK ( <replaceable class="parameter">expression</replaceable> ) [ NO INHERIT ] <listitem> <para> This clause creates the column as a <firstterm>generated - column</firstterm>. The column cannot be written to, and when read it - will be computed from the specified expression. + column</firstterm>. The column cannot be written to, and when read the + result of the specified expression will be returned. </para> <para> diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml index 44a61ef99e..8e1bfe4d78 100644 --- a/doc/src/sgml/ref/create_table.sgml +++ b/doc/src/sgml/ref/create_table.sgml @@ -813,8 +813,8 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM <listitem> <para> This clause creates the column as a <firstterm>generated - column</firstterm>. The column cannot be written to, and when read it - will be computed from the specified expression. + column</firstterm>. The column cannot be written to, and when read the + result of the specified expression will be returned. </para> <para>
^ permalink raw reply [nested|flat] 4+ messages in thread

* Re: Docs for Generated Columns
  2019-05-23 21:50 Docs for Generated Columns Tobias Bussmann <t.bussmann@gmx.net>
  2019-05-24 12:21 ` Re: Docs for Generated Columns Joe Conway <mail@joeconway.com>
  2019-05-26 20:42   ` Re: Docs for Generated Columns Tobias Bussmann <t.bussmann@gmx.net>
@ 2019-05-27 16:38     ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Peter Eisentraut @ 2019-05-27 16:38 UTC (permalink / raw)
  To: Tobias Bussmann <t.bussmann@gmx.net>; pgsql-docs@lists.postgresql.org; +Cc: Joe Conway <mail@joeconway.com>

On 2019-05-26 16:42, Tobias Bussmann wrote:
> On 24.05.2019 14:21, Joe Conway <mail@joeconway.com> wrote:
>>> The column cannot be written to, and when read the result of the
>>> specified expression will be returned.
>> That sounds reasonable to me.
> 
> Thank you for confirmation and review. Please find attached my proposed little doc patch for this issue.

committed

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2019-05-27 16:38 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23 21:50 Docs for Generated Columns Tobias Bussmann <t.bussmann@gmx.net>
2019-05-24 12:21 ` Joe Conway <mail@joeconway.com>
2019-05-26 20:42   ` Tobias Bussmann <t.bussmann@gmx.net>
2019-05-27 16:38     ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox