From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Mikhail Titov <mlt(at)gmx(dot)us> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: [bug+patch] Inserting DEFAULT into generated columns from VALUES RTE |
Date: | 2020-08-13 05:11:08 |
Message-ID: | CAFj8pRC4Y2V3B0HjiPNcpwMfgd2Pj4bTJQJHtZuG=g2Nx5Puiw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi
čt 13. 8. 2020 v 6:31 odesílatel Mikhail Titov <mlt(at)gmx(dot)us> napsal:
> Hello!
>
> According to the docs[1], one may use DEFAULT keyword while inserting
> into generated columns (stored and identity). However, currently it
> works only for a single VALUES sublist with DEFAULT for a generated column
> but not for the case when VALUES RTE is used. This is not being tested
> and it is broken.
>
> I am attaching two patches. One for tests and another one with the
> proposed changes based on ideas from Andrew on IRC. So if all good there
> goes the credit where credit is due. If patch is no good, then it is
> likely my misunderstanding how to put words into code :-)
>
> This is my only second patch to PostgreSQL (the first one was rejected)
> so don't be too harsh :-) It may not be perfect but I am open for a
> feedback and this is just to get the ball rolling and to let the
> community know about this issue.
>
> Before you ask why would I want to insert DEFAULTs ... well, there are
> ORMs[2] that still need to be patched and current situation contradicts
> documentation[1].
>
please, assign your patch to commitfest application
https://commitfest.postgresql.org/29/
Regards
Pavel
> Footnotes:
> [1] https://www.postgresql.org/docs/devel/ddl-generated-columns.html
>
> [2] https://github.com/rails/rails/pull/39368#issuecomment-670351379
>
> --
> Mikhail
>
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2020-08-13 05:14:33 | Re: run pgindent on a regular basis / scripted manner |
Previous Message | Tom Lane | 2020-08-13 04:58:02 | Re: Parallel query hangs after a smart shutdown is issued |