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 1sHqrD-00BChv-Ag for pgsql-general@arkaria.postgresql.org; Thu, 13 Jun 2024 20:15:39 +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 1sHqrA-007Cye-1H for pgsql-general@arkaria.postgresql.org; Thu, 13 Jun 2024 20:15:36 +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 1sHqr9-007Cy4-MA for pgsql-general@lists.postgresql.org; Thu, 13 Jun 2024 20:15:36 +0000 Received: from mail-oo1-xc2c.google.com ([2607:f8b0:4864:20::c2c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sHqr8-001AnW-2K for pgsql-general@lists.postgresql.org; Thu, 13 Jun 2024 20:15:35 +0000 Received: by mail-oo1-xc2c.google.com with SMTP id 006d021491bc7-5bad217c51aso803576eaf.1 for ; Thu, 13 Jun 2024 13:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718309733; x=1718914533; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+zx8K6Hm+Ou1GpaXjg50StNG29e4m8Ooecb/+gOjmck=; b=euiMcro8voBj04arkrcN2S3SxzVZHEgBKlJV5iOk4YGIL3vH+Mh6+l/LXW8vfapOES XTj6JHOpxO+t5UlYRIllUbe6Hre8haZR/JPlStPPoH/FgpZuG5rv/Mi3sGukAGlgXzhf iy07y+sPi/EZ3kGHWxoEpYamQGo5aRJvGr12DBMJaV2L6KgthLOjey/cv0BGH2CneLwP qkznB8KUY5q58rMUIvwy47b34dqqNb2jraMM5Fot2sEydGGu49qQJ/7e1Z4zVCuSecdC 6nGqHSaioZuccn3kYsElsUSTbt2fpYn2mCElnsinYbgq753l833UFEsolCBsr42R+Sk1 Lq9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718309733; x=1718914533; h=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=+zx8K6Hm+Ou1GpaXjg50StNG29e4m8Ooecb/+gOjmck=; b=DGHlz+q4B4mooWf2llip7Gfu1J7wVQDps2Ljrc1EPT63513WYKcwhie4QNsNQNnlhq ovz8hYjeJRk7VtPcwn41OjQsuTdRLvL2S3sEV5UGj8xsqOyhPKvT8V0toLreimWHehya HZ0VTHYWNm8hYejVC5oaLAd4Plkyl+OQVYLAIMaNlgLJ1SBvCmOadsXL8E8gl6DLBucJ rIfwpQhxx4Or5CqkSYz8QfXJKl2Ky0bn7amVkmW0qixeQ9TB2grFXN4FlAqWuL40TEnS TXNmwwL/P9S3E+gLBNXe8FLJbXfW96LUg30lvLnUkxXItBM2gfYpzMJCcr8rT84RtVcx QYaA== X-Gm-Message-State: AOJu0YxIN6gUQxqp4u7Oxhy0ep4v/SdWJyNUeJa7U3P8Nn7JQ/Re9l+f 3d4D9rN3hmsEFzcMPE5qnDqdidDSbnciZgcPta/M73HmTR+Tj57mNEnquGReOnbugnzEFkacIIV JkBC240Tfmrx8zj6eL9eGufMd7IlBRg== X-Google-Smtp-Source: AGHT+IGkFlT+2UAQkBZbY198FeHRht64SIy8s1lkWFUTHqlDW75ypAT5DzjD65iaHpWw33XPc/vO9NWp7n2GETAEXFU= X-Received: by 2002:a05:6820:220a:b0:5ba:ff5a:be1 with SMTP id 006d021491bc7-5bdadcb2f58mr679222eaf.9.1718309733374; Thu, 13 Jun 2024 13:15:33 -0700 (PDT) MIME-Version: 1.0 References: <387fa6c2-5de-f24-d522-46282597703@appl-ecosys.com> <1b139d9a-b95f-f7c8-52fb-9d7442c69ad9@appl-ecosys.com> <97d69b9-48de-3bd4-95d-df5614ff44a@appl-ecosys.com> In-Reply-To: <97d69b9-48de-3bd4-95d-df5614ff44a@appl-ecosys.com> From: "David G. Johnston" Date: Thu, 13 Jun 2024 13:14:56 -0700 Message-ID: Subject: Re: Reset sequence to current maximum value of rows To: Rich Shepard Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000045a5ac061acb29d9" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000045a5ac061acb29d9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jun 13, 2024 at 12:57=E2=80=AFPM Rich Shepard wrote: > INSERT into companies (company_nbr,company_name,industry,status) VALUES > (DEFAULT,'A new company name', 'Manufacturing',DEFAULT); > > Yesterday, before learning to use DEFAULT for the company_nbr PK I entere= d > all rows using company_nbr 2342-2391. This morning, after running the > single-line INSERT command company numbers from 2341-2392 all had 'A new > company name' as the company_name. > > There is no way, in the absence of a user trigger, that the above insert command changed pre-existing rows. And if you cannot reproduce the behavior you claim to have seen I will continue to just assume you have faulty memory. David J. --00000000000045a5ac061acb29d9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Jun 13, 2024 at 12:57=E2=80=AFPM Rich Shepard <= rshepard@appl-ecosys.com>= ; wrote:
INSERT into companies (company_nbr,company= _name,industry,status) VALUES
(DEFAULT,'A new company name', 'Manufacturing',DEFAULT);
Yesterday, before learning to use DEFAULT for the company_nbr PK I entered<= br> all rows using company_nbr 2342-2391. This morning, after running the
single-line INSERT command company numbers from 2341-2392 all had 'A ne= w
company name' as the company_name.


<= div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif= ">There is no way, in the absence of a user trigger, that the above insert = command changed pre-existing rows.=C2=A0 And if you cannot reproduce the be= havior you claim to have seen I will continue to just assume you have fault= y memory.

David J.

--00000000000045a5ac061acb29d9--