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

Can't INSERT while repacking #175

Open
kepempem opened this Issue Mar 27, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@kepempem
Copy link

kepempem commented Mar 27, 2018

PGSQL VERSION: 9.6.6
UBUNTU VERSION: 16.04.3 LTS

I tried repacking a table:
sudo pg_repack -h db.db.com -U my_role -k mydb -t myschema.mytable

And everything is working:
[INFO] repacking myschema.mytable

But while the table is repacking I can't INSERT into the table.
Any solutions?

@dvarrazzo

This comment has been minimized.

Copy link
Member

dvarrazzo commented Mar 27, 2018

Yes you can. Can you provide a failing test?

@kepempem

This comment has been minimized.

Copy link
Author

kepempem commented Mar 27, 2018

@dvarrazzo
`ERROR: permission denied for relation log_17441
CONTEXT: SQL statement "INSERT INTO repack.log_17441(pk, row) VALUES( CASE WHEN $1 IS NULL THEN NULL ELSE (ROW($1.eventtime, $1.orderid, $1.eventtype, $1.typename, $1.sku)::repack.pk_17441) END, $2)"
**** Error ****

ERROR: permission denied for relation log_17441
SQL state: 42501
Context: SQL statement "INSERT INTO repack.log_17441(pk, row) VALUES( CASE WHEN $1 IS NULL THEN NULL ELSE (ROW($1.eventtime, $1.orderid, $1.eventtype, $1.typename, $1.sku)::repack.pk_17441) END, $2)"`

@andy-plutoflume

This comment has been minimized.

Copy link

andy-plutoflume commented Feb 24, 2019

I am also seeing this issue - an application attempting to insert in to a table that is doing a repack is getting this error.

This does not happen consistently - some instances appear to be able to insert, but others do not.

This is on pg_repack 1.4.3.

2019-02-24 10:34:59 UTC:10.0.0.29(37352):admin@masterdb:[123]:ERROR: permission denied for relation log_551734232
2019-02-24 10:34:59 UTC:10.0.0.29(37352):admin@masterdb:[123]:CONTEXT: SQL statement "INSERT INTO repack.log_551734232(pk, row) VALUES( 

Even after a GRANT I see this error:

masterdb=> grant all on log_551734232 to admin;                                                                                                                                                                                                                 
GRANT
@andy-plutoflume

This comment has been minimized.

Copy link

andy-plutoflume commented Feb 24, 2019

@MichaelDBA

This comment has been minimized.

Copy link

MichaelDBA commented Feb 24, 2019

Yes I would like to see this fixed too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.