On Friday, February 15, 2013 11:28:39 AM UTC-8, François Beausoleil wrote:
>
> Hi!
>
> I'm using Sequel to read the pgbouncer admin / stats database. pgbouncer
> acts like a PostgreSQL server, albeit it does not itself have relations. It
> does return information when one runs "SHOW clients" or "SHOW pools" for
> example. From psql, I can get the actual data I want, but Sequel's
> introspection capabilities get in the way:
>
> 2013-02-15 14:15:34.810639500
> /usr/lib/ruby/vendor_ruby/sequel/adapters/postgres.rb:196:in `async_exec':
> PGError: ERROR: invalid command 'SELECT oid, typname FROM pg_type where
> typtype = 'b'', use SHOW HELP; (Sequel::DatabaseConnectionError)
> 2013-02-15 14:15:34.810876500 from
> /usr/lib/ruby/vendor_ruby/sequel/adapters/postgres.rb:196:in `block (2
> levels) in execute'
> 2013-02-15 14:15:34.811113500 from
> /usr/lib/ruby/vendor_ruby/sequel/database/logging.rb:28:in `log_yield'
> 2013-02-15 14:15:34.815156500 from
> /usr/lib/ruby/vendor_ruby/sequel/adapters/postgres.rb:196:in `block in
> execute'
> 2013-02-15 14:15:34.815424500 from
> /usr/lib/ruby/vendor_ruby/sequel/adapters/postgres.rb:176:in
> `check_disconnect_errors'
>
> Is there a way to skip the introspection? Looking at
> http://sequel.rubyforge.org/plugins.html, I see nothing which sounds like
> what I need to do.
>
I'm not sure why this isn't considered a bug in pgbouncer. If pgbouncer
doesn't respond as a PostgreSQL server would, then the error is in
pgbouncer, not in Sequel.
The error message you are showing is related to getting type oids for named
types. Assuming the SQL you showed is the complete query, I think you must
be using an old version of Sequel, as the current version of Sequel only
issues such a query if you are using the pg_hstore extension or have
defined named types manually, and even then it restricts the query.
Example:
SELECT "oid", "typname" FROM "pg_type" WHERE (("typtype" = 'b') AND
("typname" IN ('hstore')))
So upgrade your version of Sequel and try again. If you still have
problems, you'll have to override the related method to not issue the query.
Thanks,
Jeremy
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.