Page 1 of 1

Preparation of default expression failed with error "Invalid filter expression character ':"

Posted: Sun 03 Apr 2016 12:39
by radub
Hi,

After upgrading postgresql server from 9.3.12 to 9.5.2 version, trying to open a table ends with the above error.
Digging a little I've noticed that column definition for a smallint field (could be an integer field as well) changed from .."smallint default (-1)" to ..."smallint default '-1'::integer", hence the error.

I have the 4.4.11 PgDac version for Rad Studio XE5.

Any help would be wellcome.

Thank you,

Radu B.

Re: Preparation of default expression failed with error "Invalid filter expression character ':"

Posted: Mon 04 Apr 2016 08:43
by AlexP
hello,

We can't reproduce the described case. Please send a simple application and script for creating the table to alexp*devart*com .

Re: Preparation of default expression failed with error "Invalid filter expression character ':"

Posted: Wed 06 Apr 2016 07:04
by radub
Hello,

From the email sent I understand that PgDAC doesn't have yet the capability to get the description of the default of a field, but can I make the script for that kind of default of such a way not getting error? Or another workaround?
For the time being, with 9.5.2 version of the server, I cannot deploy the application.

Thank you

Re: Preparation of default expression failed with error "Invalid filter expression character ':"

Posted: Mon 11 Apr 2016 09:18
by AlexP
We get data about default values from the pg_attrdef service table. In the new server versions, values are returned as '-1'::integer. In PgDAC, the following query is executed to retrieve the default value:

Code: Select all

select '-1'::integer
that returns -1.
In ClientDataSet, the default value is taken from the DefaultExpression property of every field, then it is parsed, and this error occurs on attempt to parse such expression. We can't affect this behavior in any way.

To solve the issue, you can disable default value receiving by setting the DefaultValues property of TPgTable to False,
and specify default values for each field manually.