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 1i0cxi-0003jM-QJ for pgsql-general@arkaria.postgresql.org; Thu, 22 Aug 2019 02:36:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i0cxe-0007ZE-Po for pgsql-general@arkaria.postgresql.org; Thu, 22 Aug 2019 02:36:26 +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 1i0cxe-0007Z6-E2 for pgsql-general@lists.postgresql.org; Thu, 22 Aug 2019 02:36:26 +0000 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i0cxZ-0001Uh-FD for pgsql-general@lists.postgresql.org; Thu, 22 Aug 2019 02:36:26 +0000 Received: by mail-ot1-x32b.google.com with SMTP id w4so4040591ote.11 for ; Wed, 21 Aug 2019 19:36:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=t1b+g2Qm2Q9x1B7TWZDz3xomjNDM7WB+ZgAKLxb8MDE=; b=CjNNxORazLm6wGOcubJD6V3JjaUpV9MBGQVYs7Sy/70KsMSCwL4sb+BXEB+bea0eJs aV6TKG7LnaqOdU6sfv9agznQBiguJliUYY1oBafb04vCOF0EWIWxckNGu1NaERqxjAkg yb5H7rbYiB9bfx7fDdDm02/Iby6m2HSECHte4QgTP0nEOz2JLh3fdcUyHVisf3pBDTLa YTtwUfqj8umoC+Px0eFXeFUneOJV4XxKpqMzZcdQ6Q7v/OUeskg78YtCDqCCfF8g+DlZ p+Onugk2ZyAJ6DlYIkV+8EucBhK6rDonxeD49GC+x3NJP0BOfb7n2tq4cDackUnodGZg /t/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=t1b+g2Qm2Q9x1B7TWZDz3xomjNDM7WB+ZgAKLxb8MDE=; b=mZ5fulxd2Ra4rlgvE5C6R1Z+7y2LTnovQkkJU1tB+/cG15JlPWr80eKulOu+sGJrjN 3F61GT1woNadVPVWqTsAZqnKKGsB22oj6IpuMTyEbrwy27WNHCJ0FZWrw/WUsIPrsKB1 jkEy/n7p7vrEWJ5HUanxx2M/DNU8orZH8dKa+IYtCmyrR5V9/5OX/zCyjADmneHVgtyq xak1Gxgs2dK1eClbXtyr5TzSKNfL7A7+lhzhfSeO69mWWZ8ZJx3+qaKi9S3hNXf8rSPv /1eHUT16xWerLH1oB1voYQWkncV9CSohtAdKlAK9xdw+kLp6o0kDVJw/MxYdYL+d/VKR JSDQ== X-Gm-Message-State: APjAAAWiRjNqLlL6AyVEsMRJdLf41shEUM7QGDPQufFiLlanfqAnBybh Dw7REexsUJIY+vrmh90WwhZLRbkhMfQOsw== X-Google-Smtp-Source: APXvYqw6aJ6tgSM4NIxTgV7UFTOpTzztOWFwxC7BMTmVU9UNFq//mdEYv1y1I4tQniUzlOhOuZ/gHw== X-Received: by 2002:a05:6830:11a:: with SMTP id i26mr15682338otp.324.1566441379179; Wed, 21 Aug 2019 19:36:19 -0700 (PDT) Received: from [192.168.1.10] (ip70-186-126-197.no.no.cox.net. [70.186.126.197]) by smtp.googlemail.com with ESMTPSA id c15sm8170387otf.35.2019.08.21.19.36.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Aug 2019 19:36:18 -0700 (PDT) Subject: Re: Importing from CSV, auto creating table? To: pgsql-general@lists.postgresql.org References: <20190821211530.GA1292@panix.com> From: Ron Message-ID: <3121bdd6-abd8-6bfe-21f8-2a904a7efe96@gmail.com> Date: Wed, 21 Aug 2019 21:36:17 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190821211530.GA1292@panix.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 8/21/19 4:15 PM, stan wrote: > I have a situation where we need to import data, as an interim measure, > from spreadsheets. > > I have read up on \copy and COPY, but I do not see that either of these can > use the header from a CSV file to define a new table. Am I missing > something? Data types.  Sure, you've got column names from the header line, but what types do you assign them? > > Also downloaded something called pgfutter, which I thought would do this, > but have not had any success with this. After I (thought) I had figured out > the arguments, it just seams to hag forever. > > -- Angular momentum makes the world go 'round.