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 1u7HIz-00DuMK-BF for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Apr 2025 17:21:09 +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 1u7HIx-00GQJW-Go for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Apr 2025 17:21:08 +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 1u7HIx-00GQJO-6g for pgsql-hackers@lists.postgresql.org; Tue, 22 Apr 2025 17:21:08 +0000 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u7HIu-001RlC-2b for pgsql-hackers@lists.postgresql.org; Tue, 22 Apr 2025 17:21:07 +0000 Received: by mail-io1-xd2d.google.com with SMTP id ca18e2360f4ac-85e46f5c50fso114529639f.3 for ; Tue, 22 Apr 2025 10:21:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745342464; x=1745947264; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=yCmJm0kAepDfBuczKzwdQbB3LdoG/jS4gfM3GC7/9g4=; b=ecwURJ41siatFJWcQksbcPPmLcM5PO/y7GedMDuFsbP7bPjQrYJYaWHMXPyG62szdS H5ButJXL7Cii8M6sIbhvOdHtshXvrrYM+SQ9kn1M9gTur9NyrWuonycz+5sY8zBmypxN ilBj12/8ofntAwg75tOygvesiwTgFsAh5xLCAcEqX0Z1KxKDW4KVuU4oS7r+/J+2IflD Zs+IiR8ixdoFHD0ZaG7vkiP20Mfi3+IuIZrUrSSYINdD/ZulUQEhk5cq216qdjJabvFY qQTK5qOMaPftUYtvulRTLU6lYWhUPZ+0g6ULr4f2BcbuadGeILdxqtBunSYUBKwXTVPf gTsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745342464; x=1745947264; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yCmJm0kAepDfBuczKzwdQbB3LdoG/jS4gfM3GC7/9g4=; b=N6J9xf/vfdPbPI0Nxr7dYW4xT5UgN1xkRttRzho8+yTDlDOVbb2WPJWy51Z0LHGJiu f55vVpx/F3V6SzWAC8ZzCGZYVpQpCTbIDWb6KWVezyoiXyWbI4xe6QETBEzerwX9y/hx +xyvoeItFKMpog6nyEqWFkGoe2D6oayxXgXWg1kNCb23BxbVG6lkUJaWGIATaGoOIttG aWf6qXl5xa+tMxEnHrVzH2+D5tc0uiBxQZ3mhHN4wcFiDT2RHlsjp8S6Izbtov5C3H2E P44F/7e9A+vGR/35Ct+UTIg9l1s01g2NtfIm/ovYUkPlPJovgkXoZocGaJDVrSN4Rg31 MLBA== X-Forwarded-Encrypted: i=1; AJvYcCUyVTNKQLv/KlyQZdPJvcOtkphfNYMzPjIYis3C0K0RNAxS4se0zSuKbHWCMf1wW9enzHmJNqPRGGKe1m/u@lists.postgresql.org X-Gm-Message-State: AOJu0Yyw+SL3T0LGMLz78IllDVWSIkyprzgxv+0uYdka4qyz1c+N/G5g jZWljKOz3aMLp39+AikJl8dZXX6T5CiEm7o3jnfjG+iIzbKJFRbh X-Gm-Gg: ASbGncvwxnDSBic2J1TkfyT/sX60oVCIZkFWUSGWmnx9C0bc2mb3HixKaVIEz4XWbmV 5Bx+NqDQbXTrtzLFkNTMDL7kjMXBLcAviEmskRjStJmtjIr3pVFbP/WdinP+AeU/vqW8yEL+1OI gSL/npJ7S4pRAIZCFtVWm8kzMKp+EkXW0GoCNNAJenFJW37ZTdDux9A5aY+jb7gTkUW1jGfwq+f qYJ717HdtJyXfsVwP4+Thu9Hnz75TQuYZXULr1oc74WKfM9bqzHKMYHnUj9HuHfL/ls63YnPXfg Lt4oH7UCltU3mWYYZJrZLrMLRLkZpFPQpwqPRc+vIMtS3zlNOp/6wSAs9SfBpspRJKZ6Z1KgEEP cpP7Cbgt0wxhEzGKhiZJA8r+T02ScWX0= X-Google-Smtp-Source: AGHT+IFRTra5U5vuZKVoYn8vocV6gaHgEvDihIXj1uatos2yhg2xoyRe3paZOaeruwUxcrYdr7TnuQ== X-Received: by 2002:a05:6602:7506:b0:861:722e:2cbc with SMTP id ca18e2360f4ac-861dbedeb19mr1923387239f.12.1745342463668; Tue, 22 Apr 2025 10:21:03 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-861d95f7ab9sm215797839f.13.2025.04.22.10.21.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Apr 2025 10:21:03 -0700 (PDT) Date: Tue, 22 Apr 2025 12:21:01 -0500 From: Nathan Bossart To: Nisha Moond Cc: Euler Taveira , Michael Paquier , Amit Kapila , Alexander Lakhin , Tom Lane , "Jonathan S. Katz" , PostgreSQL Hackers Subject: Re: Large expressions in indexes can't be stored (non-TOASTable) Message-ID: References: <4c2a6100-738e-48cc-8a11-2d85f95ae0ed@app.fastmail.com> <18a111db-9f31-449c-a14b-61779a69f344@app.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Apr 22, 2025 at 05:17:17PM +0530, Nisha Moond wrote: > Thanks for the patch! I tested it for functionality and here are a few comments: Thank you for reviewing. > 1) While testing, I noticed an unexpected behavior with the new 512 > byte length restriction in place. Since thereīs no explicit > restriction on the column ronameīs type, itīs possible to insert an > origin name exceeding 512 bytes. For instance, can use the COPY > command -- similar to how pg_dump might dump and restore catalog > tables. > > For example: > postgres=# COPY pg_catalog.pg_replication_origin (roident, roname) FROM stdin; > Enter data to be copied followed by a newline. > End with a backslash and a period on a line by itself, or an EOF signal. > >> 44 regress_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... [>512 bytes string] > >> \. > COPY 1 > > Once inserted, I was able to use the pg_replication_origin_xxx > functions with this origin name without any errors. > Not sure how common pg_dump/restore of catalog tables is in real > systems, but should we still consider if this behavior is acceptable? I'm personally not too worried about this. The limit is primarily there to provide a nicer ERROR than "row is too big", which AFAICT is the worst-case scenario if you go to the trouble of setting allow_system_table_mods and modifying shared catalogs directly. > 5) As Euler pointed out, logical replication already has a built-in > restriction for internally assigned origin names, limiting them to > NAMEDATALEN. Given that, only the SQL function > pg_replication_origin_create() is capable of creating longer origin > names. Would it make sense to consider moving the check into > pg_replication_origin_create() itself, since it seems redundant for > all other callers? > That said, if there's a possibility of future callers needing this > restriction at a lower level, it may be reasonable to leave it as is. pg_replication_origin_create() might be a better place. After all, that's where we're enforcing the name doesn't start with "pg_" and, for testing, _does_ start with "regress_". Plus, it seems highly unlikely that any other callers of replorigin_create() will ever provide names longer than 512 bytes. -- nathan