Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jbuw2-0006RL-27 for pgsql-general@arkaria.postgresql.org; Thu, 21 May 2020 23:49:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jbuw0-00023C-TX for pgsql-general@arkaria.postgresql.org; Thu, 21 May 2020 23:49:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jbuw0-000234-LS for pgsql-general@lists.postgresql.org; Thu, 21 May 2020 23:49:08 +0000 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jbuvy-0007Ju-Ld for pgsql-general@lists.postgresql.org; Thu, 21 May 2020 23:49:08 +0000 Received: by mail-pg1-x530.google.com with SMTP id f21so1110838pgg.12 for ; Thu, 21 May 2020 16:49:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:in-reply-to:message-id:date :mime-version; bh=LzNHlrbghfl/i0vEz8xhnxMoZKBClDmbxn1hKOFmjjc=; b=alZpTa4aN/GAmwlR7qHnWbuvTTF81wX1iRb1Zny4H1c3MAgnUTGSha6GGFlSKenqeC Xe3bWHGH3zkijrVrL0olBUOs5VGfNY7LDi4P/1SWF7K8rCCemuSbjG8xlY/BvgXv4Nrh eC2Ip2xwHeu0EhLWWr9jwkcbs/EgODe4ZNweaCEYGeVxh6OPFG+cTlde1vKp6b7rr8xv Sy8gT88b3s8KlZX3P/EKfR8ipKk7sXEoIeTORG7TsLeFleqgVJL0qvhq0uDVRye7VRYB 8B3/bJtmMC0BY+uy2cVXp5qbcRNkod9LllL9qGikmdd+9jxvGT4PQvG2oM5BkQ5L2BJK xSQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject :in-reply-to:message-id:date:mime-version; bh=LzNHlrbghfl/i0vEz8xhnxMoZKBClDmbxn1hKOFmjjc=; b=cwJ/8sjKK1vMCDkRfwJ/lGBXHG6fMHlW50TF9/2DKC6YqqQw4VMplByausJOxD18pC BsdlXGHqkisMIED/UQOB8iWrwpG64t8PnzbVEb/ZSd8Fy6704Q9q0oZYnawc6Q/NocvJ b+NMfCoAyk3sqlBxb7cvx361CyRrwT3IUGxR73fmG9rsaJwC4NFQx9cNQY1x1LtHS5Z0 C+dL5x3mVtjKaBaXPKgDKvqgvBrYxdZgc8SVVpA+ecA+2xee8yqt2glJ8AIBAfo1cb/z 9f9FZJAEh/6f/fTyi7ZlNEj/fWG6bH9tPhOuPZMDs/AH2Jo8GhQDazOKmCFO19L1Mvxb 5/AA== X-Gm-Message-State: AOAM533dCeGuacBlXTxof+hgh8I7umNomQdqkOB8zL5zM8tOn32qZICR 4A4FacBO2A6eM38H5hotpoYkwtdm X-Google-Smtp-Source: ABdhPJzVmfGNxhkTV6QRRtqccFkPJdvQMifSGYIqTtTssEZVC6Sp6qvn7B4IKBIz1DgDHptRBlhI1A== X-Received: by 2002:a63:711b:: with SMTP id m27mr10957044pgc.324.1590104944423; Thu, 21 May 2020 16:49:04 -0700 (PDT) Received: from tim-desktop (220-235-167-75.dyn.iinet.net.au. [220.235.167.75]) by smtp.gmail.com with ESMTPSA id i25sm5515027pfd.45.2020.05.21.16.49.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 16:49:03 -0700 (PDT) References: <20200521153742.GA2989@panix.com> User-agent: mu4e 1.4.6; emacs 27.0.91 From: Tim Cross To: pgsql-general@lists.postgresql.org Subject: Re: Should I use JSON? In-reply-to: <20200521153742.GA2989@panix.com> Message-ID: <87pnawrgr8.fsf@gmail.com> Date: Fri, 22 May 2020 09:48:59 +1000 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk stan writes: > Worming on a small project, and have been doing a lot of Perl scripting to > parse various types of files to populate the database. Now I need to get > data from a cloud services provider (time-keeping). They have a REST API > that returns data in a JSOSN format. > > So here is the question, should I just manually parse this data, as I have > been doing to insert into appropriate entities into the database? Or should I > insert the JSON data, and use some queries in the database to populate my > tables from the JSON tables? Given you plan to store your data in 'normal' tables and you are already using a scripting language to get the data from the remote API and your already processing data in various forms using Perl, I would not bother. All you will really do is add another layer of complexity and skill requirement (i.e. JSON in the database and writing JSON queries using PG's SQL JSON support). -- Tim Cross