R
Railway11mo ago
Martynas

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