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 1lD5fr-0005Ua-Al for pgsql-admin@arkaria.postgresql.org; Fri, 19 Feb 2021 13:18:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lD5fo-0007mP-4H for pgsql-admin@arkaria.postgresql.org; Fri, 19 Feb 2021 13:18:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lD5fn-0007mI-OO for pgsql-admin@lists.postgresql.org; Fri, 19 Feb 2021 13:18:19 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lD5fg-0002JO-9O for pgsql-admin@lists.postgresql.org; Fri, 19 Feb 2021 13:18:18 +0000 Received: by mail-ed1-x52d.google.com with SMTP id q10so9897678edt.7 for ; Fri, 19 Feb 2021 05:18:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=79WxhuMKqznj9x32VkNYD3vshxycAA2B6yIEMOsjTus=; b=SoMI7GOm6mH9wOM72r/BwXoWNnF6LIXVatmJ2SD3oWYEmVetEPAGSPNhU8FfZkRNKt PEVUkWbSf64TqxVe1/hgPEeDm0O5hVnRSK5UzdD9+3KbPOGxik3wf0hPZ7ci/OREjUnU mdFm4bkjoIwprhqLap++orgD4474Z1tGEfgKZASyyBL3bb730g8HfVFW4ZFadO2eX0V1 fEowJLIwBISCHXx1/1szI1LoPKt+9PL7nvk6zg3Lt2YI5R2U3GfllX4uo7uA0+w9H/om wRoiyhbfvwuqG12d3OS8vmvzfg+lzWOStspPKPsTg56XOMcVu4d+p9O9EGA6oVJLUw6m 8uew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=79WxhuMKqznj9x32VkNYD3vshxycAA2B6yIEMOsjTus=; b=ZilR2qHt3ry1oNObEcGV3A8d3r/lJq09fotbTFW4B8hYELVAhOsMqtIUsbYH2tItS9 sEKnZff1HW4aplEH2n1iuwBK5TSU4p2gw96Zbsv/weUr15gcEwkokhGyZY4+UwmPE+Dj ef4xGKDMtCNADRCX8WtRs+NJd5W6Vcs+cGSZzD0DfEnpFKWT9M8v4rp2/KtrUcGYRafM PNQVgBHd4+ELZXosBCGJGy5dZifUosRLrOfMOZbXPsbbmZ1Dv1Q5BA+KmzpSdjb9x5/8 TEiGzxfQ0MIVFgWw6FwIHT+aWP6pBKL0o7n660IUI8/KjNBTVuXxLjJNj5Xi+RCjv6WH AqQA== X-Gm-Message-State: AOAM5317smXxpEzJsfGvThaIZPwVtJ6DS2VPlr2AqCGSuGUgPh+EycLr p9g9QDNGifiNvyA7x1/BF+qOuA== X-Google-Smtp-Source: ABdhPJyOSPybi2MjlDCNa/EwT7imJfnBMT4c1IQYpOWIsd9w1a9Y92Y2lFd2YIk8rKBXFBDdZkf0ig== X-Received: by 2002:a05:6402:4310:: with SMTP id m16mr9142718edc.207.1613740689950; Fri, 19 Feb 2021 05:18:09 -0800 (PST) Received: from localhost.localdomain (217-149-173-224.nat.highway.telekom.at. [217.149.173.224]) by smtp.gmail.com with ESMTPSA id p2sm4957783edm.94.2021.02.19.05.18.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Feb 2021 05:18:09 -0800 (PST) Message-ID: Subject: Re: Looking find the each row size of table From: Laurenz Albe To: dbatoCloud Solution , pgsql-admin@lists.postgresql.org Date: Fri, 19 Feb 2021 14:18:05 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, 2021-02-19 at 17:58 +0530, dbatoCloud Solution wrote: > I want to find out each row size of a table in PostgreSQL? > I got pg_column_size() function. Could you please someone help me? Will this function return size in KB or MB? If your table rows are several KB in size, you may have a problem. pg_column_size() measures the size in bytes. In my experience the best measure is to create a table, fill it with some 10000 rows and divide the table size by the row count. There is substantial overhead for each row, and there will be overhead and fragmentation on the block level too. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com