Definging columns for INSERT statements

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Definging columns for INSERT statements
Date: 2024-06-12 21:11:30
Message-ID: 27d9076-c416-7847-7bd-159a5c3ee38a@appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

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
( ...

TIA,

Rich

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2024-06-12 21:28:32 UPDATE with multiple WHERE conditions
Previous Message Casey & Gina 2024-06-12 20:46:50 Re: Question about UNIX socket connections and SSL