Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQrC1-0001rp-6o for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Dec 2017 08:54:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQrC0-0006eg-QL for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Dec 2017 08:54:36 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eQrC0-0006eW-Ev for pgsql-hackers@lists.postgresql.org; Mon, 18 Dec 2017 08:54:36 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eQrBx-00021B-SK for pgsql-hackers@postgresql.org; Mon, 18 Dec 2017 08:54:36 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 0542621C045E; Mon, 18 Dec 2017 11:54:32 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from wp.localdomain (gw.postgrespro.ru [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id A4DE721C042B; Mon, 18 Dec 2017 11:54:31 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1513587271; bh=XV3BEo9l+rf2exIWYnGsuUIthUThs9qUeUt2QPh7wpw=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=HXb/CfAKEQ6GC52kFhWNxUs0JuJAFsph+nOjAkS+QvT4lLnY4el4mb5nThvakE4cn ODmn/BNs94jUHYPWXrqm6H2rTnhPvrMMYRCf73qG2f1AXqcKo3MmyKycFbxlTQw3G+ esmtEqJkVL9oeEsE6fr366j3YZMm5f3/EJTCXFxo= Date: Mon, 18 Dec 2017 11:54:31 +0300 From: Ildus Kurbangaliev To: Robert Haas Cc: Alexander Korotkov , Tomas Vondra , Alvaro Herrera , =?UTF-8?B?0JXQstCz0LXQvdC40Lkg0KjQuNGI0LrQuNC9?= , Andres Freund , Oleg Bartunov , Craig Ringer , Peter Eisentraut , PostgreSQL Hackers , Chapman Flack Subject: Re: [HACKERS] Custom compression methods Message-ID: <20171218115431.2b3e29ba@wp.localdomain> In-Reply-To: References: <20171201194859.le5hvnnrjzhxhm2t@alvherre.pgsql> <20171206180716.75ba9ba9@postgrespro.ru> <20171211155555.05ddd2fc@postgrespro.ru> <20171213151818.75a20259@postgrespro.ru> Organization: Postgres Professional X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 14 Dec 2017 10:29:10 -0500 Robert Haas wrote: > On Wed, Dec 13, 2017 at 7:18 AM, Ildus Kurbangaliev > wrote: > > Since we agreed on ALTER syntax, i want to clear things about > > CREATE. Should it be CREATE ACCESS METHOD .. TYPE =D0=A1OMPRESSION or > > CREATE COMPRESSION METHOD? I like the access method approach, and it > > simplifies the code, but I'm just not sure a compression is an > > access method or not. =20 >=20 > +1 for ACCESS METHOD. An access method then. >=20 > > Current implementation > > ---------------------- > > > > To avoid extra patches I also want to clear things about current > > implementation. Right now there are two tables, "pg_compression" and > > "pg_compression_opt". When compression method is linked to a column > > it creates a record in pg_compression_opt. This record's Oid is > > stored in the varlena. These Oids kept in first column so I can > > move them in pg_upgrade but in all other aspects they behave like > > usual Oids. Also it's easy to restore them. =20 >=20 > pg_compression_opt -> pg_attr_compression, maybe. >=20 > > Compression options linked to a specific column. When tuple is > > moved between relations it will be decompressed. =20 >=20 > Can we do this only if the compression method isn't OK for the new > column? For example, if the old column is COMPRESS foo PRESERVE bar > and the new column is COMPRESS bar PRESERVE foo, we don't need to > force decompression in any case. Thanks, sounds right, i will add it to the patch. --=20 --- Ildus Kurbangaliev Postgres Professional: http://www.postgrespro.com Russian Postgres Company