Skip to content

Comment on Five Common Rails Mistakesparent

Comments

>On the other hand maximum string size has an effect on Postgres indexes: b-tree (the default) will blow up on strings beyond 4k chars, and this is not statically checked by postgres, it will blow up while trying to insert a string of more than 4k chars.

What do you mean by "blow up" here?

  create table foos (col varchar(100000));                                      
  create index on foos(col);                                                    
  insert into foos values (repeat('s', 100000));
That works fine.

> What do you mean by "blow up" here?

Errors out saying the index row size is too big for the index

> That works fine.

the b-tree implementation must have been fixed at some point then, because last time I tried it I got this: http://postgresql.1045698.n5.nabble.com/SQL-index-row-size-2...

(the thread is from 2005, but I got something along those lines last year)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.