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 1s9zII-006ndK-8P for pgsql-general@arkaria.postgresql.org; Thu, 23 May 2024 03:39:07 +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 1s9zIH-007Ho0-VT for pgsql-general@arkaria.postgresql.org; Thu, 23 May 2024 03:39:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9zIH-007Hnn-KJ for pgsql-general@lists.postgresql.org; Thu, 23 May 2024 03:39:05 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s9zIB-001Yai-U3 for pgsql-general@lists.postgresql.org; Thu, 23 May 2024 03:39:04 +0000 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-5e8470c1cb7so2597558a12.2 for ; Wed, 22 May 2024 20:38:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716435539; x=1717040339; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=O2n6Z/qsFGrCl42NvxVj0mJQphtcGDlnVQuFdUAVQC0=; b=G5XzvDJAqnQNo92frEId6HlpDk9o6rzNkVsYsqPhE+K2G8n8wzFgXIg0oBeYp6O3g5 W+Anfn9nZvzCSqAfDXBr0KuJ1tZOb7bMtdFDswixFpe1HWuzrCaxVg0QQfRNHyLigRhE 4DIkfC2MkRW0VLeScw8d1ANWZTZbT3x/AVz7sBol/0HGMTCgAW4mDQQzhXWcUvSir8EO iHrsvqXigXtC6rutlU2SgUDDO6U8h9vOH6/ny6rZUeYjSy+UVu/pB5Kk+QOTXZIoYllY ptOFc4qJvrjjaH5eNwXHu8SLYmvleFqLTFqMz+lNS+aUndN6z9ETISFogi3OTkvohhYp DYdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716435539; x=1717040339; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=O2n6Z/qsFGrCl42NvxVj0mJQphtcGDlnVQuFdUAVQC0=; b=iytHNLWt7Vm1hBwaAzHSF5V/BtxzrDWhgx4OW5iQswq5LzP0uY5O4GRvDEAwCiBghq YeBqD1L8XlHvWqGAz9Oil5EkSOLBNXpitDsQI5vTVyseuz0k4gqQYULjF0tNTc2Bs28F pxZSy8AyAiAvDU+R9X5NeYgTd3LJlox751ikRRw4iRc77DX5VMISCTEmQzYCUiY0Go8P A6CiP11nStEVmbOHwBjCt78JeNvr2aaDuthB+Nkrha/NVgUTQMqRYZuGC/vYGkOZSDDr rAa0Bkl74wT70XJwWyxSu4lp3jgVKrh1NhlmS+wJ3r1B5Lch27IWBVToccTXkrF91I+W +KPw== X-Gm-Message-State: AOJu0Yz+FP114PG4NK++hV1k4YQYoeeLkYvtoo88FkRBIIHTEAeXRhE3 QSBiViRWyYWBICJM9L3bPEcMkm/+RZaW26TMRGlBM19TSkcyATp1rBXVB2QZ/LPFrsuKfXaV92v NSwDUPJNGH8VNOqZKEjrUBoC9UaPIAg== X-Google-Smtp-Source: AGHT+IEcfsFzbx9tTYyww6P8sU8QC6aBq+hRxF/LdAE9udeLzcg+cf3NVEzrYWaoXyZv2vOY8g/OpPzdSKVfvFWsnKA= X-Received: by 2002:a05:6a21:61d:b0:1a9:5e1f:8485 with SMTP id adf61e73a8af0-1b1f8821a21mr3376901637.31.1716435538523; Wed, 22 May 2024 20:38:58 -0700 (PDT) MIME-Version: 1.0 From: Skorpeo Skorpeo Date: Wed, 22 May 2024 22:38:23 -0500 Message-ID: Subject: Json table/column design question To: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000008dc025061916ca49" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000008dc025061916ca49 Content-Type: text/plain; charset="UTF-8" Hi, I was wondering if having unrelated columns in a table is a sound approach when using json. In other words, if I have two collections of unrelated json objects, for example "Users" and "Inventory", would it be ok to have one table with a "Users" column and a "Inventory" column? My concern is that from a row perspective the columns could be different lengths, such as more inventory items as users. And for any given row the data in one column would have no relation to another column. I would only query a single column at a time. Would this approach be ok or are there pitfalls such that it would be advantageous/recommended to have a separate table for each column? Any thoughts/inputs are greatly appreciated. Many thanks. --0000000000008dc025061916ca49 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I was wondering if havin= g unrelated columns in a table is a sound approach when using json.=C2=A0 I= n other words, if I have two collections of unrelated json objects, for exa= mple "Users" and "Inventory", would it be ok to have on= e table with a "Users" column and a "Inventory" column?= =C2=A0 My concern is that from a row perspective the columns could be diffe= rent lengths, such as more inventory items as users.=C2=A0 And for any give= n row the data in one column would have no relation to another column. I wo= uld only query a single column at a time.

Would th= is approach be ok or are there pitfalls such that it would be advantageous/= recommended to have a separate table for each column?

<= div>Any thoughts/inputs are greatly appreciated.

M= any thanks.
--0000000000008dc025061916ca49--