cutl3r
December 14, 2023, 1:44am
1
I am trying to run a migration that in addition to changing a schema ALSO updates a column.
As an example:
def change
add_column :stuff, :a, :string
reversible do |direction|
direction.up do
execute <<-SQL
UPDATE stuff
SET a = meta->>'a';
SQL
end
end
end
It fails with the error message: PG::InsufficientPrivilege: ERROR: permission denied for table stuff
How should I go about debugging this?
cutl3r
December 14, 2023, 2:10am
2
Actually it appears that the table-owner is just wrong (this was previously attached to a different app).
Is there any way for me to change table ownership from a previous app owner that I have deleted?
cutl3r
December 14, 2023, 4:32pm
3
I resolved this by exporting all the records, rebuilding the DB and then reimporting them. That reset the table permissions.
roadmr
December 14, 2023, 4:49pm
4
Also, remember Fly Posgres is just… Postgres so you can fly postgres connect
and manage permissions by hand (Fly.io postgres is user-managed, I would certainly recommend getting comfortable with role and permission management if you intend to use it in anger!).
1 Like
system
Closed
December 21, 2023, 4:49pm
5
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.