but not a complimentary defaultValueClause
This causes issues with any table using a identity column, as a user
is forced to populate these columns themselves in order to create
features, yet the value will be discarded when the feature is saved
to the database.
Instead correctly set the constraints, read only and a default value
clause for these column types.
This provider has been marked deprecated and hidden from the UI
for a number of QGIS releases. No maintainers have stepped up
to take over maintainance of this provider, and accordingly it
is now subject for removal.
... and give more hints about proper setup
Also fix support for passing a database name as commandline argument
(kind of risky, for the dropdb call upfront)
* add missing support for non-integer and compound keys
* update unit tests
* unify time handling: iterator / minimumValue / maximumValue / uniqueValues
first sensible CRS advertised by the provider's capabilities as the
layer's CRS
Avoids the messy situation where a WMS layer requires a valid CRS
to be set, yet QGIS provides no public API to retrieve the available
CRS for WMS layers. WIthout this fix it's necessary for plugins
to manually write their own capabilities parsing code in order to
retrieve the available CRSes for a service... ouch!
This quotes floating point values on the PostgreSQL data provider, which
allows such values to be used either as stand-alone primary keys or as
components of composite primary keys on underlying tables. The
PostgreSQL session parameter extra_float_digits is explicitly set to 3
(the default on PostgreSQL 11 and older; in PostgreSQL 12 this defaults
to 1), to keep compatibility with all database versions and to avoid
round-trip errors.
In this PR, NUMERIC/DECIMAL values are no longer cast to
QVariant::Double in order to avoid loss of precision.
PostgreSQL 11 and 12 handle floating point values differently; the test
originally passed on PostgreSQL 12, but not on 11 (Travis). Now, with
floating point data truncated to only 6 digits, they run on both
versions of the DBMS.
See https://www.postgresql.org/docs/12/release-12.html
Bigint PostgreSQL fields are handled correctly if they are part of a
composite primary key. As a bonus, we always pass double values as
quoted to the DBMS (but not cast to text). With this one can work with
tables with real/double primary keys without the penalty of casting
these values to text. Fixes#37126.
Changed the way GENERATED fields are inserted/updated. Previously we
used the DEFAULT keyword for INSERTing; now, we expose the generating
expression to the user, but ommit the field when inserting or updating a
feature.
These tests exercise the use of GENERATED columns, a feature which was
introduced by PostgreSQL 12+. They won't be run if the PostgreSQL server
against which we are testing is older than version 12.
Fixes#36583
Add a base test to make sure all major DB providers will
behave the same way and return FALSE when a constraint violation
refuses an attribute change (in a batch with a valid one).
OGR with GPKG was the "bad guy" here.