On Tue, 22 Dec 2015 18:54:27 +0100 Cédric Krier <[email protected]> wrote:
> On 2015-12-22 17:29, Luis Falcon wrote: > > On Tue, 22 Dec 2015 12:33:00 +0100 > > Cédric Krier <[email protected]> wrote: > > > > > Hi, > > > > > > I'm trying to make the tests working back on GNU Heath, so I work > > > module per module. So far, I have done almost half of them. > > > But now I have to come back to the first module 'health' because > > > of changeset 8665a21223e2 because the SQL query doesn't work on > > > SQLite. (It is important to use python-sql to write portable SQL > > > queries). > > Agree. We're going on that direction, and most code has been moved > > to python-sql, but for upgrades "run-once" snippets I've been using > > standard SQL code, that could be used also directly from the psql > > interpreter. > > But it was not standard SQL code as it doesn't run on SQLite. I look at it the other way around. SQLite uses Postgres as their reference platform ("What Would Postgres Do") > The main issue was the usage of TRUE which is not in the SQL standard. Don't agree. The "IS TRUE" predicate is part of the SQL standard (F571 ext), that has been around for quite a while. PostgreSQL is one of the systems that conforms to this SQL standard. Moreover, IMHO, PostgreSQL is one of the most SQL conformant DBs, and we should follow it. > > I think the option to copy/paste the query in psql is not so much > important against the portability. Arguable. As we discussed a while ago, probably the best thing to do in the future is to run sql scripts for code to be "run-once" in upgrades. That would result in cleaner __register__ (s) > Also someone who is able to find this query in the code will be able > to convert it from python-sql to plain SQL. True. But still would have to do the job of conversion. Bests, -- Luis Falcon, M.D., BSc President, GNU Solidario GNU Health: Freedom and Equity in Healthcare http://health.gnu.org
pgpROr1gNvhJO.pgp
Description: OpenPGP digital signature
