# Quote\_ident

**URL:** <https://www.ruby-forum.com/t/quote-ident/172766>\
**Category:** Rails\
**Created:** [July 27, 2009, 7:28pm UTC](https://www.ruby-forum.com/t/quote-ident/172766 "2009-07-27T19:28:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rrg1970](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ed655f/32.png) [@rrg1970](https://www.ruby-forum.com/u/rrg1970)\
**Post date:** [July 27, 2009, 7:28pm UTC](https://www.ruby-forum.com/t/quote-ident/172766/1 "2009-07-27T19:28:10Z")

</div>

We have updated the rails version from 2.1.1 to 2.3.3 and we get the  
folowing error message:

undefined method `quote\_ident’ for PGconn:Class

Any idea about it?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![rrg1970](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ed655f/32.png) [@rrg1970](https://www.ruby-forum.com/u/rrg1970)\
**Post date:** [July 31, 2009, 7:24pm UTC](https://www.ruby-forum.com/t/quote-ident/172766/2 "2009-07-31T19:24:29Z")

</div>

I have the very same problem when migrating from rails 2.3.2 to 2.3.3.  
Nothing else has been modified.

Please help…

Shall we wait for a new version of postgres-pr (actual 0.6.1) ?

Thanks

---

<div class="post-metadata">

**Author:** ![rrg1970](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ed655f/32.png) [@rrg1970](https://www.ruby-forum.com/u/rrg1970)\
**Post date:** [August 1, 2009, 11:56am UTC](https://www.ruby-forum.com/t/quote-ident/172766/3 "2009-08-01T11:56:03Z")

</div>

OK. Now there is a temporary solution, I suppose before postgres-pr  
gets updated… It’s very well explained here :

> **[Issues · mneumann/postgres-pr](https://github.com/mneumann/postgres-pr/issues/unreads#issue/1)**
>
> A pure-Ruby (pr) library for accessing PostgreSQL databases - Issues · mneumann/postgres-pr

You need to add to : config/initializers/new\_rails\_defaults.rb, the  
following :

def PGconn.quote\_ident(name)  
%(“#{name}”)  
end

---

<div class="post-metadata">

**Author:** ![rrg1970](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ed655f/32.png) [@rrg1970](https://www.ruby-forum.com/u/rrg1970)\
**Post date:** [August 2, 2009, 1:00am UTC](https://www.ruby-forum.com/t/quote-ident/172766/4 "2009-08-02T01:00:50Z")

</div>

ha… my problem was I was running a rake take  
so the initializers weren’t being run

this seems to have worked for me:  
rake db:create:all -P development

---

<div class="post-metadata">

**Author:** ![rrg1970](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ed655f/32.png) [@rrg1970](https://www.ruby-forum.com/u/rrg1970)\
**Post date:** [August 2, 2009, 12:39am UTC](https://www.ruby-forum.com/t/quote-ident/172766/5 "2009-08-02T00:39:11Z")

</div>

That fix is being ignored in my case. Win XP

I get exactly the same error.

When I run the console it is modifying the class however.

---

<div class="post-metadata">

**Author:** ![rrg1970](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ed655f/32.png) [@rrg1970](https://www.ruby-forum.com/u/rrg1970)\
**Post date:** [September 14, 2009, 10:02am UTC](https://www.ruby-forum.com/t/quote-ident/172766/6 "2009-09-14T10:02:18Z")

</div>

On Aug 2, 8:59 am, Doug [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ha… my problem was I was running a rake take  
> so the initializers weren’t being run

Yes I hit that problem as well. It can be addressed by placing the  
patch directly into active\_record rather than into  
new\_rails\_defaults.rb as suggested earlier. i.e. whack the patch in:

active\_record/connection\_adapters/postgresql\_adapter.rb

cheers,  
mick
