| Age | Commit message (Collapse) | Author |
|
Setting "check" in OPTIONS["pool"] previously raised TypeError because the
PostgreSQL backend always passed check= to ConnectionPool() and unpacked
**pool_options on top, regardless of CONN_HEALTH_CHECKS. The user's callable
now takes precedence via setdefault(); pool_options is copied first to avoid
mutating the user's settings dict.
|
|
Based on Daniele Varrazzo's comment in https://github.com/psycopg/psycopg/issues/1273#issuecomment-3986829769
|
|
feature flag.
Now that user provided aliases are systematically quoted there is no need to
disallow the usage of the dollar sign on Postgres.
|
|
get_placeholder_sql.
The lack of ability of the get_placeholder call chain to return SQL and
parameters separated so they can be mogrified by the backend at execution time
forced implementations to dangerously interpolate potentially user controlled
values.
The get_placeholder_sql name was chosen due to its proximity to the previous
method, but other options such as Field.as_sql were considered but ultimately
rejected due to its different input signature compared to Expression.as_sql
that might have lead to confusion.
There is a lot of overlap between what Field.get_db_prep_value and
get_placeholder_sql do but folding the latter in the former would require
changing its return signature to return expression which is a way more invasive
change than what is proposed here.
Given we always call get_db_prep_value it might still be an avenue worth
exploring in the future to offer a publicly documented interface to allow field
to take an active part in the compilation chain.
Thanks Jacob for the review.
|
|
https://github.com/psf/black/releases/tag/26.1.0
|
|
|
|
Regression in a16eedcf9c69d8a11d94cac1811018c5b996d491.
The UNNEST strategy is affected by the same problem bulk_update has wrt/
to silent data truncation due to its usage of db_type which always returns
a parametrized subtype.
|
|
PostgreSQL.
|
|
|
|
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
|
|
This is also applicable on CockroachDB.
|
|
column aliases on PostgreSQL.
Follow-up to CVE-2025-57833.
Thanks Stackered for the report, and Simon Charette and Mariusz Felisiak
for the reviews.
|
|
|
|
Thanks Lily for the review.
|
|
|
|
|
|
Thanks Simon Charette for pair programming.
Co-authored-by: Nick Stefan <NickStefan12@gmail.com>
Co-authored-by: Akash Kumar Sen <71623442+Akash-Kumar-Sen@users.noreply.github.com>
Co-authored-by: Simon Charette <charette.s@gmail.com>
|
|
Added ignores relating to https://github.com/PyCQA/isort/issues/2352.
|
|
|
|
Thanks Simon Charette for the implementation idea.
|
|
PostgreSQL 18+.
|
|
|
|
This required implementing UPDATE RETURNING machinery that heavily
borrows from the INSERT one.
|
|
|
|
BaseDatabaseOperations.return_insert_columns()/fetch_returned_insert_rows().
|
|
OneToOneField uses the type of the related field.
|
|
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
|
|
PostgreSQL.
Regression in 764af7a3d6c0b543dcf659a2c327f214da768fe4.
|
|
Postgresql 16+.
Thanks Simon Charette for the guidance and review. Thanks Tim Schilling for the
documentation review. Thanks David Wobrock for investigation and solution proposals.
|
|
flag in favor of using CompositePrimaryKey.
Now that Django properly supports creating models with composite primary
keys, the tests should use a `CompositePrimaryKey` field instead of a
feature flag to inline backend specific SQL for creating a composite PK.
Specifcially, the inspectdb's test_composite_primary_key was adjusted to
use schema editor instead of per-backend raw SQL.
|
|
PostGIS.
Swapped to an allow list instead of a deny list for field types to
determine if the UNNEST optimization can be enabled to avoid further
surprises with other types that would require further specialization to
adapt.
Regression in a16eedcf9c69d8a11d94cac1811018c5b996d491.
Thanks Joshua Goodwin for the report and Sarah Boyce for the test.
|
|
|
|
|
|
This moves the behaviors of `order_by` used in Postgres aggregates into
the `Aggregate` class. This allows for creating aggregate functions that
support this behavior across all database engines. This is shown by
moving the `StringAgg` class into the shared `aggregates` module and
adding support for all databases. The Postgres `StringAgg` class is now
a thin wrapper on the new shared `StringAgg` class.
Thank you Simon Charette for the review.
|
|
the "sql" argument.
This is a follow up of bd366ca2aeffa869b7dbc0b0aa01caea75e6dc31.
Thank you Daniel Finch for the report.
|
|
This bumps minimum supported versions of 3rd-party packages to the first
releases to support Python 3.12.
|
|
The array fields opt-out heuristic failed to account for sized arrays.
Note that we keep relying on db_type as opposed to performing an ArrayField
instance check against the column's field as there could be other
implementations of model fields that use Postgres arrays to store the
optimization must be disabled for all of them.
Refs #35936.
Thanks Claude Paroz for the report and test.
|
|
field.
PostgreSQL versions 16.5 and above no longer permit the use
of a USING clause when changing the type of a generated column.
|
|
This should make bulk_create significantly faster on Postgres when provided
only literal values.
Thanks James Sewell for writing about this technique, Tom Forbes for
validating the performance benefits, David Sanders and Mariusz Felisiak
for the review.
|
|
|
|
TextField and CharField field types.
|
|
on PostgreSQL 17+.
|
|
DatabaseWrapper methods.
Following the addition of PostgreSQL connection pool support in
Refs #33497, the methods for configuring the database role and timezone
were moved to module-level functions. This change prevented subclasses
of DatabaseWrapper from overriding these methods as needed, for example,
when creating wrappers for other PostgreSQL-based backends.
Thank you Christian Hardenberg for the report and to
Florian Apolloner and Natalia Bidart for the review.
Regression in fad334e1a9b54ea1acb8cce02a25934c5acfe99f.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
|
|
True on PostgreSQL."
This reverts commit 9cf9c796be8dd53bc3b11355ff39d65c81d7be6d due to a crash on Oracle
as it didn't allow multiple indexes on the same field.
|
|
PostgreSQL.
|
|
|
|
Unused since ae0899be0d787fbfc5f5ab2b18c5a8219d822d2b.
|
|
Co-authored-by: Nick Pope <nick@nickpope.me.uk>
|
|
binding with psycopg 3+.
|
|
Co-authored-by: Florian Apolloner <florian@apolloner.eu>
Co-authored-by: Ran Benita <ran@unusedvar.com>
|