Forum OpenACS Q&A: Problem loading 3.2.5 data model

Collapse
Posted by Walter Smith on
Hi.

I'm having trouble loading the 3.2.5 data model in Postgres 7.2. It seems to me like the problem is with the tab characters in the .sql files, although I've never had this problem before (with previous versions of Postgres, however).

Many of the tables do not get built, generating error messages. The code to create the calendar table, which starts out

create table calendar (
        calendar_id     integer primary key,
generates the following error:
ERROR:  parser: parse error at or near "primary"

To narrow it down, I tried creating individual parts of the data model at the Postgres command line. I get the same error messages if I just copy and paste the code, but the tables get created without error if I go in and remove the tab characters first.

Any ideas what's happening and how to fix it?

Thanks!

Collapse
Posted by Jonathan Ellis on
sounds like you already know the answer...

perl -pi.bak -e 's/\t/    /g' *.sql

Collapse
Posted by Walter Smith on
Thanks, Jonathan.  I'm assuming that will substitute spaces for tabs?

It just seems strange to me that I've never heard of anyone else having this problem before and that I would need to brute force the source files like that.

Is there something different about how 7.2 interprets white space characters?  Could it be a Postgres configuration issue?