Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fdKyT-0007xN-1w for pgsql-admin@arkaria.postgresql.org; Wed, 11 Jul 2018 19:40:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fdKyR-0003IB-Co for pgsql-admin@arkaria.postgresql.org; Wed, 11 Jul 2018 19:40:27 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fdKyR-0003Hi-1j for pgsql-admin@lists.postgresql.org; Wed, 11 Jul 2018 19:40:27 +0000 Received: from mail-lf0-x234.google.com ([2a00:1450:4010:c07::234]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fdKyO-0002rL-Ca for pgsql-admin@lists.postgresql.org; Wed, 11 Jul 2018 19:40:25 +0000 Received: by mail-lf0-x234.google.com with SMTP id v22-v6so8724863lfe.8 for ; Wed, 11 Jul 2018 12:40:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=atd1CbAn0JOTGAn08UscsM7b31fzv04PZxHRyk47tG4=; b=XML4tPCsxPRNFqU8AQCHXGduMQ3HynB+Mey5pw4quVb6V9jhRzO3xvXIbGIqgk6Qnq OMfsNdaUndVMTA24iAyVxlfQzuEABpCUh+L76RN6efygyvnSbuGuIlEwRibAG9okFFiF +aOuq3RZB4bpdMJja4mf8IClkXeNgtxXj/5eMrORm7xss1S3Jsi47R2VgI2zfo+4e7LN 2nlSwmO+8krYQuMJLL8XOrvxB9FBbYxml70xDFoKQN3QTRxUSQzTkxKsH6zxRIqZKEKR ERSgr5P+iwTiRMU289z7Fr0dpkPdeByyotfKeTbBjwBb6MNhyCUSgAmbw77DRKs9Buaj 5qnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=atd1CbAn0JOTGAn08UscsM7b31fzv04PZxHRyk47tG4=; b=ggb3qMYLMEqYTBrFltA0HQNoMb46zAEfRceqBmOmKLm+/au/Sn/o6uEg5mfKTUhpOi WGa0ArRbPPN2N3pYqVbU6YyS1j91+7u7zWLtQKRtNwtByzW31TIUPMAodmUpPmC4qBeL VqMw0jdG5YNndk/pCac0bPkm3nWj7TIP78gAv0Ktbo9f0QNTPK+h1MctaHtjtEJzp3ko qTcrir9dyqXmMSFeDEa3G7KxH8zdn4yiKO0fY+5k1UO/S2Y46YV9bWRLNFaPADCmn8nB n5pV/3ypw+nMgJ/171wA2GrWJ6t78NSyENaQE2Vha6jf5VA0zi3ti1j0tmJUgVLvyDwh j9Mw== X-Gm-Message-State: APt69E1hQibtSS4Gcc9GESYlVjODjDj3GVbz03rBhe7+9HlhwE9iHfZQ ARbXZQl2smCqKngxThsqSOxYd4OLrGziRvVxkbVkJA== X-Google-Smtp-Source: AAOMgpen5arhruQJJmHbeJ3oTnbshGDILganAo1fpmfjn6T6S5kjg8aDXPiRrdICC2btfyGeRwzIIalLbijHPoVRxxY= X-Received: by 2002:a19:8f8f:: with SMTP id s15-v6mr7149576lfk.96.1531338021486; Wed, 11 Jul 2018 12:40:21 -0700 (PDT) MIME-Version: 1.0 Sender: ethervoid@gmail.com Received: by 2002:a19:c755:0:0:0:0:0 with HTTP; Wed, 11 Jul 2018 12:40:21 -0700 (PDT) In-Reply-To: <28785.1531325858@sss.pgh.pa.us> References: <19464.1531320028@sss.pgh.pa.us> <28785.1531325858@sss.pgh.pa.us> From: Mario de Frutos Dieguez Date: Wed, 11 Jul 2018 21:40:21 +0200 X-Google-Sender-Auth: puBbr2sOdTv_iWlXUoIX724hu3E Message-ID: Subject: Re: row is too big: size 8168, maximum size 8160 To: Tom Lane Cc: pgsql-admin@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I've been able to solve it reducing the precision of the data inside the columns to 2 decimals. The original data was stored as integer, I was putting much more data inside adding precision that wasn't needed :) Thank you for your responses :) 2018-07-11 18:17 GMT+02:00 Tom Lane : > Mario de Frutos Dieguez writes: >> Thank you for your quick answer. We have to think if we can rearrange it. >> The funny thing is that we have the same number of columns for other >> tables which are the same except for stored geometries and those >> stores the information without any problem. >> That's why I thought maybe is a corruption thing or something > > No, it's just too many columns. If we suppose that the average width of > your numeric columns is 12 bytes, then you need 790*12 = 9480 bytes, > which doesn't fit on an 8K page even without any accounting for row > header and page header overhead. TOAST can't help by pushing values > out-of-line, because a TOAST pointer is 18 bytes so it'd actually make > things worse. (TOAST works well for individual large fields, but not > at all for this case.) > > You can get away with 790 columns if they're 4 or 8 bytes apiece, or if > many of them are NULL, but evidently these particular numeric values > average more than that. > > In practice, though, there are a lot of other inefficiencies with > tables that have so many columns. So I counsel looking into arrays > or some other approach. > > regards, tom lane >