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.96) (envelope-from ) id 1vwsSs-001Iru-0k for pgsql-general@arkaria.postgresql.org; Mon, 02 Mar 2026 01:52:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vwsSp-00EdRg-28 for pgsql-general@arkaria.postgresql.org; Mon, 02 Mar 2026 01:52:51 +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.96) (envelope-from ) id 1vwsSo-00EdRX-2G for pgsql-general@lists.postgresql.org; Mon, 02 Mar 2026 01:52:51 +0000 Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vwsSj-00000001x3N-3ufk for pgsql-general@lists.postgresql.org; Mon, 02 Mar 2026 01:52:50 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id E924C140006C; Sun, 1 Mar 2026 20:52:43 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Sun, 01 Mar 2026 20:52:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1772416363; x=1772502763; bh=vJQ1q3B5Z1BnJ4EI4Hr7cbpTmIRToI6IMVyqazzMTYs=; b= L0QtKkwOfoeZZGzh4+XF8BX6KfrLJ5RLLwt+tnaY10sFnXLuRBZ+IAgG85Ib6a4v KuWdJvthSN+McHdWhl/EnXu+W4UlAYtd7J96KC+Bqow+StbZGt45LqWjGz/n9g3U gvADNRXnG6rOjqiOWZ8lz6B2TCSltec4nIRRIPkmngAENVtFYHi+m2bGsQDJkeu+ eyuU7p9XSR24xIiuKvmKVNCakzUx1KDNtoKaMj/7M55ID+4qYTUTU5/lOE+34Fnx NYMlYPPTSm0IV7CX/kKW+NIkGgw5XGXnKdSV9/ljULsZJWAfWHaDNlgFRK59FUEs 2TEuzrl9AOWDDGhDHn9zzw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1772416363; x=1772502763; bh=v JQ1q3B5Z1BnJ4EI4Hr7cbpTmIRToI6IMVyqazzMTYs=; b=wAfzObncPTwi5OPNu kYlcy8EN/hwQSRLHmZ2v3OWhZrrfYxuy179faMtZ03ngY8Bthz+Sh/6qNUhCHVwA UFc6ZLPxRX4V+IcwR9mqIHvGnK5qJLf6jEtB3gtAz1/fow+aITkadkq0yoGbpC14 fQKwbmBgBhxNW6g7Mowz+gnp2oe7yrT9o3FFAtcmnYpdr1xTLiviyWnVQJUzCzKo T3nMPNuol2zfAsmiaACN/Dsps7kz2uMP890HZL4O7aoJuSh0vHFcoCt7/PYA+J1o PgmFrIPJjLYJQJW5drZlDnvNX/DeN+QmboSshaAhWvd1ZUFptNtE1kwX/bLncAgL xyeOg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvheeigedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepkfffgggfuffvfhfhjggtgfesthejredttddvjeenucfhrhhomheptegurhhirghn ucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmqe enucggtffrrghtthgvrhhnpeekfeehuddvjeeigfeifeejtdduudffledvfeelheeftdei ffeugfdvkeelgedtvdenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghn rdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhdpnhgspghrtghpthhtohepvddpmhhoug gvpehsmhhtphhouhhtpdhrtghpthhtohepihhkohhrohhttddusehgmhgrihhlrdgtohhm pdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlheslhhishhtshdrphhoshhtghhrvg hsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 1 Mar 2026 20:52:43 -0500 (EST) Message-ID: <125e4f73-52bc-495c-95ac-7256656cbb80@aklaver.com> Date: Sun, 1 Mar 2026 17:52:42 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Documentation weirdness To: Igor Korot , "pgsql-generallists.postgresql.org" References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/1/26 5:38 PM, Igor Korot wrote: > Hi, ALL, > I'm looking at https://www.postgresql.org/docs/current/sql-createtable.html > and see some weird stuff. > > When I try to search for "PRIMARY KEY" I eventually hit following: > > [quote] > PRIMARY KEY (column constraint) > PRIMARY KEY ( column_name [, ... ] [, column_name WITHOUT OVERLAPS ] ) > [ INCLUDE ( column_name [, ...]) ] (table constraint) > [/quote] What the above is telling you is that PK can be defined as part of the column definition: some_fld some_type PRIMARY KEY or as part of the overall table definition: CREATE TABLE ... some_fld some_type, other_fld other_type' ... PRIMARY KEY (some_fld, other_fld); Look at the top of documentation under: "where column_constraint is:" and "and table_constraint is:" respectively. > > And so according to the documentation one can write: > > CREATE TABLE foo( id SERIAL PRIMARY KEY PRIMARY KEY, ... ); > > which unfortunately will be illegal. > > Or not? > > Thank you. > > -- Adrian Klaver adrian.klaver@aklaver.com