You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERROR: syntax error at or near "WITH"
LINE 1: CREATE USER WITH ENCRYPTED PASSWORD '' CREATEDB;
^
ERROR: zero-length delimited identifier at or near """"
LINE 1: CREATE DATABASE everycheese WITH ENCODING 'UTF-8' OWNER "";
^
ERROR: syntax error at or near ";"
LINE 1: GRANT ALL PRIVILEGES ON DATABASE everycheese TO ;
^
I replaced my default= with the example in the book:
And again ran the command from 18.5. I received the following output this time:
ERROR: syntax error at or near "user"
LINE 1: CREATE USER user WITH ENCRYPTED PASSWORD 'passwd' CREATEDB;
ERROR: role "user" does not exist
ERROR: syntax error at or near "user"
LINE 1: GRANT ALL PRIVILEGES ON DATABASE everycheese TO user;
I followed the Troubleshooting PostgreSQL: Role Does Not Exist (58.3) link and noticed that in the example error message an actual username, "audreyr" was used:
createdb: could not connect to database template1: FATAL:
role "audreyr" does not exist`
Before following the directions in 58.3 I changed settings/base.py again:
Ran the command from 18.5 and received the following output:
python manage.py sqlcreate | sudo -u postgres psql -U postgres
CREATE ROLE
CREATE DATABASE
GRANT
Was then able to migrate and complete Section 18. Double-checked by following 16.6.1, Delete and Re-Clone.
Possible Solutions
This is my first time using PostgreSQL, so I'm not sure if my solution is correct. All I've discovered is the defaults in section 18.4 did not match the defaults when I created the project using cookiecutter. What I think the solution should be:
cookiecutter template may need to be changed to match the code in 18.4 or, maybe there is an issue in section 16.4.2 where the reader is instructed to accept all defaults.
Reader should be instructed to change "user:passwd" to an actual username and password?
Your full name so we can provide accurate credit within the book
Jeff Robinson
The text was updated successfully, but these errors were encountered:
Location within the Book
Hint: Page numbers change all the time. The best way to report an issue is by chapter, section, and subsection numbers.
Description
At this point, using all defaults by cookiecutter, DATABASE_URL did not match what was generated in settings/base.py. The code in section 18.4 read:
My default settings/base.py instead included:
I didn't see anything mentioning changing defaults so I kept my above default and ran the following command from section 18.5:
It returned:
I replaced my default= with the example in the book:
And again ran the command from 18.5. I received the following output this time:
I followed the Troubleshooting PostgreSQL: Role Does Not Exist (58.3) link and noticed that in the example error message an actual username, "audreyr" was used:
Before following the directions in 58.3 I changed settings/base.py again:
Ran the command from 18.5 and received the following output:
Was then able to migrate and complete Section 18. Double-checked by following 16.6.1, Delete and Re-Clone.
Possible Solutions
This is my first time using PostgreSQL, so I'm not sure if my solution is correct. All I've discovered is the defaults in section 18.4 did not match the defaults when I created the project using cookiecutter. What I think the solution should be:
cookiecutter template may need to be changed to match the code in 18.4 or, maybe there is an issue in section 16.4.2 where the reader is instructed to accept all defaults.
Reader should be instructed to change "user:passwd" to an actual username and password?
Your full name so we can provide accurate credit within the book
Jeff Robinson
The text was updated successfully, but these errors were encountered: