Search code examples
data-access-layerweb2pypostgresql-9.1

Web2py : created new database, but tables not being created : What am I missing?


I switched to Postgres recently and things were working fine.
I had to make some major changes, hence deleted the old database & created a brand new one.

I accessed a function that inserts new records in a table -> "newsMaster"
But in the logs I see this :

[error] Trying to insert title : xxxxxxxxxxxxx                                                
[error] oops: relation "newsmaster" does not exist                                            
[error] LINE 1: INSERT INTO NewsMaster(name,favorite...                                       
[error]                     ^                                                                 
[error]                                                                                       
[error] Trying to insert title : 'xxxxxxxxxxxxxxxx                                            
[error] oops: current transaction is aborted, commands ignored until end of transaction block 

I'm sure the access is there, since I can see the connection on the database.

I didn't have to do anything different when I switched to Postgres from sqllite, since DAL just created the tables from scratch..
Am I missing something ?


Solution

  • Delete (or move) all the files in your 'databases' directory. Refresh your page.

    If this doesn't work, you might want to look at your models more carefully and describe them here. Postgres is very particular about relationships and such, while SQLite doesn't care at all.