Re: Couldn't cast to record[]

2022-03-05 Thread Tom Lane
Suresh Kumar R writes: >I needed this because, I use postgres backend along with golang using > pgx driver. When i query address i need to specify OID of > address[](composite type). In my case i couldnt find the oid of that type > since its dynamic. The usual advice is to look it up on the f

Re: Couldn't cast to record[]

2022-03-04 Thread Suresh Kumar R
Hi Merlin, I needed this because, I use postgres backend along with golang using pgx driver. When i query address i need to specify OID of address[](composite type). In my case i couldnt find the oid of that type since its dynamic. Needed generic type so needed to cast to record[] which has cons

Re: Couldn't cast to record[]

2022-03-04 Thread Merlin Moncure
On Thu, Mar 3, 2022 at 4:01 AM Suresh Kumar R wrote: > > Hi, I created an table with composite type array as datatype for one column. > When I query that table I need the pg_typeof(column) as record[] instead of > composite_type[]. > I tried creating a separate function and returning record[], but

Re: Couldn't cast to record[]

2022-03-03 Thread Tom Lane
Suresh Kumar R writes: > When I query that table I need the pg_typeof(column) as record[] instead of > composite_type[]. Why? record[] is considered a pseudotype (polymorphic type), which is why casting to it doesn't do anything. regards, tom lane

Re: Couldn't cast to record[]

2022-03-03 Thread Pavel Stehule
Hi čt 3. 3. 2022 v 11:01 odesílatel Suresh Kumar R napsal: > Hi, I created an table with composite type array as datatype for one > column. > When I query that table I need the pg_typeof(column) as record[] instead of > composite_type[]. > I tried creating a separate function and returning recor