Feature #2977
PostgresQL backend support
| Status: | Accepted | Start date: | 12/23/2009 | |
|---|---|---|---|---|
| Priority: | High | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | - | |||
| Target version: | - | |||
| Keywords: | Affected URL: | |||
| Branch: | Affected Dashboard version: | |||
| Votes: | 25 |
Description
Please support PostgresQL as a database (possibly all backends which Puppet itself supports).
In my limited testing I found that, app/models/status.rb contains MySQL-only SQL, and Rails somewhere calls all_hashes, which is also a MySQL-adapter-only function.
Related issues
History
Updated by Daniel Mahlow over 2 years ago
SQLite3 also fails. DB initialization works, but once you try to access through the web interface:
SQLite3::SQLException: no such function: UNIX_TIMESTAMP: SELECT
COUNT(*) - SUM(success) as failed,
COUNT(*) as total,
SUM(success) / COUNT(*) * 100 as percent,
FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(time) / 300) * 300) as start
FROM reports
GROUP BY FLOOR(UNIX_TIMESTAMP(time) / 300) LIMIT 100
Updated by Rein Henrichs over 2 years ago
- Status changed from Unreviewed to Accepted
The Status model needs to be rewritten using portable SQL.
Updated by Anonymous about 2 years ago
- Assignee set to Anonymous
Updated by Dan Bode almost 2 years ago
- Assignee deleted (
Anonymous) - Target version set to 1.2.0
Updated by Igal Koshevoy over 1 year ago
Andrew Forgue writes in #3099:
I’m trying to try out Dashboard on PostgreSQL and I found that app/models/status.rb uses some non-portable (anything other than MySQL) SQL in the by_interval function.
Specifically:
SUM(success) — It makes no sense to sum a boolean value and should do COUNT(*) WHERE success=true UNIX_TIMESTAMP() — Is MySQL specific, PostgreSQL uses extract(‘epoch’ from time), and others, I don’t know about
Looking at the query I don’t think this SQL is something that can be translated to activerecord and probabably has to be done in ruby itself.
I saw in the changelog:
86e93c3 Dashboard now requires MySQL
I think this is not good considering storeconfigs are supported in PostgreSQL. I really really don’t want to run 2 different RDBMSs for the same software.
Thanks
Updated by Igal Koshevoy over 1 year ago
- Status changed from Accepted to Duplicate
Andrew: Thanks for reporting this bug. I’ve copied its text to #2977 and marked this one as a duplicate.
Updated by Christian Hofstaedtler over 1 year ago
- Status changed from Duplicate to Re-opened
This is the original bug, not the duplicate.
Updated by Igal Koshevoy over 1 year ago
Christian: Sorry about that, thanks for re-opening this.
Updated by Igal Koshevoy over 1 year ago
The new rake db:raw:optimize task only has support for MySQL. It should be extended to support PostgreSQL'sVACUUM ANALYZE. The code is atlib/tasks/db_raw.rake`.
Updated by James Turnbull over 1 year ago
- Status changed from Re-opened to Accepted
Updated by Nigel Kersten over 1 year ago
- Priority changed from Normal to High
I think this deserves a higher priority given we support Postgres with storeconfigs. It’s certainly undesirable to run two RDBMSes.
Updated by Jacob Helwig 11 months ago
- Subject changed from PostgreSQL backend support to PostgresQL backend support
Updated by Michael Stahnke 10 months ago
- Target version changed from 1.2.0 to 140
Unfortunately this didn’t make it into 1.2. There has been some work on this, but it is not completed. Moving to target at 1.x.
Updated by Neal Brown 7 months ago
Can we find out if this was done for PE2.0? We would like to drop MySQL if possible as the rest of our infrastructure is Postgresql.
Updated by Nigel Kersten 7 months ago
I’m sorry Neal, this won’t be done for PE 2.0, but it’s an important target feature for a subsequent release.
Updated by Daniel Pittman 2 months ago
- Target version deleted (
140)