[Django] #29444: Allow modification of RETURNING values in django.contrib.postgres

38 views
Skip to first unread message

Django

unread,
May 25, 2018, 11:23:43 AM5/25/18
to django-...@googlegroups.com
#29444: Allow modification of RETURNING values in django.contrib.postgres
-------------------------------------+-------------------------------------
Reporter: Johannes | Owner: (none)
Hoppe |
Type: New | Status: new
feature |
Component: | Version: 2.0
contrib.postgres | Keywords: django, db,
Severity: Normal | returning, default, model, field
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Dependency for #27452

The SQL `RETURNING` statement is currently used for inserts of new
objects. Mainly it is responsible to return the primary key in a single
query.

That's great but currently in the postgres database backend this value is
hard coded to only the primary key. I would like to propose to make this
configurable.

There are plenty of uses cases for such a feature ultimately even enabling
database defaults, but I would suggest to keep it very simple for now.

I would suggest to simply allow model fields to specify if they should be
included in the returning statement or not. The default being not (except
PK) to maintain the current behavior.

The implementation as well as the related code lines have been already
discussed here:
https://github.com/django/django/pull/7525#issuecomment-354269077

I highly suggest to keep this a Postgres ONLY feature for now. That way we
can see what sticks and consider extending this functionality into
`django.db` in the future after we have seen how it's being used and
gathered feedback.

--
Ticket URL: <https://code.djangoproject.com/ticket/29444>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 25, 2018, 11:34:30 AM5/25/18
to django-...@googlegroups.com
#29444: Allow modification of RETURNING values in django.contrib.postgres
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: (none)
Type: New feature | Status: new
Component: contrib.postgres | Version: master
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage:
returning, default, model, field | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Johannes Hoppe):

* version: 2.0 => master


--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:1>

Django

unread,
May 26, 2018, 4:34:05 AM5/26/18
to django-...@googlegroups.com
#29444: Allow modification of RETURNING values in django.contrib.postgres
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
| Hoppe
Type: New feature | Status: assigned

Component: contrib.postgres | Version: master
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage:
returning, default, model, field | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Johannes Hoppe):

* owner: (none) => Johannes Hoppe
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:2>

Django

unread,
May 26, 2018, 8:07:31 AM5/26/18
to django-...@googlegroups.com
#29444: Allow modification of RETURNING values in django.contrib.postgres
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
| Hoppe
Type: New feature | Status: assigned
Component: contrib.postgres | Version: master
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage:
returning, default, model, field | Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Johannes Hoppe):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:3>

Django

unread,
May 27, 2018, 8:59:37 AM5/27/18
to django-...@googlegroups.com
#29444: Allow modification of RETURNING values in django.contrib.postgres
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
| Hoppe
Type: New feature | Status: assigned
Component: contrib.postgres | Version: master
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Johannes Hoppe):

* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:4>

Django

unread,
Aug 18, 2018, 2:19:29 PM8/18/18
to django-...@googlegroups.com
#29444: Allow modification of RETURNING values in django.contrib.postgres
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
| Hoppe
Type: New feature | Status: assigned
Component: contrib.postgres | Version: master
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Johannes Hoppe):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:5>

Django

unread,
Aug 22, 2018, 11:18:25 AM8/22/18
to django-...@googlegroups.com
#29444: Allow modification of RETURNING values in django.contrib.postgres
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
| Hoppe
Type: New feature | Status: assigned
Component: contrib.postgres | Version: master
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:6>

Django

unread,
Aug 23, 2018, 10:55:41 AM8/23/18
to django-...@googlegroups.com
#29444: Allow modification of RETURNING values in django.contrib.postgres
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned

Component: contrib.postgres | Version: master
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Johannes Hoppe):

* needs_better_patch: 1 => 0

* type: New feature => Cleanup/optimization


--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:7>

Django

unread,
Sep 8, 2018, 11:10:42 AM9/8/18
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT

-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |

Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_better_patch: 0 => 1

* component: contrib.postgres => Database layer (models, ORM)


Comment:

A number of Oracle test failures remain.

--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:8>

Django

unread,
Sep 9, 2018, 9:37:58 AM9/9/18
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Johannes Hoppe):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:9>

Django

unread,
Dec 23, 2018, 11:14:42 AM12/23/18
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Johannes Hoppe):

* needs_better_patch: 1 => 0


Comment:

I fixed a couple of things. Nothing fails for me now locally that doesn't
fail on master. Can you trigger it again?

Django

unread,
Jan 30, 2019, 3:50:29 PM1/30/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"b131f9c79f3284f7220c65ceb9125ba4278dc0a4" b131f9c7]:
{{{
#!CommitTicketReference repository=""
revision="b131f9c79f3284f7220c65ceb9125ba4278dc0a4"
Refs #29444 -- Renamed DatabaseFeatures.can_return_id* to be generic for
other columns.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:10>

Django

unread,
Jan 30, 2019, 3:55:04 PM1/30/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_better_patch: 0 => 1


Comment:

You should be able to trigger the Oracle build yourself as described on
wiki:Jenkins. I ran the tests locally and put the failures in a PR
comment.

--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:11>

Django

unread,
Feb 26, 2019, 7:00:44 AM2/26/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Johannes Hoppe):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:12>

Django

unread,
Jun 7, 2019, 6:43:12 AM6/7/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:13>

Django

unread,
Jun 11, 2019, 1:58:43 AM6/11/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Johannes Hoppe):

* needs_tests: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:14>

Django

unread,
Jul 5, 2019, 4:16:04 AM7/5/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1

* has_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:15>

Django

unread,
Jul 5, 2019, 4:16:30 AM7/5/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1

Django

unread,
Jul 6, 2019, 8:48:36 AM7/6/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Johannes Hoppe):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:16>

Django

unread,
Jul 8, 2019, 4:22:45 AM7/8/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"bc91f27a86090b4c688b56cd4e37f95eebe6e969" bc91f27a]:
{{{
#!CommitTicketReference repository=""
revision="bc91f27a86090b4c688b56cd4e37f95eebe6e969"
Refs #29444 -- Added support for fetching a returned non-integer insert
values on Oracle.

This is currently not actively used, since the ORM will ask the
SQL compiler to only return auto fields.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:17>

Django

unread,
Jul 8, 2019, 4:32:57 AM7/8/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:18>

Django

unread,
Jul 13, 2019, 9:44:09 AM7/13/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Johannes Hoppe):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:19>

Django

unread,
Sep 3, 2019, 7:06:19 AM9/3/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"003bb34b218adb23d1a7e67932a6ba9b3c4dcc81" 003bb34b]:
{{{
#!CommitTicketReference repository=""
revision="003bb34b218adb23d1a7e67932a6ba9b3c4dcc81"
Refs #29444 -- Made db.backends.oracle.utils.InsertVar use str as default.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:20>

Django

unread,
Sep 6, 2019, 4:33:15 AM9/6/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Ready for
returning, default, model, field | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:21>

Django

unread,
Sep 9, 2019, 5:12:17 AM9/9/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Ready for
returning, default, model, field | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"736e7d44de395b867011ff9237dc5fdcfd28ee66" 736e7d44]:
{{{
#!CommitTicketReference repository=""
revision="736e7d44de395b867011ff9237dc5fdcfd28ee66"
Refs #29444 -- Fixed DateField constructor in
db.backends.oracle.utils.InsertVar.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:22>

Django

unread,
Sep 9, 2019, 5:12:19 AM9/9/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Ready for
returning, default, model, field | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"7254f1138d9c51fa558229c39c9559b369c4278a" 7254f113]:
{{{
#!CommitTicketReference repository=""
revision="7254f1138d9c51fa558229c39c9559b369c4278a"
Refs #29444 -- Allowed returning multiple fields from INSERT statements on
PostgreSQL.

Thanks Florian Apolloner, Tim Graham, Simon Charette, Nick Pope, and
Mariusz Felisiak for reviews.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:23>

Django

unread,
Sep 9, 2019, 5:16:28 AM9/9/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Ready for
returning, default, model, field | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* Attachment "refs-29444-oracle-part.diff" added.


--
Ticket URL: <https://code.djangoproject.com/ticket/29444>

Django

unread,
Sep 9, 2019, 5:18:09 AM9/9/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* has_patch: 1 => 0
* stage: Ready for checkin => Accepted


Comment:

This ticket is doable on Oracle with `cx_Oracle` 6.3+ (see
[https://blogs.oracle.com/opal/python-cx_oracle-63-supports-dml-returning-
for-batch-statement-execution cx_oracle-63-supports-dml-returning-for-
batch-statement]) that's why I'm leaving it open. First attempt of fixing
this on Oracle was a part of the original PR (see
[https://code.djangoproject.com/attachment/ticket/29444/refs-29444-oracle-
part.diff a diff]).

--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:24>

Django

unread,
Sep 16, 2019, 7:13:20 AM9/16/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/11782 PR with adding support on
Oracle]

--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:25>

Django

unread,
Sep 18, 2019, 10:02:35 PM9/18/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Johannes Hoppe):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:26>

Django

unread,
Sep 24, 2019, 6:08:04 AM9/24/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"01104368ff77c788f95377e8aceb48772a42fb42" 0110436]:
{{{
#!CommitTicketReference repository=""
revision="01104368ff77c788f95377e8aceb48772a42fb42"
Refs #29444 -- Removed redundant
DatabaseFeatures.can_return_multiple_columns_from_insert.

Unnecessary since b31e63879eb5d9717e9f890401f7222e4f00c910.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:28>

Django

unread,
Sep 24, 2019, 6:08:04 AM9/24/19
to django-...@googlegroups.com
#29444: Allow fields to be part of the RETURNING clause during INSERT
-------------------------------------+-------------------------------------
Reporter: Johannes Hoppe | Owner: Johannes
Type: | Hoppe
Cleanup/optimization | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: django, db, | Triage Stage: Accepted
returning, default, model, field |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"b31e63879eb5d9717e9f890401f7222e4f00c910" b31e6387]:
{{{
#!CommitTicketReference repository=""
revision="b31e63879eb5d9717e9f890401f7222e4f00c910"
Fixed #29444 -- Allowed returning multiple fields from INSERT statements
on Oracle.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29444#comment:27>

Reply all
Reply to author
Forward
0 new messages