[PATCH] Add regression test for mismatched ENCODING and LOCALE in CREATE DATABASE - Mailing list pgsql-hackers

From Yushu Chen
Subject [PATCH] Add regression test for mismatched ENCODING and LOCALE in CREATE DATABASE
Date
Msg-id CAP5x3pYD68_BpoDtfCxygAE8Dq9sWoFoimxP--LPL8hDcEufJA@mail.gmail.com
Whole thread
Responses Re: [DESIGN] Soft DROP TABLE, recoverable drops for PostgreSQL
List pgsql-hackers
Hi,

While reading the CREATE DATABASE documentation at
https://www.postgresql.org/docs/current/sql-createdatabase.html, I
noticed the following sentence:

"The specified locale and encoding settings must match, or an error
will be reported."

However, we do not currently have regression coverage for that failure case.

This patch adds a regression test covering incompatible ENCODING and
LOCALE combinations, for example:

CREATE DATABASE dbtest
    LOCALE 'en_US.UTF-8'
    ENCODING LATIN1
    TEMPLATE template0;

Which is expected to fail due to the encoding/locale mismatch.

The patch only adds test coverage and does not change backend behavior.

Regards,
Yushu

Attachment

pgsql-hackers by date:

Previous
From: wenhui qiu
Date:
Subject: Re: Report oldest xmin source when autovacuum cannot remove tuples
Next
From: Álvaro Herrera
Date:
Subject: Re: Pg upgrade bug with NOT NULL NOT VALID