Skip to content

[POSTGRESQL] az postgresql db create: Bug fix, correct property bag for creating new database - #33951

Open
nasc17 wants to merge 1 commit into
Azure:devfrom
nasc17:nasc/fixDBBug
Open

[POSTGRESQL] az postgresql db create: Bug fix, correct property bag for creating new database#33951
nasc17 wants to merge 1 commit into
Azure:devfrom
nasc17:nasc/fixDBBug

Conversation

@nasc17

@nasc17 nasc17 commented Aug 21, 2026

Copy link
Copy Markdown
Member

🤖 PR Validation — ️✔️ All clear

Breaking Changes Tests
️✔️ None ️✔️ 130/130

Related command
az postgresql db create

Description
Regressions: db create ignores --charset/--collation starting CLI 2.84.0

A controlled cross-version test on a separate PostgreSQL Flexible Server
confirmed:

  • Azure CLI 2.82.0: Works
  • Azure CLI 2.83.0: Works
  • Azure CLI 2.84.0: Fails
  • Azure CLI 2.85.0: Fails
  • Azure CLI 2.87.0: Fails
  • Azure CLI 2.89.1: Fails

Testing Guide
Test included

History Notes
[POSTGRESQL] az postgresql db create: Correct property bag being sent for creating new database


This checklist is used to make sure that common guidelines for a pull request are followed.

@nasc17
nasc17 requested a review from a team as a code owner August 21, 2026 15:18
Copilot AI lite review requested due to automatic review settings August 21, 2026 15:18
@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi nasc17,
Since the current milestone time is less than 7 days, this pr may not catch up with this release.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a regression in the PostgreSQL Flexible Server database create path where az postgresql db create (aka az postgres flexible-server db create) stopped honoring --charset/--collation due to sending an incorrect request payload shape to the service.

Changes:

  • Update the database create request body to use the correct properties bag for charset/collation.
  • Extend the flexible server DB scenario test to pass --charset/--collation and assert they are present in create/show output.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/azure-cli/azure/cli/command_modules/postgresql/commands/database_commands.py Sends charset/collation under properties when creating a database, matching the service contract.
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_db.py Adds coverage ensuring --charset/--collation are applied and observable via create/show.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@yonzhan

Copy link
Copy Markdown
Collaborator

POSTGRESQL

@a0x1ab Aditya Pujara (a0x1ab) added the Azure Client Tools Agent Requested Request Azure Client Tools Agent testing and review label Aug 22, 2026
@azure-client-tools-agent

Copy link
Copy Markdown
Contributor

Live test results — azdev test --live --series (changed test files only)

PASS

Selectors: test_postgres_flexible_commands_db (module)
PR head ref: nasc/fixDBBug
PR head sha: d0b5e0c16e716e517c7485751883c6a349f38365
PR base ref: dev
New test files in PR: false

Changed test files run
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_db.py

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/32550789337

Live-test recordings: 1 regenerated — archived in workflow artifact live-test-pr-33951 (recordings/).

ℹ️ This PR is from a fork, so recordings were not pushed automatically. Download them from the artifact and commit to your branch.

Recording files
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/recordings/test_postgres_flexible_server_database_mgmt.yaml
Last 80 lines of azdev output

=============
| Run Tests |
=============


=====================
| Discovering Tests |
=====================

/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:13705: SyntaxWarning: invalid escape sequence '\]'
  self.cmd('vmss application set -g {rg} -n {vmss} --app-version-ids {vid1} {vid2} --enable-automatic-upgrade True\]', checks=[
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:18: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_compute': '\{"providers":\["Microsoft.Compute"\]\}',
/home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli/azure/cli/command_modules/identity/tests/latest/test_identity.py:19: SyntaxWarning: invalid escape sequence '\{'
  'resource_restriction_empty': '\{"providers":\[\]\}'

test index updated: /home/runner/.azdev/env_config/home/runner/work/issue-sentinel/issue-sentinel/.venv/test_index/latest.json

Test on modules: test_postgres_flexible_commands_db

WARNING: RUNNING TESTS LIVE
The tests are set to run against current profile "latest"
============================= test session starts ==============================
platform linux -- Python 3.12.14, pytest-9.1.1, pluggy-1.6.0 -- /home/runner/work/issue-sentinel/issue-sentinel/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli
plugins: forked-1.7.5, xdist-3.8.0
collecting ... collected 1 item

azure-cli/src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_postgres_flexible_commands_db.py::FlexibleServerDatabaseMgmtScenarioTest::test_postgres_flexible_server_database_mgmt PASSED [100%]

- generated xml file: /home/runner/work/issue-sentinel/issue-sentinel/test-output/results.xml -
======================== 1 passed in 344.91s (0:05:44) =========================

Posted by agent-assist live-test workflow.

@azure-client-tools-agent azure-client-tools-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI Summary

Live test (azdev test) passed. However, Azure Pipelines CI failed on the Azure.azure-cli check: Build #20260821.41 failed with 3 errors / 4 warnings (build details).

53/55 checks passed; 1 failed, 0 pending.

@d0b5e0c16 please review the build log linked above and address the reported errors/warnings before this PR can be merged.

@azure-client-tools-agent azure-client-tools-agent Bot added azure-client-tools-agent Pull request reviewed by Azure Client Tools Agent and removed Azure Client Tools Agent Requested Request Azure Client Tools Agent testing and review labels Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

azure-client-tools-agent Pull request reviewed by Azure Client Tools Agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants