Postgres Database Error: relation does not exist

后端 未结 2 1887
日久生厌
日久生厌 2021-01-14 04:57

I am fixing some problems with a legacy system and have run into a snag that I am surprised was not caught sooner. I am running Django 1.3 and using postgres 9.1.3 in runnin

相关标签:
2条回答
  • 2021-01-14 05:23

    The problem is you haven't synced your DB, I guess. Please execute these commands:

    1. python manage.py makemigrations myappname
    2. python manage.py migrate myappname
    0 讨论(0)
  • 2021-01-14 05:27

    The reason is most likely that the

    relation "password_user_answered_questions_id_s" does not exist

    Just like the error message informs us. Are you aware of how PostgreSQL handles identifiers?

    Also, sequences are usually named *_seq. Letters missing from the end?


    About maximum length of identifiers - I quote the manual from the link above:

    The system uses no more than NAMEDATALEN-1 bytes of an identifier; longer names can be written in commands, but they will be truncated. By default, NAMEDATALEN is 64 so the maximum identifier length is 63 bytes. If this limit is problematic, it can be raised by changing the NAMEDATALEN constant in src/include/pg_config_manual.h.

    Bold emphasis mine. Seems like you should shorten your identifiers a bit.

    0 讨论(0)
提交回复
热议问题