r/SQL • u/Ryujiro101 • Apr 01 '26
PostgreSQL Beginner question
I am a new learner of sql. I have made a database in postgreSQL in my laptop. Can someone tell me how can I access that database from my office computer without direct login from my account?
0
Upvotes
5
u/Gargunok Apr 01 '26
With a local install you don't really want to be accessing the DB from other devices. The right place for this to live is on a central server or cloud service. Local install is best for development and testing.
Obviously your laptop could act as the central server but will need the networking opening up between server and client. I wouldn't advise it though. Free tier at something like neon maybe better if trying to demo something from a work machine.
4
u/db_Forge Apr 01 '26
You can do it, but “local DB on my laptop accessible from my office computer” usually turns into a networking lesson faster than a SQL lesson. The usual path is: allow remote connections in PostgreSQL, update access rules, open the right port/firewall, and make sure both machines can actually reach each other. For a beginner, a small hosted Postgres instance or same-network access is often much simpler.
2
u/noobcodes Apr 01 '26
I’m pretty sure there’s a free tier on render for postgresql if you really need to access it from a separate computer
2
u/depesz PgDBA Apr 01 '26
psql -h ip_of_laptop -p port_of_pgand it should work1
u/No-Adhesiveness-6921 Apr 01 '26
If all you want to do is to practice SQL, go to www.portal.azure.com and create an Azure SQL server.
Learning to set up and configure network access isn’t something most database users have to do
Now if you want to be a DBA or want to set up networking then continue with the other suggestions
1
u/Suspicious-Oil6672 Apr 02 '26
Would switch to motherduck w DuckDB for ease tbh
1
u/tlefst SQeeLer😁 Apr 01 '26
Don't do so from your office device.