Bug report #12391

Postgres character(n) default values not properly handled in attribute form

Added by Tom Arnold almost 5 years ago. Updated almost 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Data Provider/PostGIS
Affected QGIS version:2.8.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:20565

Description

On the OsGeo4W build of QGIS 2.8.1 against PostgreSQL client 8.3.10, table columns defined with fixed-length string data types `char(n)` and `character(n)` that have default values are not properly displayed in the feature creation attribute form. It appears that Postgres internally casts to `bpchar', and that this is being passed literally to the text box. For example, a Postgres column of type `char(6)` with a default value of 'qwerty' will display on the attribute form as 'qwerty'::bpchar


Related issues

Related to QGIS Application - Bug report #12386: NOT NULL problem on PostGIS tables Closed 2015-03-17
Duplicated by QGIS Application - Bug report #13857: Default values on a PG table: type cast appended Closed 2015-11-19

Associated revisions

Revision bfb8ab68
Added by Jürgen Fischer almost 5 years ago

edit widgets: keep default values of new feature's attributes until they are added
(fixes #12391 & #12386)

Revision 4c3cf64f
Added by Jürgen Fischer about 4 years ago

edit widgets: keep default values of new feature's attributes until they are added
(fixes #12391 & #12386 & #13857)

(cherry picked from commit bfb8ab6893d5bf77b4ae92c6c90e0b5b9c7e9ae7)

History

#1 Updated by Giovanni Manghi almost 5 years ago

  • Category set to Data Provider/PostGIS

#2 Updated by Jürgen Fischer almost 5 years ago

  • Status changed from Open to Closed

#3 Updated by Sergio Gollino almost 5 years ago

In the last nightly (2.8.1-42) with PostgreSQL 9.4 the problem persist.

#4 Updated by Jürgen Fischer almost 5 years ago

Sergio Gollino wrote:

In the last nightly (2.8.1-42) with PostgreSQL 9.4 the problem persist.

the fix was applied to master only.

Also available in: Atom PDF