First a bit of context, I have a fabricator for an ActiveRecord model that is backed by a materialized view which has both an id column and pk column (my custom primary key column).
I run into the issue where setting the pk or id results in both fields being set to the same string value, so my id column ends up with a string value when it should be an integer.
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
---------------------+-----------------------------+-----------+----------+---------+----------+--------------+-------------
pk | text | | | | extended | |
id | integer | | | | plain | |
Ultimately I want to be able to test I get the right data back when I perform a sql join on id column of the materialized view.