Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t7zld-001PBy-Ci for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Nov 2024 16:17:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t7zla-002uAM-8E for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Nov 2024 16:17:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t7zlZ-002uAA-Ul for pgsql-hackers@lists.postgresql.org; Mon, 04 Nov 2024 16:17:22 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t7zlW-000AOG-Sw for pgsql-hackers@lists.postgresql.org; Mon, 04 Nov 2024 16:17:21 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-20cceb8d8b4so28341445ad.1 for ; Mon, 04 Nov 2024 08:17:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730737038; x=1731341838; darn=lists.postgresql.org; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=IdaIP/w1egPNtAaLIgw4WxCHbh3LnrB3bX2HZdsURV4=; b=TwK8JOieMLq5BXRShAdgkvkgniyfm0ntd0G6p/eqzxjaTfuBYeResIRtkF7zfnOes9 W3/uohqFwJXvmnQ/XY8A+Rgu6fywY4KY+XsgNShMBO7NrzV9D0pkPkM3hF+Fs7zXFCIF MQBZ0d4ARjmdVzafUzmogEmepM8AvptzmkpRE0sc1O1rW187HDZ60SJ/CX60fzJVXfic VqrfsvxBzK1SJf1hJbt03svHEzrJ9pXNIMCjXRpsOUv2rA0s0N3NtD6Q/+G1dWssGLJb 7MIPmR/u0q4wghARiXnlSTY4QYxSfgB01OFWhgFa502niGa4oIY1x1vkCMKDVhMEfBOi JrHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730737038; x=1731341838; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IdaIP/w1egPNtAaLIgw4WxCHbh3LnrB3bX2HZdsURV4=; b=JUxQ9/4KeZyaAi8ZGeujW+yA84EEytrS0zwQSV651R5YcQYQxYoOQHxDLQ0vCjn6ee MDv459tRF+KGhnalDJaUeMNbiLTgbFJ3GKEQ8oUiy1BBjLhhB0xu7yBGRNAR8iz9bYgt TL8pJLpCBJBZiWwrYuaIfccNyc4ddwkhPH7YQLL2vMXhzrth9d9TZY22x0DxRC8zUTCg A9Eva4fvROOAaZW23UFkAujAcVfsbGT/+Sc/TFEJJeCY6WZO6viOj9crIwu+G0t6XFsq f3gkCWAWn7dcJgdTgk8pCXGUulxJQQqRirvFMq2/vDcsGDeZPIz04K97FISj6lkrVTiM MHsA== X-Gm-Message-State: AOJu0YxQgNIFqchxwbofJWgwaRKul8tW/I16WuS69e+n0z+EBxAQiT4f pT+BprCAaPsJ8F7RFteqQdW4QL2/dlpBf/mpoCWFVkLjzijbzlPYzGjURA== X-Google-Smtp-Source: AGHT+IEINN4H5X+TlvisE3niSHZ5fBD7ueyAkMWaaaBBzZKGSEw3CBeyWJCLkeU4/HuA9FaEck3gyQ== X-Received: by 2002:a17:903:2a83:b0:20c:68af:a4e3 with SMTP id d9443c01a7336-211057732e2mr271047565ad.22.1730737037453; Mon, 04 Nov 2024 08:17:17 -0800 (PST) Received: from [192.168.88.252] ([186.132.56.227]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-211057c68d8sm62816715ad.227.2024.11.04.08.17.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Nov 2024 08:17:16 -0800 (PST) Content-Type: multipart/alternative; boundary="------------nFslT5enzVxmIxGwnB2Jnc7v" Message-ID: <5bd6b5cd-ce74-4ff2-9cfb-c1c9e8e5b824@gmail.com> Date: Mon, 4 Nov 2024 13:17:14 -0300 MIME-Version: 1.0 User-Agent: Betterbird (Linux) Content-Language: en-US To: pgsql-hackers@lists.postgresql.org From: Diego Subject: Bug in create type when missed the comma between element list List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------nFslT5enzVxmIxGwnB2Jnc7v Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi team! I found this bug in the create type command. If you miss the comma between the elements, the command doesn't fail; it runs and concatenates the elements. I detected the problem in v14.4, and it is alive in v17. pglatest$ psql -h 127.0.0.1 -p 55532 Password for user daf: Time: 0.481 ms psql (16.4 (Ubuntu 16.4-1.pgdg24.04+2), server 17.0 (Debian 17.0-1.pgdg120+1)) WARNING: psql major version 16, server major version 17.          Some psql features might not work. Type "help" for help. u: daf db: daf # CREATE TYPE test_enum AS ENUM(     'one'     'two',     'three',     'four' ); CREATE TYPE Time: 12.242 ms u: daf db: daf # \dt+ Did not find any relations. u: daf db: daf # \dT+                                        List of data types  Schema |   Name    | Internal name | Size | Elements | Owner | Access privileges | Description --------+-----------+---------------+------+----------+-------+-------------------+-------------  public | test_enum | test_enum     | 4    | onetwo  +| daf |                   |         |           |               |      | three   +| |                   |         |           |               |      | four     | |                   | (1 row) u: daf db: daf # maybe, some of you can help me to report it properly. Thank you, Diego. --------------nFslT5enzVxmIxGwnB2Jnc7v Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi team!

I found this bug in the create type command. If you miss the comma between the elements, the command doesn't fail; it runs and concatenates the elements.

I detected the problem in v14.4, and it is alive in v17.

pglatest$ psql -h 127.0.0.1 -p 55532
Password for user daf:
Time: 0.481 ms
psql (16.4 (Ubuntu 16.4-1.pgdg24.04+2), server 17.0 (Debian 17.0-1.pgdg120+1))
WARNING: psql major version 16, server major version 17.
         Some psql features might not work.
Type "help" for help.

u: daf db: daf # CREATE TYPE test_enum AS ENUM(
    'one'
    'two',
    'three',
    'four'
);
CREATE TYPE
Time: 12.242 ms
u: daf db: daf # \dt+
Did not find any relations.
u: daf db: daf # \dT+
                                       List of data types
 Schema |   Name    | Internal name | Size | Elements | Owner | Access privileges | Description
--------+-----------+---------------+------+----------+-------+-------------------+-------------
 public | test_enum | test_enum     | 4    | onetwo  +| daf   |                   |
        |           |               |      | three   +|       |                   |
        |           |               |      | four     |       |                   |
(1 row)

u: daf db: daf #


maybe, some of you can help me to report it properly.

Thank you,
Diego.

--------------nFslT5enzVxmIxGwnB2Jnc7v--