Closed (fixed)
Project:
Drupal core
Version:
9.0.x-dev
Component:
postgresql db driver
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
26 Jan 2017 at 12:57 UTC
Updated:
2 Apr 2020 at 08:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
daffie commentedComment #3
daffie commentedUpdating IS.
Comment #4
andypostWhich 9.2.x patch version is safe to recommend as minimal?
Comment #5
andypostAlso it may need to check drupal-ci images
Comment #6
daffie commentedMy suggestion would be to use 9.2.1, because there is a corruption bug in 9.2.0. See https://www.postgresql.org/docs/9.2/static/release-9-2-1.html.
Can not find any other reasons to use an other minor version to use as the minimum supported version for D8.
Comment #7
daffie commentedThe patch for raising the minimum supported version of PostgreSQL to 9.2.1.
Comment #8
daffie commentedAs an alternative we could also raise the minimum version of PostgreSQL to 9.3. This would be less work for the drupal-CI guys. PostgreSQL 9.2 will be EOL in september 2017. That is 7 months from now.
Comment #13
andypostThis still needs newer pg version on ci
Comment #14
bzrudi71 commentedGuess we should jump to version 9.5., specially to finally have native "UPSERT" testing in core.
Comment #15
andypost@bzrudi71 what's about 9.5 support for main LTS distros?
Comment #16
bzrudi71 commented@andypost after some research I think we have to stuck with 9.2.x. At least RHEL 6 comes with 9.2 and has EOL Nov. 2020. Let's not force users to upgrade without a really good reason. Anyway, I still wish to have more recent PG drupalCI testing ;-)
Comment #17
liam morlandIs there a ticket regarding upgrading drupalCI testing?
Comment #18
andypost@Liam it needs to be filed to move forward
Comment #19
liam morlandCreated #3019693: Upgrade test running to Postgres 9.5.
Comment #21
bojanz commentedEverything is always outdated in RHEL, that hasn't stopped us before (from bumping PHP requirements, for example).
Still, it would be good to do some research regarding who ships and supports what.
Quick search shows that Ubuntu 16.04 had 9.5 and 18.04 has 10.
Debian 8 (Jessie) has 9.4 and Debian 9 (Buster) has 9.6.
9.4 is the lowest currently supported version by upstream, supported until February 2020.
We could always announce a year in advance, like we did for PHP, then bump to 9.5 for Drupal 9.
Comment #22
liam morlandThat sound reasonable to me.
Comment #23
amateescu commentedBumping the pgsql requirement to 9.5 is a very good idea, it will allow us to use the new JSON capabilities :)
Comment #24
andypostComment #25
mradcliffeI updated the drupalci environments patch to add 9.5, but in retrospect, I think that @bojanz is right and that we'd probably have a 1-year announce because by 2022 RHEL, Debian and Ubuntu LTS will be 10 or higher.
Comment #27
catchJust opened #3104007: Postgresql 12 DrupalCI environment needed for core testing, adding as a related issue.
It's probably too late to commit this patch to Drupal 8 now, but I'm adding it as a should-have to #3079680: [META] Requirements for tagging Drupal 9.0.0-beta1.
Also we should probably increase it further for Drupal 9 to whatever the minimum supported version will be when 9.0.0 is released (or at the end of 2020?)
Also if postgresql has a predictable release schedule and support cycle, we should open a policy issue similar to #2917655: [9.4.x only] Drop official PHP 7.3 support in Drupal 9.4 and document when we'd drop support for EOL postgres versions in the future.
Comment #28
catchComment #29
mradcliffeCreated #3106077: [policy] Decide on PostgreSQL 9.x/10.x support status, @catch.
Comment #30
effulgentsia commentedAgreed. At least not all the way to 9.5. I could maybe see an argument for raising it to 9.2 in Drupal 8 still, but not sure if that's worth it. If it is worth it, let's open a separate issue for that. I don't think we can go higher than 9.2 in Drupal 8, because that's the version in CentOS 7, and CloudLinux and CPanel still don't have stable releases out for CentOS 8, so I think we should assume that there's at least some Drupal 8 sites still on PostgreSQL 9.2.
Therefore, setting the version of this issue to 9.0.x. For Drupal 9, per #3106077-11: [policy] Decide on PostgreSQL 9.x/10.x support status, I propose we go to 9.6 at a minimum. Yes, that means Ubuntu 16.04 users will have to either upgrade their OS or install a newer postgresql package, but I think that's an acceptable requirement for upgrading to a new major Drupal version. Note there's additional discussion in #3106077: [policy] Decide on PostgreSQL 9.x/10.x support status about going to 10, but I think that needs more discussion before doing it, and I don't think we should hold up this issue on that.
Updating the issue title accordingly, but if anyone wants to argue for not going to 9.6 yet, feel free to do so, and we can retitle this back to 9.5.x and discuss 9.6 in a followup. Thanks!
Comment #31
catchUpdated the issue summary, +1 from me to increasing to 9.6 for now asap.
Comment #32
bzrudi71 commentedReminds me of #2549323: Improve the Upsert query implementation for PostgreSQL where we added support for UPSERT queries on PostgreSQL < 9.5. That workaround will be no longer required and all the code should be removed, so adding as related.
Comment #33
daffie commentedMe it is at least 9.6, maybe even 10, but not 9.5. Most people want to go with 9.6 as the minimum supported version, then lets do that then. :)
Comment #34
gábor hojtsyLooks like there is agreement on 9.6 for now. Rerolled for that. Also I found an install task check that oddly checked if PostreSQL is even version 9, which it must be given that the main version check runs before this one. May be overkill to fix it here, we can remove that section of the patch.
Also removing Needs release manager review, @catch added it and then he provided feedback a few weeks later.
Comment #35
gábor hojtsyComment #36
gábor hojtsyCurrently PostgreSQL 9.5 is the highest version available for testing. This is the list:
#3104007: Postgresql 12 DrupalCI environment needed for core testing was committed but not yet deployed. It would provide an environment to tell apart this issue failing (in all other environments) vs. the PostgreSQL 12 one.
Comment #37
gábor hojtsyHm, apparently failed to apply. I had a weird checkout. Rerolled for 9 head.
Comment #38
xjmWRT DB environments, we should have an environment for the minimum version core supports; otherwise, we end up with patches that rely on DB API features core does not support yet and no way of knowing from the patch. So using only PostgreSQL 12 seems overly ambitious. I think we will need 9.6 and 12, or 10 and 12, depending on whether we increase the requirement to 10 or not.
Comment #39
daffie commentedI would like to start working on a DB container for the DrupalCI testbot. Before I can start with that, I need to have 2 questions answered:
Comment #40
gábor hojtsy@daffie: please keep in mind that a PostgreSQL 12 container was already committed (but not yet built/deployed) for DrupalCI, see #3104007: Postgresql 12 DrupalCI environment needed for core testing. That would be a good starting point to adjust based on the decided version here.
Comment #41
effulgentsia commented#3079680-70: [META] Requirements for tagging Drupal 9.0.0-beta1 says:
Given that, I recommend that we do this in two steps.
Step 1) Increase to 9.5. Because we're not blocked on DrupalCI for that.
Step 2) Once #3104007: Postgresql 12 DrupalCI environment needed for core testing (or any other container >9.5) is done, then raise the requirement to 9.6 or 10, depending on what's decided about 9.6 in #3106077: [policy] Decide on PostgreSQL 9.x/10.x support status.
This way, hopefully step 2 is done before beta, but if not, then at the very minimum we ensure that step 1 is.
Not sure whether we want to use this issue for step 1 and open a new one for step 2, or vice versa.
Comment #42
catch#41 makes sense to me.
Comment #43
gábor hojtsy@catch/@effulgentsia: my understanding was that @xjm did not like the prospect of Drupal being tested on PostgreSQL 12 if its minimum requirement is PostgreSQL 9.6 as that means we may still introduce code incompatible with PostgreSQL 9.6 then without noticing. So #3104007: Postgresql 12 DrupalCI environment needed for core testing would be unsuitable if that is the case.
Comment #44
catchWe'd still need a postgres 12 environment, we'd just also need one for the lower version too.
Comment #45
daffie commentedI would like to work on the DrupalCI environment. Only what version of PostgreSQL 9.6 or 10 and with the pg_trgm extension as optional or required? Can we make a decision on that. PLEASE?! I am not criticising anyone, only the whole process is taking forever.
Comment #46
catch@daffie so I think we should be targeting what effulgentsia says in #3106077-34: [policy] Decide on PostgreSQL 9.x/10.x support status
That means postgres 10 and with the pg_trgm extension for the DrupalCI environment.
Comment #47
xjmAgreed with #46 and retitling accordingly.
Comment #48
effulgentsia commentedComment #49
daffie commentedCreated #3118243: Postgresql 10 DrupalCI environment needed for core testing is DB for testbot with the required pg_trgm extension.
Comment #50
xjm#3118243: Postgresql 10 DrupalCI environment needed for core testing has been deployed, so this is unblocked. However, in https://www.drupal.org/pift-ci-job/1604603 there was a failure on the new environment so we might have a critical blocker to fix HEAD there.
Comment #51
xjmThere's also many failures on Postgres 12 but those can be separate, non-blocking criticals: https://www.drupal.org/pift-ci-job/1604606
Comment #52
catchOpened #3118454: Drupal\KernelTests\Core\Database\SelectTest fails on postgres 10.
Comment #53
andypostRe-roll for 10.0 and added constant as we have for mysql, useful to simplify to check tests bypass
Comment #54
xjmFiled #3118591: Datetime-related test failures on PostgreSQL 12 for the remaining Postgres 12 issues after #3118454: Drupal\KernelTests\Core\Database\SelectTest fails on postgres 10.
Comment #55
xjm#3118454: Drupal\KernelTests\Core\Database\SelectTest fails on postgres 10 has been committed to 9.0.x, so this is unblocked now. Requeuing the Postgres 10 tests...
Comment #56
xjmLooks like this needs a reroll, probably for the changes from the other DB issues.
Comment #57
swatichouhan012 commentedRerolled patch #53.
Comment #58
daffie commentedThanks for the reroll. The testbot is not happy. So back to needs work.
Comment #59
catchThat looks like an existing random test failure: #2982755: Random failure in SchemaTest::testSchemaChangePrimaryKey with order of composite primary key. Queued a re-test.
Comment #60
andypostand if we tough this line
t()should be replacedComment #61
andypostbtw Checking release notes of 12 version https://www.postgresql.org/docs/12/release-12.html#id-1.11.6.7.3
There's big changes in collation handling and sorting in general (case insensitivity out of box)
As I see it needs better tuning of used collation, also I expect ICU library related bugs in different distros
Comment #62
andypostAlso runners depends on installed pgsql
Current PHP 7.3 CI using
Current PHP 7.4 CI image
Comment #63
xjmWe can should handle Postgres-12 specific issues in separate criticals. What's blocking for beta is supporting and requiring Postgres 10 only.
Once https://www.drupal.org/pift-ci-job/1606779 is green, this should be committable.
I agree that it's OK to remove the
t()from the updated assertion, It's a slight scope creep but fine in thie circumstance. If someone wants to do that.Comment #64
catchhttps://www.drupal.org/pift-ci-job/1606779 passed, so that was the existing random test failure. We may want to keep an eye on things to see if it's more frequent with postgres 10 but it's not blocking here.
Moving back to CNR. No strong opinion on #60/#63.
Comment #65
catchDo we need to add a check for the pg_trgm extension here (looks like it might be possible to query pg_available_extensions)? Or is that chicken and egg?
Comment #66
xjm@catch Maybe a followup for that?
Comment #67
catchYes good idea. Here it is #3118730: Explicitly test for pg_trgm extention in installer.
Comment #68
xjm@TravisCarden is going to review the patch here (and maybe reroll it to fix the
t()).Comment #69
MixologicRe: #62 libpq is the connection that php uses to *connect* to pgsql, it shouldnt matter what version it is, unless there are specific changes to that lib that are affecting us. It has no bearing on the actual version of pgsql being tested against.
Comment #70
traviscarden commentedJust a few nits:
I think this is supposed to be "pg_trm". See https://www.postgresql.org/docs/current/pgtrgm.html.
This isn't terribly readable. I suggest this instead:
$query = "ALTER DATABASE '{$connection_options['database']}' SET bytea_output = 'escape';";As others have said, if we do another patch, we may as well remove the
t():$this->fail("The bytea_output setting is currently set to 'hex', but needs to be 'escape'. Change this by running the following query: <code>{$query}<_code>");NOTE: I replaced the closing
codetags above with<_code>due to an apparent bug in the d.o code filter.Comment #71
gábor hojtsyRolled a fix with 1 and 2 from #70. I don't agree with removing the t(), it is present in other fail() calls in this same file. Drupal reads the .po file and maintains it in memory until it can import it into the database, so it will still translate error messages. If we want to remove t()s here, there are couple others in the file and we should be consistent.
Comment #72
catchI think @andypost is referring to #3113904: [META] Replace t() calls inside of classes rather than removing the call altogether. But I think that could be done for the whole file at once as part of that overall cleanup.
Patch looks good to me now, but kicked off various environment tests just in case.
Comment #73
xjmAlso queued the 9.1 "expected fail" env.
Comment #74
xjmSo it looks like #71 is broken somehow.
Comment #75
xjmGuessing this is the issue.
Comment #76
xjmI'm guessing the single quotes aren't allowed as delimeters inside the query... We could instead try:
"ALTER DATABASE \"{$connection_options['database']}\" SET bytea_output = 'escape';";Still more readable that way if not quite as increased in readaibility. ;) Otherwise we could also go back to the concatenation, which existed in HEAD too.
Comment #77
xjmAlso going to retest the previous patch to make sure it really is the query syntax and not something else regressing in the meanwhile. I set the pg 10 environment to test on commit so we'll know for sure in the future.
Comment #78
jungleAdjusted according to #76
Comment #79
jungleComment #80
xjmExcellent!
Comment #81
daffie commentedI have not reviewed that patch, but I have a little nitpick which can be fixed on commit: The correct link is https://www.postgresql.org/docs/10/view-pg-indexes.html.
Comment #82
jungleThanks, @daffie, link updated
Comment #83
daffie commentedThe problem that I have with this patch is that the way PostgreSQL does its version numbering has changed. In the 9.x versions the 9.x is the major version. With the release of PostgreSQL version 10 it is just 10 not "10.0". See: https://www.postgresql.org/support/versioning/.
The testbot uses PostgreSQL 10.16 which is currently the newest release of PostgreSQL 10. It will take some time before Drupal 9.0 will be released and my idea was that all linux distributions will support the most current minor version of PostgreSQL, therefor by the time Drupal 9.0 is released they would all be on PostgreSQL 10.16 or newer. I think we should say the minimum version should be just "10" or pick higher minor version then "10.0", something like "10.16".
Comment #85
catch#83 is reasonable, and there is no real difference between 10.0 and 10. I've changed the minimum version to just '10' on commit, we could open a follow-up to increase it to 10.16 if there's a specific reason to avoid intermediate versions.
Committed 5b44684 and pushed to 9.0.x. Thanks!
Comment #86
catchhttps://dispatcher.drupalci.org/job/drupal8_core_regression_tests/14988/ is rightly failing, disabling that environment.
https://www.drupal.org/pift-ci-job/1607968 is still running, hopefully my four character on-commit change wasn't wrong :P
Comment #87
xjmOopsie, this definitely should go in the release notes.
Comment #88
xjmThe release note should also mention the contrib driver to support Postgres 9, if/when a prototype is available.
Comment #89
xjmAlso published the CR.
Comment #90
xjmLet's also write out a release note for this since we also are requiring a new extension. It should link the change record.
The change record also needs to be fixed to mention the new required extension, why we added it, and how sites/hosts can turn it on.
Comment #91
xjmComment #92
catchUpdated the CR (needs fleshing out, but mentions the pg_tgrm extension now) and added a release note.