-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Default values on a PG table: type cast appended #21880
Comments
Author Name: Paolo Cavallini (@pcav) e.g. if I insert a path to a photo, and set the field widget to photo, the image itself fails to be displayed because of the additional text added. |
Author Name: Paolo Cavallini (@pcav) If the table does not have a PK, and only one field, apparently the cast is not added. |
Author Name: Jürgen Fischer (@jef-n) Paolo Cavallini wrote:
Can't reproduce that with:
|
Author Name: Paolo Cavallini (@pcav) OK, so last think must have been a local mistake. Sorry about the noise. |
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Paolo Cavallini (@pcav) Giovanni, please don't close valid issues. Thanks.
|
Author Name: Giovanni Manghi (@gioman) Paolo Cavallini wrote:
didn't you stated it was a 'local mistake'?
|
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Paolo Cavallini (@pcav) This refers to the PK issue, not to the main one, which is still valid.
|
Author Name: Giovanni Manghi (@gioman) I cannot confirm the specific issue described here, a default defined as 'test123'::character varying returns as expected test123 after adding new records and saving. On the other hand a default defined as ('now'::text)::date (in a date column of course), works if adding a record in pgadmin (and other backends) but in QGIS does not work and it returns always NULL. QGIS 2.8.4, pgsql 9.3 and postgis 2.1
|
Author Name: Jürgen Fischer (@jef-n) Giovanni Manghi wrote:
works fine for me in master too (PostgreSQL 9.4) |
Author Name: Giovanni Manghi (@gioman) Jürgen Fischer wrote:
confirmed also in another platform that on master ('now'::text)::date works ok but not on 2.8.5, while 'test123'::character varying works as expected on both. |
Author Name: Jürgen Fischer (@jef-n) Fixed in changeset "4c3cf64f01af32511ef5fc56b0b13aa705c00dd6".
|
Author Name: Paolo Cavallini (@pcav)
Original Redmine Issue: 13857
Affected QGIS version: 2.8.3
Redmine category:data_provider/postgis
Assignee: Jürgen Fischer
If the table has a default value, this is used in QGIS, but quotes and a type cast is added to it, e.g.:
'test123'::character varying
instead of:
test123
Related issue(s): #20565 (duplicates), #21782 (relates)
Redmine related issue(s): 12391, 13755
The text was updated successfully, but these errors were encountered: