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
Percy
Percy6mo ago
Project ID: N/A
Martynas
Martynas6mo ago
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
Adam
Adam6mo ago
I wouldn’t trust the Railway database ui, it can be unreliable. Use a proper database client like dbgate
Martynas
Martynas6mo ago
@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?
Adam
Adam6mo ago
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?
Martynas
Martynas6mo ago
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?
Adam
Adam6mo ago
shell runs locally, so it’s very possible
Martynas
Martynas6mo ago
and the login also works for my app, which is surprising given no database exists
Adam
Adam6mo ago
all shell does is inject your environment variables from Railway
Martynas
Martynas6mo ago
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
Adam
Adam6mo ago
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
Martynas
Martynas6mo ago
Okay, I restarted the server and it seems to be working fine now got the tables in the ui as well
Adam
Adam6mo ago
great, glad to hear it