On Dec 3, 2023, at 7:32 AM, Tom Keffer <tke...@gmail.com> wrote:
I'll be merging the V5 branch into the development branch in the next few days, but target the V5 branch for now.
As I recall, the "case sensitivity" problem with Postgres is that in order to achieve case-insensitivity, it converts everything to lower case, including column names.When WeeWX starts up, it reads the schema from the database itself. So, something that started out like "outTemp" becomes "outtemp". Then if some code needs the outside temperature to calculate, say, dewpoint, it can't find it because Python string comparisons are always case-sensitive.In the intervening years, perhaps Postgres has added a switch to prevent this. Don't know.To work around it in the WeeWX code would require either that all string comparisons involving SQL types become case-insensitive, which would break countless 3rd party extensions, or the code that reads the schema from the database would have to be changed to read it from metadata, or someplace else.There are ways around the problem.But, it's a biggish project. I'd be mighty grateful if someone took it on.-tk
On Saturday, December 2, 2023 at 7:46:32 PM UTC-8 Raoul Snyman wrote:Hello,I just came across WeeWX a week or so ago when I was looking for some open source Linux-based software to pull data from my AcuRite weather station. Fantastic project.I am working on adding support for PostgreSQL (my database of choice), and I wanted to check which branch I should be targeting. I see the V5 branch, which seems to be the future of WeeWX, but the docs specify targeting the "development" branch.Thanks!
--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/9af547f0-449a-4c79-96b4-2f3559359232n%40googlegroups.com.
I'll be merging the V5 branch into the development branch in the next few days, but target the V5 branch for now.
As I recall, the "case sensitivity" problem with Postgres is that in order to achieve case-insensitivity, it converts everything to lower case, including column names.When WeeWX starts up, it reads the schema from the database itself. So, something that started out like "outTemp" becomes "outtemp". Then if some code needs the outside temperature to calculate, say, dewpoint, it can't find it because Python string comparisons are always case-sensitive.In the intervening years, perhaps Postgres has added a switch to prevent this. Don't know.To work around it in the WeeWX code would require either that all string comparisons involving SQL types become case-insensitive, which would break countless 3rd party extensions, or the code that reads the schema from the database would have to be changed to read it from metadata, or someplace else.There are ways around the problem.
But, it's a biggish project. I'd be mighty grateful if someone took it on.
I don't understand the problem.My MariaDB server is set to case-sensitive (file-system and table names). The column names are mainly camel case (using a trimmed down version of the old schema with original names, such as 'inTemp' and 'rain').I have a second instance with an ecowitt DB where the column names are mixed camel and snake (I took standard CamelCase name and added identifying suffixes with an underscore). And, of course, all the archive table names are snake with possible camel suffixes, matching the original column name.
--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/00d99404-07bc-4a26-a75a-6c4de377aba8n%40googlegroups.com.
I still don't have the tests running properly, I couldn't find any docs on exactly how to set up the tests, and both the MySQL and PostgreSQL tests fail when I just run "make test"
There are some other places in the code that are database-dependent. In particular, look at the queries in weewx/xtypes.py, dictionary "group_defs". Maybe you can figure out a way around that.
I don't think the lookup table you supplied in postgres.py will survive the test of time. There are just too many types out there in the wild to ever capture them in a static structure. Whenever you create a table, I think it will be necessary to save the original names in database metadata, then return that when needed.
Make sure you don't drift too far away from the V5 code. I don't see any major refactoring coming up, but I can't guarantee it either.
--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/b298f3e6-ead9-4c5a-8458-d204cb0ac03dn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/4f0c1553-dd27-4831-a832-c270f2183ff6n%40googlegroups.com.