30 juillet 2009

schema_search_path in Postgres adapter

I've found that problem when using the Postgres adapter (and Rails 2.1.1) with multiple schemas (because I am not using the default Postgres user to connect to the database).

The error you get is:

PGError: ERROR: relation "schema_migrations" already exists


The root cause is that the Postgres adapter returns no table names, because the schemas it looks into are like this: 'schema1', ' public' (the extra space before public is the problem)

I've found one post that accurately describes the problem

The easy fix is to add a schema_search_path definition in config/database.yml like so:

schema_search_path: public

19 juillet 2009

IE6 in quirks mode

Is Internet Explorer running in quirks mode or standards mode?

It turns out there is a very simple way to tell. Just add in your address bar:

javascript:alert(document.compatMode)

If the browser responds with: "CSS1Compat, it is in standards mode. If it responds with "BackCompat", it runs in quirks mode. See this link for more details.

In the latter case, you probably want to change your DOCTYPE, for instance to:

http://www.w3.org/TR/html4/loose.dtd">

See this link for a useful list of DOCTYPEs