Re: [fpc-pascal] PostgreSQL: ERROR: operator does not exists: uuid = text

2013-09-05 Thread Michael Van Canneyt
On Wed, 4 Sep 2013, silvioprog wrote: Hello, I can't understand how to open a query filtering by a field of type GUID. The error message is below (translated from BR to US): TPQConnection: Preparation of query failed. (PostgreSQL: ERROR: operator does not exist: uuid = text LINE 3: where

Re: [fpc-pascal] PostgreSQL: ERROR: operator does not exists: uuid = text

2013-09-05 Thread LacaK
Michael Van Canneyt wrote / napísal(a): On Wed, 4 Sep 2013, silvioprog wrote: Hello, I can't understand how to open a query filtering by a field of type GUID. The error message is below (translated from BR to US): TPQConnection: Preparation of query failed. (PostgreSQL: ERROR: operator

Re: [fpc-pascal] PostgreSQL: ERROR: operator does not exists: uuid = text

2013-09-05 Thread silvioprog
Thank guys, fixed with: q.SQL.Add('where t1.id::text = :id'); I'll do this change in all units of my project. :/ -- Silvio Clécio My public projects - github.com/silvioprog ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] PostgreSQL: ERROR: operator does not exists: uuid = text

2013-09-05 Thread Michael Van Canneyt
On Thu, 5 Sep 2013, silvioprog wrote: Thank guys, fixed with: q.SQL.Add('where t1.id::text = :id'); I recommend against this. It will do the conversion for each record that is tested. This takes time. If you do the conversion on the parameter, it will be done only once, when the

Re: [fpc-pascal] PostgreSQL: ERROR: operator does not exists: uuid = text

2013-09-05 Thread silvioprog
2013/9/5 Michael Van Canneyt mich...@freepascal.org On Thu, 5 Sep 2013, silvioprog wrote: Thank guys, fixed with: q.SQL.Add('where t1.id::text = :id'); I recommend against this. It will do the conversion for each record that is tested. This takes time. If you do the conversion on the

Re: [fpc-pascal] PostgreSQL: ERROR: operator does not exists: uuid = text

2013-09-04 Thread Alberto Narduzzi
I am not an expert of PostGres but maybe you are missing the doubled quotes? q.Params.ParamByName('id').AsString := ''71d6776e-1564-11e3-ad65-5349928f15b0''; Cheers, A. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org