PGError: syntax error in rake db:test:clone

Hi all,
I’m a complete Ruby newbie trying to get a “hello world” Rails app up
and running. I’m working through the tutorial, and I’m up to “rake
db:test:clone” on
http://wiki.rubyonrails.org/rails/pages/TutorialStepFive.

When I try to run that command, I get the following:

$ rake db:test:clone
(in /lrw/test3)
rake aborted!
PGError: ERROR: syntax error at or near “EXISTS” at character 18
: DROP DATABASE IF EXISTS lrw_rubytest_test

The environment is:
Debian 4.0 (aka Etch, stable)
Ruby 1.8.2-1 (debian packaged version)
libpgsql-ruby1.8 0.7.1-10 (debian packaged version)
gem v1.2.0
rails (2.1.0)
PostgreSQL 8.3.3 (locally compiled, freshly updated)
and a few other Ruby-related debian packages

I tried running “DROP DATABASE IF EXISTS lrw_rubytest_test” directly
in phpPgAdmin, and still got the syntax error.

Have I got the wrong version of something, perhaps?

Hi,

the IF EXISTS syntax was introduced in postgres 8.2. So I assume that
you are still connecting to a postgres server prior to 8.2. Try scrip/
dbconsole and check the version in the welcome message (first line).

Cheers,

Tobi

Oh, well spotted - thanks for that. It says “Welcome to psql 8.3.3
(server 8.1.4), the PostgreSQL interactive terminal.”

I’m connecting to a server that hasn’t yet been upgraded to 8.3.3, but
it should be happening very soon.

Is there a setting I can put into a config file somewhere to use the
older syntax until the upgrade happens?