New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attribute Form Value Relation Doesn't Respect Column Default #41951
Comments
@ScottWerkema confirmed. Also is not clear to me why on 3.18 after filling the "name" attribute the "save edits" button is not active and edits can be saved only by toggling editing off. To note that on 3.16 the evaluation of the default value works as expected but in this example QGIS does not allow to edit/write in the "name" attribute, so saving edits is not possible (because of the "not null" constraint). So BOTH 3.16 AND 3.18 are bugged. |
3.18.3-Zürich also works for me. |
Works for me too now on 3.18.3 |
The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". |
While we hate to see this happen, this issue has been automatically closed because it has not had any activity in the last 42 days despite being marked as feedback. If this issue should be reconsidered, please follow the guidelines in the previous comment and reopen this issue. |
This doesn't seem to be fully resolved in QGIS 3.22. I have a Postgres table with boolean columns and default values (true or false). When the default is set the, the check boxes don't appear when editing the values in QGIS. The only way to edit/update the values is through the Field Calculator or the Update Filtered/Selected buttons. If I drop the default value, the check boxes appear and are editable through the usual methods in QGIS. Here's a sample column def:
ALTER statements for test purposes:
|
@Brent-Edwards works fine here on 3.22.1
|
@gioman - Thanks for the reply. I just tried with 3.22.1 and QGIS is still behaving as stated in my previous message. Without the default - checkbox appears on the edit form: With the default (Postgres... COLUMN bool_def_t SET DEFAULT true) - no checkbox on the edit form: Here's my complete QGIS setup info: QGIS version Active Python plugins |
I can confirm this issue with current QGis-LTR. A boolean column with DEFAULT value set isn't recognized as boolean (meaning: no checkbox is offered).
|
Describe the bug
In 3.18, when digitizing, the attribute form doesn't respect the column default when the attribute is a value relation. In our case, this is when the layer is a Postgres/PostGIS layer. The attribute form defaults to the lower int value in the relation table rather than the column default in Postgres.
How to Reproduce
In Postgres
In QGIS 3.18
public.feature_layer
andpublic.status
tables as layers in your projectpublic.feature_layer
configure a value relation to thepublic.status
table.3. Digitize a new feature on `public.feature_layer`. Note when the attribute form presents, the default value will be `Unknown` which is `-32767` rather than the default `Open`/`1`.
QGIS and OS versions
3.18.0 macOS 11.2.2
Additional context
In previous versions of QGIS, the Postgres column default is respected.
The text was updated successfully, but these errors were encountered: