# New to rails - apparently need patch to use PostgreSQL

**URL:** <https://www.ruby-forum.com/t/new-to-rails-apparently-need-patch-to-use-postgresql/187512>\
**Category:** Rails\
**Created:** [April 24, 2010, 12:13pm UTC](https://www.ruby-forum.com/t/new-to-rails-apparently-need-patch-to-use-postgresql/187512 "2010-04-24T12:13:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cootcraig](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3d9bf3/32.png) [@cootcraig](https://www.ruby-forum.com/u/cootcraig)\
**Post date:** [April 24, 2010, 12:13pm UTC](https://www.ruby-forum.com/t/new-to-rails-apparently-need-patch-to-use-postgresql/187512/1 "2010-04-24T12:13:16Z")

</div>

Help please. My first attempt at Rails, I’m trying to use PostgreSQL  
and I’m seeing this error. I’m also new to PostgreSQL, but the  
default encoding in PostgreSQL appears to be SQL\_ASCII. I’m not sure  
if I should try and get the patch or try and change the PostgreSQL  
template. Sorry I’m so confused. FWIW, I’ve been a .NET MSSQL  
developer and want to get up to speed on Rails with PostgreSQL.

Thanks.

[https://rails.lighthouseapp.com/projects/8994/tickets/4304-cannot-set-postgres-adapter-encoding-to-anything-besides-utf-8](https://rails.lighthouseapp.com/projects/8994/tickets/4304-cannot-set-postgres-adapter-encoding-to-anything-besides-utf-8)

---

<div class="post-metadata">

**Author:** ![cootcraig](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3d9bf3/32.png) [@cootcraig](https://www.ruby-forum.com/u/cootcraig)\
**Post date:** [April 24, 2010, 3:27pm UTC](https://www.ruby-forum.com/t/new-to-rails-apparently-need-patch-to-use-postgresql/187512/2 "2010-04-24T15:27:40Z")

</div>

cootcraig wrote:

> Help please. My first attempt at Rails, I’m trying to use PostgreSQL  
> and I’m seeing this error. I’m also new to PostgreSQL, but the  
> default encoding in PostgreSQL appears to be SQL\_ASCII.

You should always use UTF8 for your database. If you do that, you’ll be  
able to handle any text, and this bug should not affect you.

> I’m not sure  
> if I should try and get the patch

Perhaps.

> or try and change the PostgreSQL  
> template.

Change the template. There is no reason to have your DB set to ASCII N

> Sorry I’m so confused.

What are you confused by?

> FWIW, I’ve been a .NET MSSQL  
> developer and want to get up to speed on Rails with PostgreSQL.

Good choice!

> Thanks.
> 
> [#4304 Cannot set postgres adapter encoding to anything besides utf-8 - Ruby on Rails - rails](https://rails.lighthouseapp.com/projects/8994/tickets/4304-cannot-set-postgres-adapter-encoding-to-anything-besides-utf-8)

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![cootcraig](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3d9bf3/32.png) [@cootcraig](https://www.ruby-forum.com/u/cootcraig)\
**Post date:** [April 24, 2010, 5:13pm UTC](https://www.ruby-forum.com/t/new-to-rails-apparently-need-patch-to-use-postgresql/187512/3 "2010-04-24T17:13:31Z")

</div>

You’re using PostgreSQL on Ubuntu, right?

On Sat, Apr 24, 2010 at 9:27 AM, Marnen Laibow-Koser  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> “Ruby on Rails: Talk” group.  
> To post to this group, send email to removed\_email\_address@domain.invalid.  
> To unsubscribe from this group, send email to  
> removed\_email\_address@domain.invalid[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> .  
> For more options, visit this group at  
> [http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

–

* * *

Joshua S. Martin

CONFIDENTIALITY NOTE: This e-mail message, including any attachment(s),  
contains information that may be confidential, protected by the attorney  
client or other legal privileges, and or proprietary non public  
information.  
If you are not an intended recipient of this message or an authorized  
assistant to an intended recipient, please notify the sender by replying  
to  
this message and then delete it from your system. Use, dissemination,  
distribution, or reproduction of this message and or any of its  
attachments  
(if any) by unintended recipients is not authorized and may be unlawful.

---

<div class="post-metadata">

**Author:** ![cootcraig](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3d9bf3/32.png) [@cootcraig](https://www.ruby-forum.com/u/cootcraig)\
**Post date:** [April 25, 2010, 5:49pm UTC](https://www.ruby-forum.com/t/new-to-rails-apparently-need-patch-to-use-postgresql/187512/4 "2010-04-25T17:49:37Z")

</div>

After reinstalling PostgreSQL, using initdb to set the template  
encoding to UTF8  
rake db:create  
in fact creates a database.

Now, time to learn some rails.

---

<div class="post-metadata">

**Author:** ![cootcraig](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3d9bf3/32.png) [@cootcraig](https://www.ruby-forum.com/u/cootcraig)\
**Post date:** [April 24, 2010, 5:44pm UTC](https://www.ruby-forum.com/t/new-to-rails-apparently-need-patch-to-use-postgresql/187512/5 "2010-04-24T17:44:35Z")

</div>

Actually my development server is FreeBSD. My workstation is Vista 64  
and I’m using VirtualBox to run 2 VM’s: FreeBSD as the server with  
PostgreSQL,Apache,Rails. Ubuntu as a client.

I plan to reinstall PostgreSQL setting the template encoding to UTF8

I guess I’m not so much confused as slogging through learning a lot of  
setup before I dig into Ruby and Rails, my own choice.
