Closed frankcollins3 closed 1 year ago
this terminal command making use of superuser do shows the activity on the specified PORT.: sudo lsof -i :5432
sudo pkill -u postgres this terminal command fails because there is no psql user (deleted it from groups)
[11:54am]
pointer / symbolic link related PSQL clearing:
sudo rm /usr/local/bin/clusterdb sudo rm /usr/local/bin/createdb sudo rm /usr/local/bin/createuser sudo rm /usr/local/bin/dropdb sudo rm /usr/local/bin/dropuser sudo rm /usr/local/bin/initdb sudo rm /usr/local/bin/pg_config sudo rm /usr/local/bin/pg_dump sudo rm /usr/local/bin/pg_dumpall sudo rm /usr/local/bin/pg_restore sudo rm /usr/local/bin/postgres sudo rm /usr/local/bin/psql
the requirement to be unusually thorough with handling these many files made me see that one could bundle these steps and create a C console program to:
execute all of these steps with minimal user input required. (sudo has enough to do with these files. they can grab lemonade)
PID coming back from the dead
1) lsof -i :${PORT} 2) new port
[12:38pm]
C program:
proposed approach:
localhost:postgres. I believe PG as a VS code dependency is occupying the PORT. restarting the computer and checking back.
[3:45pm]
https://dba.stackexchange.com/questions/52306/howto-disable-postgres-listening-on-tcp****
specifying search by TCP which is included in the
TCP localhost:postgresql (LISTEN)
again, what led me to think of the C program that interacts with the terminal through sudo comments, I completely wiped postgres from machine as far as the statements detailed way above go.
postgres [other arguments] -c listen_addresses=''
[3:47pm]
deleted 220+ folders: postgres/bytea postgres/date
tried getting screenshot while deleting
[3:54pm]
wow time to add this command to https://github.com/frankcollins3/pseudo_sudo
this solves everything instantly.
[4:02pm]
the hidden 👻 terminal 👻 command 👻
brew services stop postgresql
if problem: 20 minutes ---> wouldn't have thought of using a C program to tackle the problem
cant count the amount of different ways: psql is not a command postgres no user found etc...
[4:09pm]
bookmark. Spent a few hours on psql, few hours sidetracked coding in C just to see if I could interact with terminal. I saved a db.md file so that the libraries, PORT#, destination settings are stored somewhere.
also learned a lesson on my PORT being :5433 (probably because of :5432 being used by some version of postgres that wasn't deleted through all of the $statements)
[4:12pm]
[4:16pm]
I don't think this needs another issue but:
problem: postgres tables come with a \dt relation of user
first proposed approach: create table users ( {...} ) ;
[4:32pm]
I had Postgres.APP (the elephant icon on menubar) I was having problems with my models not persisting through prisma and express, even upon a successful db connection. prisma.model.findMany() was returning {test: null}
First proposed approach: re-download POSTGRES, configure CLI, and keep the server running on PORT 5432 as expected
[11:50am]