# Activerecord: column named 'type' silently ignore (pgsql)

**URL:** <https://www.ruby-forum.com/t/activerecord-column-named-type-silently-ignore-pgsql/102385>\
**Category:** Rails\
**Created:** [February 8, 2006, 2:16pm UTC](https://www.ruby-forum.com/t/activerecord-column-named-type-silently-ignore-pgsql/102385 "2006-02-08T14:16:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sduclos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@sduclos](https://www.ruby-forum.com/u/sduclos)\
**Post date:** [February 8, 2006, 2:16pm UTC](https://www.ruby-forum.com/t/activerecord-column-named-type-silently-ignore-pgsql/102385/1 "2006-02-08T14:16:58Z")

</div>

Hi,

I’ve been scraching my head on that.

If a column is named ‘type’ then nothing appear in  
this column in postgresql!

Just changing the name to ‘typ’ instead of ‘type’  
fix the problem.

I’m using the latest: activerecord (1.13.2)

I think I’m at the rignt place to post this!  
Sorry if I’m on the wrong list or if this is  
a well known ‘feature’ 🙂

Sylvain.

---

<div class="post-metadata">

**Author:** ![sduclos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@sduclos](https://www.ruby-forum.com/u/sduclos)\
**Post date:** [February 8, 2006, 2:20pm UTC](https://www.ruby-forum.com/t/activerecord-column-named-type-silently-ignore-pgsql/102385/2 "2006-02-08T14:20:37Z")

</div>

‘type’ is the column name used in single table inheritance, so you  
can’t use it as a basic column name. Tripped me up a bit the first  
time around as well.

Pat

---

<div class="post-metadata">

**Author:** ![sduclos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@sduclos](https://www.ruby-forum.com/u/sduclos)\
**Post date:** [February 8, 2006, 3:12pm UTC](https://www.ruby-forum.com/t/activerecord-column-named-type-silently-ignore-pgsql/102385/3 "2006-02-08T15:12:02Z")

</div>

Hi,

There is some predefined tables and classes used in  
Ruby-Rails, I have once a table “search” and rails  
have already defined that table. so it has never my  
“table” which has been used. I think it may be the  
same case…

Saiho

— sd sd [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Sylvain.
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

If God really exists, I would like to  
know what the dinosaurs have done to  
deserve their extinction.

Water is unknown to fishes,  
until they discover air.

> **[Yahoo | Mail, Weather, Search, Politics, News, Finance, Sports & Videos](https://www.yahoo.com)**
>
> Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!

* * *

Do You Yahoo!?  
Tired of spam? Yahoo! Mail has the best spam protection around

> **[\[object](https://mail.yahoo.com/)**
>
> \[object

---

<div class="post-metadata">

**Author:** ![sduclos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@sduclos](https://www.ruby-forum.com/u/sduclos)\
**Post date:** [February 8, 2006, 3:18pm UTC](https://www.ruby-forum.com/t/activerecord-column-named-type-silently-ignore-pgsql/102385/4 "2006-02-08T15:18:04Z")

</div>

I had the same problem as you. I had to change my column to ‘category’  
instead.  
When you do .type you get the class type. So I guess that this  
is why it doesn’t work. The name of your column is clashing with the  
Object variable type.
