Skip to content

Unable to recognize type of Postgres xact advisory locks #29837

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

Closed
sreekanthgs opened this issue Jul 18, 2017 · 2 comments
Closed

Unable to recognize type of Postgres xact advisory locks #29837

sreekanthgs opened this issue Jul 18, 2017 · 2 comments
Assignees

Comments

@sreekanthgs
Copy link

Steps to reproduce

[2] pry(main)> ActiveRecord::Base.connection.select_values("Select pg_advisory_xact_lock(1);")
   (1.5ms)  Select pg_advisory_xact_lock(1);
unknown OID 2278: failed to recognize type of 'pg_advisory_xact_lock'. It will be treated as String.
=> [""]

Expected behavior

Warning should not be thrown. It was working fine in previous versions of active record.

Actual behavior

Warning is issued. Uncertain if the lock is applied, still inspecting.

System configuration

Rails version: 5.1.2
Ruby version: 2.4.1

@sgrif sgrif self-assigned this Jul 18, 2017
@sgrif
Copy link
Contributor

sgrif commented Jul 18, 2017

pg_advisory_xact_lock has no return value (the type with that OID is void). Use execute instead.

@sgrif sgrif closed this as completed Jul 18, 2017
@matthewd
Copy link
Member

matthewd commented Aug 2, 2017

@sgrif seems like we should probably have a built-in conversion for void to a nil, though?

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

No branches or pull requests

3 participants