Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composite keys with different types (UUID + TEXT) throws error when electrifying #1195

Closed
fooware opened this issue Apr 24, 2024 · 1 comment · Fixed by #1198
Closed

Composite keys with different types (UUID + TEXT) throws error when electrifying #1195

fooware opened this issue Apr 24, 2024 · 1 comment · Fixed by #1198
Assignees

Comments

@fooware
Copy link
Contributor

fooware commented Apr 24, 2024

From discord

@fooware

Since relationships with composite keys turned out to be unsupported according to the electrification error, I instead tried to manually do it for an important table by changing it's UUID primary key to TEXT, but keep all other PKs as UUID.

But then I got this very odd error when trying to add a relationship, which I guess is because the junction tables now have a (non-relational) composite primary key with one UUID and TEXT?

psql:sql/seed_data.sql:54: ERROR: ARRAY types uuid and text cannot be matched
LINE 1: serialized_pk := ARRAY[this_row.id, this_row.user_id]:...
^
QUERY: serialized_pk := ARRAY[this_row.id, this_row.user_id]::text
CONTEXT: PL/pgSQL function electric.send_self_trigger_publicproject_owner() line 9 at assignment

Is this considered a fundamental limitation, temporary limitation or a bug in Electric?

@alco

Looks like a bug to me. PK values should have been casted to text before being put into ARRAY[...]. This is Electric's internal SQL code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants