-
Notifications
You must be signed in to change notification settings - Fork 877
Description
Hello.
We use sharded databases. They are built on schemas. We have several physical servers that host N schemes (buckets).
Let's consider this scheme.
On server S1 there are buckets from 1 to 128. They are called bucket_1... bucket_128
On the S2 server there are buckets from 129 to 256. They are called bucket_129... bucket_256
Each bucket contains exactly the same structure of tables, types, etc.
We have a problem when working with composite types and enums with this sharding arrangement.
When we map a composite type to a CLR type, we have to do this for each bucket within the same server. One physical connection can be used for requests to different buckets.
The problem is that npgsql can't match the type correctly.
The following error is thrown
42804: column \"items\" is of type bucket_1.item_reserve[] but expression is of type bucket_90.item_reserve[]
We assume that the internal driver mechanism sets the crl type as a key in some dictionary. And the value for this key is at some point updated to the one that was loaded from the database and matched last.
Help us solve our problem - we really need to work with composite types in this particular sharding configuration.