Postgres does not show any tables.
I can query properly through shell and the database seems to be postgres, but no tables in the railway postgres service. Any ideas?
13 Replies
Project ID:
N/A
from django.db import connection import pprint print(pprint.pformat(connection.settings_dict)) {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_HEALTH_CHECKS': False, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'HOST': 'viaduct.proxy.rlwy.net', 'NAME': 'postgres', 'OPTIONS': {}, 'PASSWORD': '', 'PORT': '56252', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIGRATE': True, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': 'postgres'}Querying a user works as well, this is on django
I wouldn’t trust the Railway database ui, it can be unreliable. Use a proper database client like dbgate
@Adam I tried connecting through psql, the database seems to be empty, do you have any ideas where would it be saving the entries since I can properly retrieve them?
If it’s not showing the entries, it’s not saving the data
there isn’t another place where it could be saving them
is your app logging the successful and failed queries?
I can get them through the shell I open with
railway run python manage.py shell
them=records
is it possible shell is accessing local env?shell runs locally, so it’s very possible
and the login also works for my app, which is surprising given no database exists
all shell does is inject your environment variables from Railway
I am thinking it somehow saves them into a local sqlite, I am thinking it might be my settings
I am curious, why the choice not to have terminal access to railway services?
like why is shell local and not in the service
That would require ssh access, which railway cannot do atm
the team is aware that people want it, I’m unsure if they are currently developing it
Okay, I restarted the server and it seems to be working fine now
got the tables in the ui as well
great, glad to hear it