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

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
radub
Posts: 105
Joined: Sat 10 Jul 2010 18:46

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

Post by radub » Sun 03 Apr 2016 12:39

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.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

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

Post by AlexP » Mon 04 Apr 2016 08:43

hello,

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

radub
Posts: 105
Joined: Sat 10 Jul 2010 18:46

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

Post by radub » Wed 06 Apr 2016 07:04

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

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

Post by AlexP » Mon 11 Apr 2016 09:18

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.

Post Reply