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 1rv6XT-009iDr-1U for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Apr 2024 02:21:15 +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 1rv6XS-008Xll-4Z for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Apr 2024 02:21:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rv6XR-008Xld-R5 for pgsql-hackers@lists.postgresql.org; Fri, 12 Apr 2024 02:21:13 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rv6XN-002R9i-Gk for pgsql-hackers@lists.postgresql.org; Fri, 12 Apr 2024 02:21:12 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-417f7edf87eso3279975e9.3 for ; Thu, 11 Apr 2024 19:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712888466; x=1713493266; darn=lists.postgresql.org; 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=b+Um9YRktsI6kD3cyKyGvyk8ker21W4+BibuVZCHpss=; b=YJKCUe/WBUgiwhEO/WKuU7FI2aAMpg+0JgyGIe6hMvGZ2LIOHHf/wp2+cZkZTQ7jqZ eXzZwSRKlP1wu7W47drw5yFhm8soWnahUUoeYbCiP+C+bxChKcLna6ys4y/tP9nAwZJn ub2BSglIfkwPPYEnGTCs8yD+K6lRCVg0rOFNhKuxIBeWkHMAsNPtECYvjNlia30zNG00 jM3T95OggwBzZCY0K3mMerTere8Ec+ON462BdHYd1S7Uk/2CsX7c+rEuk5S1XkEylGW1 Z7kLZ1TjjinNfbqJWlUJ9C/uC8qqaBeJGqMEM5+Ufs68diKtnVJezYDyrAlVU6PYlwat EerQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712888466; x=1713493266; 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=b+Um9YRktsI6kD3cyKyGvyk8ker21W4+BibuVZCHpss=; b=ianhS7Gv0au/sk/o6fgwU7YbpwuCoXe365Pk78CXvbGxVCI1nbEYY7FH55p8q7Yp7h fZmSCnUm93Zrie28uVF9niYjztry5U1Ch+xgYrFSmOcer0TlwhH6WJJLAa+XDHDSoFN6 58/dM7iqXoZd2Qw0dR6MDpKd+Pb3AL5oW9ndfHFPJ4jGR7TOiGKEX8MzLnzLLgr/1xaD 6N4CvEO1p3I0yOduUww74f8Nh5gYt9uHTamjbbtxzL3cwc9pP2fFP32jJCoNco+HzHOY O7CKi9wtpiyeIATWCwr24W6xfDv+hTsnL75E1NfeVAX5hHj12PYA82PheV1wIbKHzuAd yQAQ== X-Forwarded-Encrypted: i=1; AJvYcCU3qYxx9o710s+qeZwRtnT0if8wfkLmIrWojCi6x0VtsnKoM7Bfvdb3Uh1UjCLhhZ4uwHrtdMoocuPlEMO9hLLq4o8y6fst8jNxRLU3abL5k1KR X-Gm-Message-State: AOJu0YyQ3UvVLEO+ZnVk18/UPXJRdu17TT6M5zDvj3tqJSfE+Rzg4XBd 8nebswo6au5jA0PvLZF4SM4ur3o4hmSfqj858vf8vY2sb07ItiHG7wxhrKwSal6lVxKxlTYmBmP lZI5sbjyUyzIWSF2UL/aLEjvzLxw= X-Google-Smtp-Source: AGHT+IE2ksWPsMT27TD64j1IE5JhzTsBC79/s1Eqnoksd8uohLnaUxd0N+d24xxnTCmjvjFucwldSBeFCgOyxxpT7Y0= X-Received: by 2002:a5d:4411:0:b0:343:ad6e:8b9 with SMTP id z17-20020a5d4411000000b00343ad6e08b9mr980445wrq.58.1712888466478; Thu, 11 Apr 2024 19:21:06 -0700 (PDT) MIME-Version: 1.0 References: <3a4b9c1c-3edf-4e29-9629-b4113aefb0f3@postgrespro.ru> <28ed1ee0-749d-9838-955e-abff42fc44be@gmail.com> <86bfd241-a58c-479a-9a72-2c67a02becf8@postgrespro.ru> <0f655bcd-6487-4179-f9cf-c248efbad510@gmail.com> In-Reply-To: From: Robert Haas Date: Thu, 11 Apr 2024 22:20:53 -0400 Message-ID: Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands To: Alexander Korotkov Cc: Alexander Lakhin , Dmitry Koval , PostgreSQL Hackers 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 Thu, Apr 11, 2024 at 9:54=E2=80=AFPM Alexander Korotkov wrote: > I think we shouldn't unconditionally copy schema name and > relpersistence from the parent table. Instead we should throw the > error on a mismatch like CREATE TABLE ... PARTITION OF ... does. I'm > working on revising this fix. We definitely shouldn't copy the schema name from the parent table. It should be possible to schema-qualify the new partition names, and if you don't, then the search_path should determine where they get placed. But I am inclined to think that relpersistence should be copied. It's weird that you split an unlogged partition and you get logged partitions. One of the things I dislike about this type of feature -- not this implementation specifically, but just this kind of idea in general -- is that the syntax mentions a whole bunch of tables but in a way where you can't set their properties. Persistence, reloptions, whatever. There's just no place to mention any of that stuff - and if you wanted to create a place, you'd have to invent special syntax for each separate thing. That's why I think it's good that the normal way of creating a partition is CREATE TABLE .. PARTITION OF. Because that way, we know that the full power of the CREATE TABLE statement is always available, and you can set anything that you could set for a table that is not a partition. Of course, that is not to say that some people won't like to have a feature of this sort. I expect they will. The approach does have some drawbacks, though. --=20 Robert Haas EDB: http://www.enterprisedb.com