Ruby activerecord with Postgresql adapter cannot select OID

I'm new to Ruby and ActiveRecord, so if this is a stupid question ... sorry.

I have a Postgres database table that has path names. I need to do a search on a specific path and get the OID (the table is defined with: set_default_oids = true). The problem is that I can add select ("oid, path"), but I never get the OID. I am getting the path, but I need the OID.

I am guessing there is an adapter option or an option for the table class to say: use the OID, but I couldn't find it.

When I look at the search result, I can look at the object_id, but it looks like it's internal to ActiveRecord and has nothing to do with OID. When using psql, I can do:

db=# SELECT oid,path FROM path_table;

      

And I can see the correct OIDs. So I know they are there ...

Any suggestions?

Rob

+3


source to share


1 answer


I'll use the PG interface because using ActiveRecord doesn't seem to allow me to see the OID.



+1


source







All Articles