I have two Postgres tables, TABLE_A
and TABLE_B
.
TABLE_A
contains column table_b_fks
, whose values are an array of integers (e.g. "{1,2,4}"
), which are of the set of primary keys for TABLE_B
.
TABLE_B
has two columns, the primary keys and text
.
My goal is to create a Materialized View which is identical to TABLE_A
except that the table_b_fks
array of integers is replaced with an array of text
's from TABLE_B
.
Is this possible? It seems that postgres does not support arrays of foreign keys. Are there alternatives?