Template1 | skynotify | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/skynotify + Template0 | skynotify | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/skynotify + Ruby-getting-started_development | skynotify | UTF8 | en_US.UTF-8 | en_US.UTF-8 | Postgres | skynotify | UTF8 | en_US.UTF-8 | en_US.UTF-8 | Myapp_dev | skynotify | UTF8 | en_US.UTF-8 | en_US.UTF-8 | Skynotify | skynotify | UTF8 | en_US.UTF-8 | en_US.UTF-8 | Fortunately, you can ask psql for a list of databases: psql -l You must connect to an existing database to use psql interactively. d explicitly declares which database to use as the default for SQL statements that don't explicitly include a db name during this interactive session.īASICS FOR GETTING A CLEAR PICTURE OF WHAT YOUR PostgresQL SERVER has in it. Replace "skynotify" with your username: psql -d postgres -c "CREATE DATABASE skynotify ENCODING 'UTF-8' " Gogasca | gogasca | UTF8 | en_US.UTF-8 | en_US.UTF-8 |įirst off, it's helpful to create a database named the same as your current use, to prevent the error when you just want to use the default database and create new tables without declaring the name of a db explicitly. ![]() Template1 | gogasca | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/gogasca +Ĭreate a database with your userId: template1=# CREATE DATABASE gogasca WITH OWNER gogasca ENCODING 'UTF8' Template0 | gogasca | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/gogasca + Postgres | gogasca | UTF8 | en_US.UTF-8 | en_US.UTF-8 | Name | Owner | Encoding | Collate | Ctype | Access privileges Login using default template1 database: #psql -d template1 I'll leave this one unanswered until someone can provide an explanation for why this works. I used the following command to get psql to open: psql -d template1 I found the answer but I'm not sure exactly how it works as the user who answered on this thread -> Getting Postgresql Running In Mac: Database "postgres" does not exist didn't follow up. ![]() So it would seem the application is not creating $USER however I've installed->uninstalled-reinstalled several times now so it must be something with my machine. Which is the default database for psql when none is specified. When Postgres.app first starts up, it creates the $USER database, I've also read the applications documentation page that states: I've also attempted to install PostgreSql via homebrew and I'm getting the same issue. Or if I launch psql from the application drop down menu: The same thing happens when I just run: psql It seems I can't even run the console to create the database that it's attempting to find. It returns: psql: FATAL: database "" does not exist I've installed the application and I ran: psql -h localhost I've used it in the past on other machines but it's giving me some trouble when installing on my macbook. ![]() I'm using the PostgreSql app for mac ( ).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |