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 1sHXYW-008p69-OJ for pgsql-general@arkaria.postgresql.org; Wed, 12 Jun 2024 23:39:04 +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 1sHXYU-009qwc-Eu for pgsql-general@arkaria.postgresql.org; Wed, 12 Jun 2024 23:39:03 +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 1sHXYT-009qwU-AY for pgsql-general@lists.postgresql.org; Wed, 12 Jun 2024 23:39:02 +0000 Received: from fhigh4-smtp.messagingengine.com ([103.168.172.155]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sHXYP-001NE0-Ih for pgsql-general@lists.postgresql.org; Wed, 12 Jun 2024 23:39:01 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 2B52711401F5; Wed, 12 Jun 2024 19:38:56 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 12 Jun 2024 19:38:56 -0400 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=1718235536; x=1718321936; bh=j5XRAkLRS4TuD8EGBdKNL5KFmTDehPIkF846JQfDNQk=; b= jYk8Ao9x6yb8HcKDS6bV0wsZib3B+/g8o/aVRiPUDniItursverBmEP2UlgbQqCQ v+aNH+2jbh7ejZpCC9QxkRReg+SCGxmJgD+C7ZrGRvaHAvk3pJtU/uxnkPZUFIUn znyHUIHXFSyl63MpYndo5TIDD0w1yh6HyiRVejnLBI/DpJRNAP1aqObp94ih5YaD 5lOPOjzIQj79kT3jEV5DTxDRrDHm9cmqfoQblmBx79Kk6SNRM0xDKqPTIsXv1kLV LHiXsqlirGWhvyNQsbrxUIjPwvAI9e+pIUHT12SMe9RzvzXw7Ii7/iZV008cNpn0 F9mm+lSerDOGkmXwt+e/Ww== 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1718235536; x= 1718321936; bh=j5XRAkLRS4TuD8EGBdKNL5KFmTDehPIkF846JQfDNQk=; b=U UYA3V4NGpEkJRkI5GeTIbMl2mDwrD7KvV3/6xy56CMA7tSvLGxQna8IjPUoa+g5w 1f5jevsAYG+mTnnVy2cjeVEGu25t5iPmIfJ8spvmO1gY0gn8O9iEZNbPRbgP8KhY ZQ6rAnRUenlMdfn24kjJ5nqWouZiA7ZjFXOKSAiEl9DB4gkc3GNTAZ3drEiHIUd0 fP1mcNsK77Z9shBLRE2YU768SBapddYzicFM8BETHwGU5OVaO251HGQSBLSptsA7 mfsZ8Z1D4jHhhV7PFnM09b3IGfWzC5oSKzwNwLGuLgtDv/CMXZq+DnThVCJkvabF xCUXBBtjc8QNPMCJ1c3Ng== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeduiedgtdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthejredttddvjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeekfeehuddvjeeigfeifeejtdduudffledvfeelheef tdeiffeugfdvkeelgedtvdenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhi rghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Jun 2024 19:38:55 -0400 (EDT) Message-ID: <9288042e-9cd3-4121-ab99-459f0fac9f53@aklaver.com> Date: Wed, 12 Jun 2024 16:38:54 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Definging columns for INSERT statements To: Rich Shepard , pgsql-general@lists.postgresql.org References: <27d9076-c416-7847-7bd-159a5c3ee38a@appl-ecosys.com> <92fdd56a-9600-42d6-bee7-5f071f0f0f09@aklaver.com> <61398511-e28d-f9bd-d44-33a69a1c55@appl-ecosys.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: <61398511-e28d-f9bd-d44-33a69a1c55@appl-ecosys.com> 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 6/12/24 16:24, Rich Shepard wrote: > On Wed, 12 Jun 2024, Adrian Klaver wrote: > >> Assuming 'people_person_nbr_seq' is the sequence attached to person_nbr >> and the other DEFAULTs are the column defaults then the syntax would be: >> >> INSERT INTO people >> (person_nbr, lname, fname, job_title, company_nbr,loc_nbr, >> direct_phone, cell_phone,email, active) >> VALUES >> (DEFAULT, 'klaver', 'adrian', DEFAULT, 1, 1, '555-1234', '555-4321', >> 'adrian.klaver@aklaver.com', DEFAULT); >> >> If they are not the column defaults then just supply the literal value. > > Adrian, > > No matter how many postgres docs and web pages I read I didn't find an > example as explicit as yours. Columns other than the person_nbr were not > defined with defaults and I expected to enter them for each row. The 'Examples' section at the bottom of this page: https://www.postgresql.org/docs/current/sql-insert.html is a useful resource. > > Many thanks for another valuable lesson. > > Best regards, > > Rich > > -- Adrian Klaver adrian.klaver@aklaver.com