Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qAYUR-0002CX-Po for pgsql-hackers@arkaria.postgresql.org; Sat, 17 Jun 2023 16:09:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qAYUQ-0007DN-9T for pgsql-hackers@arkaria.postgresql.org; Sat, 17 Jun 2023 16:09:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qAYUP-0007DE-RU for pgsql-hackers@lists.postgresql.org; Sat, 17 Jun 2023 16:09:26 +0000 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qAYUK-00343x-RS for pgsql-hackers@postgresql.org; Sat, 17 Jun 2023 16:09:25 +0000 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-39a505b901dso1526579b6e.0 for ; Sat, 17 Jun 2023 09:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=singh-im.20221208.gappssmtp.com; s=20221208; t=1687018158; x=1689610158; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YygpH+yk/JN68RanJjERsb6WwE+JwptYDOBHmbU5amk=; b=OsaaILQH9UCBy0kFxYAYO+IXDrCBHZBsLkhebO72ggersyL49MWGk3k8nNqutVHgYv ycLyCi3cycOwuxZbfknapoJX94Bk9OyjVNbpuOYzql88XYd1zLlKYs1Bgt9hox5Wl//s yPh75OZnQ21OoQXX+AuObbVUJPqx6olS8nEv15/+dlY5yES9cJeASoGCWndxGeP/prdA 4WfYzU+1VTeKGLvRUmjC+ocSo0sug/+kQKHfINUAqMwzAJdi7wESoNh9VdV58mzpznet bYdZ6Wo5NG9ZenGZW8pbfdZuJ/22iOg/bKAOsmmiHPAQanrWzthnU3orQ7p2JpShTuKj g3gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687018158; x=1689610158; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YygpH+yk/JN68RanJjERsb6WwE+JwptYDOBHmbU5amk=; b=P1qRTU2Fr9Ow3aIctchY1UfOmYswjxKXbbCZAxb9+5n5U1jBUoFRao9OLiae9Aoszc 2orDX68KRZTuonabwz1GKVRO5nu09GJHfvUZt+26TAU3oS7DcVy8cNwZFF2A2Mvsyetj v1JD2Dotcxt33h6qUeOJf9mTskKU2PeEtUWZ4kg0zlr1lySw+jBR94qx3kIzgdPC3Imo dS0fqc3mKGxscfzAcPqCdxzmhkLydbqiCZTB+EVpYlrWp3RglYNKcp5Wm5BAO/4kA8Xw Kdoj5X0r4qae14xVeB8MqhQkelSd32jEXqOlUD4hwHdIaO8ub+A42k3jYwasKdI2vmyK 034A== X-Gm-Message-State: AC+VfDzRqJVDpV3wj1uC/4HbYKgFqKKCXQFhHTJz9YE7G7hXJSemhcEn DfWnu7XJxdQg9REB/b1WVHc+lNkVOvHYjf5Ig5Q= X-Google-Smtp-Source: ACHHUZ6HI26WT1RzDqHa/+YJaI66NrH+61B+wtscyGDEvDECzL/kB5iml22aZVAaXAwnVbmLqGc7yE01lOAPU5iyYRw= X-Received: by 2002:a05:6808:2ca:b0:38c:5a32:325b with SMTP id a10-20020a05680802ca00b0038c5a32325bmr6248973oid.41.1687018158365; Sat, 17 Jun 2023 09:09:18 -0700 (PDT) MIME-Version: 1.0 References: <92f32dd57c4d11777c885d211655aceb799d6ecd.camel@j-davis.com> In-Reply-To: <92f32dd57c4d11777c885d211655aceb799d6ecd.camel@j-davis.com> From: Gurjeet Singh Date: Sat, 17 Jun 2023 09:09:02 -0700 Message-ID: Subject: Re: [17] CREATE COLLATION default provider To: Jeff Davis Cc: pgsql-hackers@postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jun 14, 2023 at 9:48=E2=80=AFPM Jeff Davis wrot= e: > > Currently, CREATE COLLATION always defaults the provider to libc. > > The attached patch causes it to default to libc if LC_COLLATE/LC_CTYPE > are specified, otherwise default to the current database default > collation's provider. + if (lccollateEl || lcctypeEl) + collprovider =3D COLLPROVIDER_LIBC; + else + collprovider =3D default_locale.provider; The docs for the CREATE COLLATION option 'locale' say: "This is a shortcut for setting LC_COLLATE and LC_CTYPE at once." So it's not intuitive why the check does not include a test for the presence of 'localeEl', as well? If we consider the presence of LC_COLLATE _or_ LC_CTYPE options to be a determining factor for some decision, then the presence of LOCALE option should also lead to the same outcome. Otherwise the patch looks good. > v11-0001-CREATE-COLLATION-default-provider.patch I believe v11 is a typo, and you really meant v1. Best regards, Gurjeet http://Gurje.et