Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Issue debug statement about "unknown OID" for PostgreSQL custom types. #14275

Closed
wants to merge 1 commit into from

2 participants

@joevandyk

Changed from a warning.

I dunno if this can be put in 4.1 or earlier releases, but it would be really nice. I can't imagine it causing any problems.

@senny senny commented on the diff
...connection_adapters/postgresql/database_statements.rb
@@ -143,7 +143,7 @@ def exec_query(sql, name = 'SQL', binds = [])
ftype = result.ftype i
fmod = result.fmod i
types[fname] = type_map.fetch(ftype, fmod) { |oid, mod|
- warn "unknown OID: #{fname}(#{oid}) (#{sql})"
+ ActiveRecord::Base.logger.debug "unknown OID: #{fname}(#{oid}) (#{sql})"
@senny Owner
senny added a note

can we use warn instead of debug? This shouldn't write to stderr as warn did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@joevandyk

I'm curious why we need to log anything at all for this. What's the point?

@senny
Owner

@joevandyk basically it's saying that the column is not properly supported and may not work as expected.

@joevandyk
@senny
Owner

@joevandyk we did not rely on the OID at that time. Also many PG specific stuff (like hstore) was introduced with Rails 4 and not present in 3.2. The main issue though is that there are still cases where we don't have to emit the warnings but the current initialization of the type map is not dynamic enough. I have several related issues and pull requests grouped up and assigned for 4.2. Like #13244 for example.

I think we should keep the warning and make the type map initialization better. Then we can see what other cases we need to tackle to remove it completely.

@senny
Owner

@joevandyk see #14692 fora different solution to the log pollution. Let me know if that fix is not enough.

@senny senny referenced this pull request from a commit in senny/rails
@senny senny PostgreSQL, warn once per connection per missing OID. Closes #14275.
[Yves Senn & Matthew Draper]
9f62344
@senny senny closed this in #14692
@senny senny referenced this pull request from a commit
@senny senny PostgreSQL, warn once per connection per missing OID. Closes #14275.
[Yves Senn & Matthew Draper]

(cherry picked from commit 9f62344)

This is a partial backport of #14692.

Conflicts:
    activerecord/CHANGELOG.md
    activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
    activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
461171b
@senny senny referenced this pull request from a commit
@senny senny PostgreSQL, warn once per connection per missing OID. Closes #14275.
[Yves Senn & Matthew Draper]

(cherry picked from commit 9f62344)

This is a partial backport of #14692.

Conflicts:
    activerecord/CHANGELOG.md
    activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
    activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb
	activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
	activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
47f7171
@ttosch ttosch referenced this pull request from a commit
@senny senny PostgreSQL, warn once per connection per missing OID. Closes #14275.
[Yves Senn & Matthew Draper]

(cherry picked from commit 9f62344)

This is a partial backport of #14692.

Conflicts:
    activerecord/CHANGELOG.md
    activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
    activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
2c86642
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 4, 2014
  1. @joevandyk
This page is out of date. Refresh to see the latest.
View
2  activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb
@@ -143,7 +143,7 @@ def exec_query(sql, name = 'SQL', binds = [])
ftype = result.ftype i
fmod = result.fmod i
types[fname] = type_map.fetch(ftype, fmod) { |oid, mod|
- warn "unknown OID: #{fname}(#{oid}) (#{sql})"
+ ActiveRecord::Base.logger.debug "unknown OID: #{fname}(#{oid}) (#{sql})"
@senny Owner
senny added a note

can we use warn instead of debug? This shouldn't write to stderr as warn did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
OID::Identity.new
}
end
Something went wrong with that request. Please try again.