You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an EXISTING redshift DB i'm using rails 5 against. Things are working great except when creating, in this case no id is set in the activerecord object.
I've tried save and create
Also, tried using some callbacks, setting id etc. I can't get max then set id because I'm using a identity column.
Here's a snippet from the table
id| integer| not null default "identity"(320804, 0, ('0,1'::character varying)::text)
"app_users_pkey" PRIMARY KEY, btree (id)
The text was updated successfully, but these errors were encountered:
AFAIK this occurs because on create the id is not returned since REDSHIFT does not support RETURNING ID on INSERT. I'm either going to branch or remove meta-data from our redshift cluster.
To fix you would need to do a select on a unique index after the insert occurs.
I have an EXISTING redshift DB i'm using rails 5 against. Things are working great except when creating, in this case no id is set in the activerecord object.
I've tried save and create
Also, tried using some callbacks, setting id etc. I can't get max then set id because I'm using a identity column.
Here's a snippet from the table
id| integer| not null default "identity"(320804, 0, ('0,1'::character varying)::text)
"app_users_pkey" PRIMARY KEY, btree (id)
The text was updated successfully, but these errors were encountered: