Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hTSSR-00057T-7B for pgsql-general@arkaria.postgresql.org; Wed, 22 May 2019 14:43:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hTSSQ-0000z5-0r for pgsql-general@arkaria.postgresql.org; Wed, 22 May 2019 14:43:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hTSSP-0000yy-KI for pgsql-general@lists.postgresql.org; Wed, 22 May 2019 14:43:05 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hTSSN-0004Zu-3j for pgsql-general@lists.postgresql.org; Wed, 22 May 2019 14:43:04 +0000 Received: by mail-pl1-x630.google.com with SMTP id w7so1194570plz.1 for ; Wed, 22 May 2019 07:43:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=k+tXeQGyl3HSBxOddWvM8vETgVTrpubj9+PRZ8PYoio=; b=cVPa3awO7lOxJGgRRXDZGFrTOZg+Mr7tnVMYkv5wXwVeTxAOWDSmge82RHAkQNsqeA bU5lXDIHxJZ+Qlv4JuC29x55EBsqKzDO2igKQhvGTUOhwELdoUgPnV920kOP+QY7iCxm SQmi08DhKRoZIoIudP50F26BWRVMgiQaglUWrH1JWg+IeghgfSXVBqewRnI+N4fONs/0 bK1el6IVAQBQeiwXTDqeA5QlWVny1Mfeu0HO8g6vMrn6JKiOwJrqEJFTa+8/nLqnJbQ0 q1Lo4wdazLBQmtGi2NUschLIsYWDa7JFGp5ZAKPeZ5BD7axg8O0huoV7i6ru+1nx05Ay GzUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=k+tXeQGyl3HSBxOddWvM8vETgVTrpubj9+PRZ8PYoio=; b=pH4vAWXRFcnAL0CT/I8FV7GeSZHqFSPjj3eiL6tQGN2UGnK2jpTnVxhz5E/v/4lD5T 5n+jW7Kp5DgbdxhmxAFRq/RtvEraPlTnn+8TyVVnQ1jM0TVOllNmlYyKyNqR/nZfM7/5 JeHVDmuttFoizJ+kFm/E/eFjrIjAElaZdR7uTAMjyQxlebCGIB3Jzs504v+i4ZXHkZOC rhWraesw0UHPjbguRPj8dZzTQpsCLh1S6oua50z82MWLsl4/k2ZeeOujmZuOay8rnKCy eQUAXM/C8aNDUYLdLTdy0xW0rA9ewN7JSqO+aJ9kHltQFwa0+fUNW+ECEKHAX0aay2Ij gxrw== X-Gm-Message-State: APjAAAUamj+Gg1fDV9vIzmSd0F4JMc62ICWV73sNpc0LmmwLQVNt2Rwf iVGquRvoUknZpA02BkOcl0o= X-Google-Smtp-Source: APXvYqzDrVm56Vbd6zrqZ4+Qs5ZNHT1N/AcibTWJGE9ubbERb79EZzI/49fVMR9NT3w4vGpvGwvq8A== X-Received: by 2002:a17:902:4383:: with SMTP id j3mr91178887pld.320.1558536180345; Wed, 22 May 2019 07:43:00 -0700 (PDT) Received: from [172.31.98.140] ([96.77.187.156]) by smtp.gmail.com with ESMTPSA id 63sm35728681pfu.95.2019.05.22.07.42.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 07:42:59 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: Bulk inserts into two (related) tables From: Rob Sargent In-Reply-To: Date: Wed, 22 May 2019 08:42:58 -0600 Cc: "pgsql-generallists.postgresql.org" Content-Transfer-Encoding: 7bit Message-Id: <4500008F-90D1-4204-BCC6-D0E593DD3A18@gmail.com> References: To: Rich Shepard X-Mailer: Apple Mail (2.3445.104.11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > > Each row in the source file (exported from the spreadsheet as .csv and > renamed to .txt for processing in emacs and awk) is a mixture of attributes Absolutely no need to rename the .csv for those tools. > that belong in either or both of the organization and people tables in my > database. An awk script will extract the appropriate fields for each table.