Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#24371 closed Cleanup/optimization (fixed)

Recommend that new projects start with PostgreSQL

Reported by: Carl Meyer Owned by: nobody
Component: Documentation Version: 1.7
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

A recurring issue on #django is users who have built a project locally using SQLite, and get to the point of wanting to deploy it, and want to switch to PostgreSQL. This introduces another sometimes-significant hurdle in their deployment learning curve (which is already unfortunately steep). In general I think users would be better off if they just started with PostgreSQL instead.

I don't think it's feasible to change the default project template off of SQLite, simply because of the "built-in, works out of the box" factor. But I think we could/should add a call-out to the tutorial, along the lines of "when starting your first real project, you may want to start out right away with a production-level database like PostgreSQL, to avoid database-switching headaches down the road."

Attachments (1)

24371.diff (806 bytes ) - added by Tim Graham 10 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by Collin Anderson, 10 years ago

Triage Stage: UnreviewedAccepted

We already recommend postgres in the faq, but I think it would be helpful to recommend it in the tutorial too. I wouldn't mind some basic "how to create the database" commands too.

https://docs.djangoproject.com/en/dev/faq/install/#what-are-django-s-prerequisites

comment:2 by Aymeric Augustin, 10 years ago

One particular pain point for MySQL users (and many people start with MySQL) is to figure out:

# in development (need a superuser to create the test database)
$ createuser -S foo
$ createdb foo -O foo

# in production
$ createuser foo
$ createdb foo -O foo

We should document that if we don't already.

comment:3 by Claude Paroz, 10 years ago

Aymeric, I don't see why your previous comment is specific to MySQL. For any database, isn't a requirement that the database user used for running tests needs the "CREATE DATABASE" permission (SQLite aside)?

comment:4 by Aymeric Augustin, 10 years ago

Usually you manage MySQL users and tables from within the MySQL shell with special commands. I remember having to use shell commands instead as a problem for me about 5 years ago.

The problem is compounded by:

  • the need to run commands as the postgres user (sudo su postgres)
  • the learning curve of pg_hba.conf, which is why I'm suggesting to use a superuser for local development
Version 0, edited 10 years ago by Aymeric Augustin (next)

comment:5 by Claude Paroz, 10 years ago

Oh, I completely misread comment:2, sorry. Was probably not completely awake. And yes, it's also my experience that user management in Postgres might be a little more tricky than on MySQL.

by Tim Graham, 10 years ago

Attachment: 24371.diff added

comment:6 by Tim Graham, 10 years ago

Has patch: set

comment:7 by Aymeric Augustin, 10 years ago

Triage Stage: AcceptedReady for checkin

I'm not sure where the extra instructions would go, so let's keep it simple for now.

comment:8 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: newclosed

In 7901eccf2e591447850be00011a7bb556a3c53f2:

Fixed #24371 -- Cautioned against trying to switch databases.

comment:9 by Tim Graham <timograham@…>, 10 years ago

In 2a28606b15070677f9d4aa3cc61a939d9fc501fa:

[1.7.x] Fixed #24371 -- Cautioned against trying to switch databases.

Backport of 7901eccf2e591447850be00011a7bb556a3c53f2 from master

comment:10 by Tim Graham <timograham@…>, 10 years ago

In fbddd946adf1ae0efc90f022df3c6f6d3b1abfa1:

[1.8.x] Fixed #24371 -- Cautioned against trying to switch databases.

Backport of 7901eccf2e591447850be00011a7bb556a3c53f2 from master

Note: See TracTickets for help on using tickets.
Back to Top