Enable Composites.

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
yapt
Posts: 69
Joined: Mon 16 Mar 2009 12:06

Enable Composites.

Post by yapt » Mon 20 Apr 2009 09:26

Hello,

I must doing something wrong but 'EnableComposites = true' on PgConnection is NOT creating separate fields for every type on composite.

I have the simplest example:

SELECT ROW(1.67, 'text', 2.45) AS tttotal

I can select tttotal field on a dbedit, but I cannot access to subfields in the row (I don't know how to do it).

Can sombody point me in the right direction ?

Greetings.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 21 Apr 2009 07:03

EnableComposites works only for named composite types. If you have a field of composite type in your table, and select this field, subfields will be created.

yapt
Posts: 69
Joined: Mon 16 Mar 2009 12:06

Post by yapt » Tue 21 Apr 2009 09:18

Ok, then composites automatic sub-fields creation doesn't work on "on the fly" composite create (on SELECT's for example).

Do you have any roadmap to support this ?

Thanks.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 21 Apr 2009 11:19

We cannot get information about subfields of such composite. So we will not support subfield creation for it.

yapt
Posts: 69
Joined: Mon 16 Mar 2009 12:06

Post by yapt » Tue 21 Apr 2009 11:40

Perhaps simply doing an index for every sub-field ?

Greetings.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 21 Apr 2009 11:57

Field count and datatypes are not fixed, and can differ between records. For example:

Code: Select all

select row(1,2,3,4,5)
union all
select row(1,'abc',3)
The first record has 5 subfields, the second record has 3 subfields.

yapt
Posts: 69
Joined: Mon 16 Mar 2009 12:06

Post by yapt » Tue 21 Apr 2009 12:10

Ok. Understand it..

Thanks Plash. Your help is very appreciated.

Post Reply