PostgreSQL and Pyramid: ProgrammingError: relation "records" does not exist

atroul

I have to test an existing pyramid application.

I have to set up a local PostgreSQL server with a database with some records.

Then I have to set up a python virtual environment and start web-server for the existing pyramid application.

The application is up and running in localhost but when I try to add a record in the connected(!) db through the web page I receive errors. I suppose that its not connected to the db.

Because I am new with Pyramid and PostgreSQL is there any tutorial which I can follow?

The steps I followed were:

Setup the local PostgreSQL server.

Setup the python virtual environment and start the web-server for the pyramid application (in a different terminal).

ERRORS: pserve development.ini Starting server in PID 13630. serving on http://0.0.0.0:8080

2015-11-22 19:49:10,965 ERROR [waitress][waitress] Exception when serving /get_records
Traceback (most recent call last):
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/waitress-0.8.10-py2.7.egg/waitress/channel.py", line 336, in service
    task.service()
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/waitress-0.8.10-py2.7.egg/waitress/task.py", line 169, in service
    self.execute()
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/waitress-0.8.10-py2.7.egg/waitress/task.py", line 388, in execute
    app_iter = self.channel.server.application(env, start_response)
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid-1.6b2-py2.7.egg/pyramid/router.py", line 223, in __call__
    response = self.invoke_subrequest(request, use_tweens=True)
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid-1.6b2-py2.7.egg/pyramid/router.py", line 198, in invoke_subrequest
    response = handle_request(request)
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid-1.6b2-py2.7.egg/pyramid/tweens.py", line 20, in excview_tween
    response = handler(request)
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid_tm-0.12-py2.7.egg/pyramid_tm/__init__.py", line 99, in tm_tween
    reraise(*exc_info)
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid_tm-0.12-py2.7.egg/pyramid_tm/__init__.py", line 80, in tm_tween
    response = handler(request)
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid-1.6b2-py2.7.egg/pyramid/router.py", line 145, in handle_request
    view_name
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid-1.6b2-py2.7.egg/pyramid/view.py", line 541, in _call_view
    response = view_callable(context, request)
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid-1.6b2-py2.7.egg/pyramid/config/views.py", line 351, in rendered_view
    result = view(context, request)
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid-1.6b2-py2.7.egg/pyramid/config/views.py", line 505, in _requestonly_view
    response = view(request)
  File "/home/atroul/pyramid_sites/wsyscore/wsyscore/views.py", line 44, in get_records
    records = base.database.get_records()
  File "/home/atroul/pyramid_sites/wsyscore/wsyscore/Database.py", line 107, in get_records
    cursor.execute(sql_sentense, ids)
ProgrammingError: relation "records" does not exist
LINE 1: select * from records;
                      ^

2015-11-22 19:49:12,783 ERROR [waitress][waitress] Exception when serving /record/create_new_record
Traceback (most recent call last):
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/waitress-0.8.10-py2.7.egg/waitress/channel.py", line 336, in service
    task.service()
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/waitress-0.8.10-py2.7.egg/waitress/task.py", line 169, in service
    self.execute()
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/waitress-0.8.10-py2.7.egg/waitress/task.py", line 388, in execute
    app_iter = self.channel.server.application(env, start_response)
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid-1.6b2-py2.7.egg/pyramid/router.py", line 223, in __call__
    response = self.invoke_subrequest(request, use_tweens=True)
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid-1.6b2-py2.7.egg/pyramid/router.py", line 198, in invoke_subrequest
    response = handle_request(request)
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid-1.6b2-py2.7.egg/pyramid/tweens.py", line 20, in excview_tween
    response = handler(request)
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid_tm-0.12-py2.7.egg/pyramid_tm/__init__.py", line 99, in tm_tween
    reraise(*exc_info)
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid_tm-0.12-py2.7.egg/pyramid_tm/__init__.py", line 80, in tm_tween
    response = handler(request)
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid-1.6b2-py2.7.egg/pyramid/router.py", line 145, in handle_request
    view_name
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid-1.6b2-py2.7.egg/pyramid/view.py", line 541, in _call_view
    response = view_callable(context, request)
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid-1.6b2-py2.7.egg/pyramid/config/views.py", line 351, in rendered_view
    result = view(context, request)
  File "/home/atroul/pyramid_sites/env/local/lib/python2.7/site-packages/pyramid-1.6b2-py2.7.egg/pyramid/config/views.py", line 505, in _requestonly_view
    response = view(request)
  File "/home/atroul/pyramid_sites/wsyscore/wsyscore/views.py", line 141, in create_new_record
    record_id = base.database.init_record(main_template)
  File "/home/atroul/pyramid_sites/wsyscore/wsyscore/Database.py", line 62, in init_record
    cursor.execute(sql_sentense, [psycopg2.extras.Json(initial_record['main'])])
ProgrammingError: relation "records" does not exist
LINE 1: INSERT INTO records (seq, main) VALUES (0, '{"first_names": ...
Mikko Ohtamaa

You try to query SQL table records which does not exist.

Either

  • Create this table in your database using PostgreSQL clients (command line client)

  • If you think the table should already exist then fix your SQL query for spelling and refer to correct tables

pgcli - better command line interface for PostgreSQL

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

ProgrammingError: relation "django_site" does not exist

From Dev

ProgrammingError at / relation "main_post" does not exist

From Dev

Django: Relation does not exist in Postgresql

From Dev

Django: Relation does not exist in Postgresql

From Dev

django 1.9: ProgrammingError: relation "users_user" does not exist

From Dev

Flask : sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) relation "users" does not exist

From Dev

one to many, Flask-SqlAlchemy, sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) relation does not exist

From Dev

PostgreSQL: Error: column of relation does not exist

From Dev

Update join on postgresql - Relation does not exist

From Dev

relation "table name" does not exist (postgresql)

From Dev

Django, ManyToManyField - ProgrammingError: relation foo_bar does not exist. Recognized in migrations, though relation is never created

From Dev

PostgreSQL check if table exist throwing "relation does not exist" error

From Dev

ProgrammingError: relation "django_session" does not exist error after installing Psycopg2

From Dev

Trouble getting Django set up on Heroku using South - keep getting ProgrammingError: relation does not exist

From Dev

ProgrammingError 'column "scheme_id" of relation "value_calculator_newunit" does not exist' in Django 1.8.3

From Dev

Django Rest Framework "django.db.utils.ProgrammingError: relation "patient" does not exist"

From Dev

Django psycopg2.ProgrammingError relation does not exist using custom model Manager

From Java

Postgresql tables exists, but getting "relation does not exist" when querying

From Dev

Error: Relation does not exist when running Rails in production using postgresql

From Dev

PostgreSQL ERROR: 42P01: relation "[Table]" does not exist

From Dev

ERROR: column of relation does not exist PostgreSQL ,Unable to run insert query

From Dev

Error: Relation does not exist when running Rails in production using postgresql

From Dev

Relation *tablename* does not exist

From Dev

relation "old" does not exist

From Dev

Django: relation does not exist

From Dev

Relation does not exist PLPGSQL

From Dev

Django migrations & Heroku: ProgrammingError at / column does not exist

From Dev

psycopg2.ProgrammingError: column does not exist

From Dev

Update table - relation does not exist

Related Related

  1. 1

    ProgrammingError: relation "django_site" does not exist

  2. 2

    ProgrammingError at / relation "main_post" does not exist

  3. 3

    Django: Relation does not exist in Postgresql

  4. 4

    Django: Relation does not exist in Postgresql

  5. 5

    django 1.9: ProgrammingError: relation "users_user" does not exist

  6. 6

    Flask : sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) relation "users" does not exist

  7. 7

    one to many, Flask-SqlAlchemy, sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) relation does not exist

  8. 8

    PostgreSQL: Error: column of relation does not exist

  9. 9

    Update join on postgresql - Relation does not exist

  10. 10

    relation "table name" does not exist (postgresql)

  11. 11

    Django, ManyToManyField - ProgrammingError: relation foo_bar does not exist. Recognized in migrations, though relation is never created

  12. 12

    PostgreSQL check if table exist throwing "relation does not exist" error

  13. 13

    ProgrammingError: relation "django_session" does not exist error after installing Psycopg2

  14. 14

    Trouble getting Django set up on Heroku using South - keep getting ProgrammingError: relation does not exist

  15. 15

    ProgrammingError 'column "scheme_id" of relation "value_calculator_newunit" does not exist' in Django 1.8.3

  16. 16

    Django Rest Framework "django.db.utils.ProgrammingError: relation "patient" does not exist"

  17. 17

    Django psycopg2.ProgrammingError relation does not exist using custom model Manager

  18. 18

    Postgresql tables exists, but getting "relation does not exist" when querying

  19. 19

    Error: Relation does not exist when running Rails in production using postgresql

  20. 20

    PostgreSQL ERROR: 42P01: relation "[Table]" does not exist

  21. 21

    ERROR: column of relation does not exist PostgreSQL ,Unable to run insert query

  22. 22

    Error: Relation does not exist when running Rails in production using postgresql

  23. 23

    Relation *tablename* does not exist

  24. 24

    relation "old" does not exist

  25. 25

    Django: relation does not exist

  26. 26

    Relation does not exist PLPGSQL

  27. 27

    Django migrations & Heroku: ProgrammingError at / column does not exist

  28. 28

    psycopg2.ProgrammingError: column does not exist

  29. 29

    Update table - relation does not exist

HotTag

Archive