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 1sHWDp-008XZs-J1 for pgsql-general@arkaria.postgresql.org; Wed, 12 Jun 2024 22:13:37 +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 1sHWDm-008TZU-G1 for pgsql-general@arkaria.postgresql.org; Wed, 12 Jun 2024 22:13:35 +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 1sHWDm-008TZM-5K for pgsql-general@lists.postgresql.org; Wed, 12 Jun 2024 22:13:35 +0000 Received: from mail-oa1-x31.google.com ([2001:4860:4864:20::31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sHWDk-001MIs-3V for pgsql-general@lists.postgresql.org; Wed, 12 Jun 2024 22:13:34 +0000 Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-254e42df409so195849fac.0 for ; Wed, 12 Jun 2024 15:13:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718230411; x=1718835211; 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=fkfk76vYxTr7riUoEEpngT10CFKTRx2eY4DExqLe5lY=; b=RHWStHRkC5rFiWV6mhoNhAjLvOMbc7bZRo4grXTDSWdDwM/QI8LyYMp/K2mRpGi0RB 9IgacDfd1jAV2/IsPvVjgUO+K5aZkBs8py7vsTeJneyNXUK3rg5NhzlK+1RSNrSzoxtQ cJpXStrzz8HtS4Im9HnGhDFrezI1emGSUp2jWTUH8JGJv986Czg78MCDh73nbwClhdJ5 axNr1CxoHO4gA6mZKB2smulfVGWjcgILrktejMbl6rmmrHFtiOrQPnxApghrATuPqL0g oYNNFWtpliBW6ymGKcTx4SAHoeTA0BpXKfLt+Ojq/IjHyfh9qCYDSCB/5PkGjoCA/yBN Xf0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718230411; x=1718835211; 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=fkfk76vYxTr7riUoEEpngT10CFKTRx2eY4DExqLe5lY=; b=eKpFsKMxOHQyRHHcVqYaZkcThBFAwclBUzxlX5Dt6aac6yvjp9kzl2wQDSxnBdaWsv wJRbT/lWrgkW63b43RsDgyM9XvBcNrl9LMtt106/4iJaLmGanmMsh40b2PgxqdZDQLyD Vo/aViCFdjFyivZMQ37rzPaNrfHZezPSHAzCOc46luZWRZbyhw6FHwmHjh9xEcn/NA1/ aWJ2BIPcHtY0kjcQwGmqbWaA1CcwbhwUbIhVdc7d75ld1NZuh2yXBUbUpFIKizBG8TvY 4/fzrULDZ0Ehyj7iwQgbKtVTaZGvcTLinaF9xqzrdmnLjgIxBNWDETAsSyuSbHyjXBdl jHUA== X-Gm-Message-State: AOJu0YxjNhZF0yRhl98oIR7UZIEBz3v1u1fZhQhLDLiJwXHTQonilk6w zVMLC5baTJ3uFiv8gC+G4pf/K3cgDFVUdPUwQ5y0StYonv2qsGw+Me2yKi5A1HtnxP4TJ8wPWz4 T+0OKz+3aOu4q7Iw00bt5fA9KngjP1QL8 X-Google-Smtp-Source: AGHT+IH6bs29LEYr3A+FVCVi7eFIX4GaV8I+ScF/jBXoXN7WkQ8RjKNkeVGPAosQZODwUhh96AfNV6BuLHZjYu94FXo= X-Received: by 2002:a05:6870:b491:b0:254:a1a8:8501 with SMTP id 586e51a60fabf-25514e63172mr3293202fac.43.1718230410803; Wed, 12 Jun 2024 15:13:30 -0700 (PDT) MIME-Version: 1.0 References: <27d9076-c416-7847-7bd-159a5c3ee38a@appl-ecosys.com> In-Reply-To: <27d9076-c416-7847-7bd-159a5c3ee38a@appl-ecosys.com> From: "David G. Johnston" Date: Wed, 12 Jun 2024 15:12:53 -0700 Message-ID: Subject: Re: Definging columns for INSERT statements To: Rich Shepard Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000473fee061ab8b19b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000473fee061ab8b19b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jun 12, 2024 at 2:11=E2=80=AFPM Rich Shepard wrote: > I have > 100 rows to add to a table using INSERT INTO statements. I want > the > PK to be the next value in the sequence. Would this be the appropriate > syntax for the columns to be entered? > The whole point of the server is to parse text and tell you if it has syntax errors and then, if not, execute what you gave it. > INSERT INTO people (person_nbr > DEFAULT('people_person_nbr_seq'),lname,fname,job_title DEFAULT > 'Contact',company_nbr,loc_nbr,direct_phone,cell_phone,email,active > DEFAULT('true')) VALUES > https://www.postgresql.org/docs/current/sql-insert.html Not sure where you got the idea that something besides a plain column name can appear in the optional parentheses after the table name. David J. --000000000000473fee061ab8b19b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Jun 12, 2024 at 2:11=E2=80=AFPM Rich Shepard <<= a href=3D"mailto:rshepard@appl-ecosys.com">rshepard@appl-ecosys.com>= wrote:
I have > 100 rows to add to a table usi= ng INSERT INTO statements. I want the
PK to be the next value in the sequence. Would this be the appropriate
syntax for the columns to be entered?

The= whole=C2=A0point of the server is to parse text and tell you if it has syn= tax errors and then, if not, execute=C2=A0what you gave it.


INSERT INTO people (person_nbr DEFAULT('people_person_nbr_seq'),lna= me,fname,job_title DEFAULT 'Contact',company_nbr,loc_nbr,direct_pho= ne,cell_phone,email,active DEFAULT('true')) VALUES
=


Not sure where you got the idea that somethin= g besides a plain column name can appear in the optional parentheses after = the table name.

David J.

--000000000000473fee061ab8b19b--