Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVOJP-0006fJ-9G for pgsql-hackers@arkaria.postgresql.org; Sat, 30 Dec 2017 21:04:59 +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 1eVOJO-0000Ho-Hf for pgsql-hackers@arkaria.postgresql.org; Sat, 30 Dec 2017 21:04:58 +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.84_2) (envelope-from ) id 1eVOJO-0000Hb-8E for pgsql-hackers@lists.postgresql.org; Sat, 30 Dec 2017 21:04:58 +0000 Received: from 104-190-1-44.lightspeed.sndgca.sbcglobal.net ([104.190.1.44] helo=joeconway.com) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eVOJK-0000ku-TP for pgsql-hackers@postgresql.org; Sat, 30 Dec 2017 21:04:57 +0000 Received: from [72.214.29.243] (account jconway@joeconway.com HELO [192.168.4.41]) by joeconway.com (CommuniGate Pro SMTP 6.1.4) with ESMTPSA id 19445388; Sat, 30 Dec 2017 13:04:53 -0800 Subject: Re: [HACKERS] Re: [HACKERS] generated columns To: Peter Eisentraut , Jaime Casanova Cc: pgsql-hackers References: <1bc948f8-3bab-6c54-50af-c0723a75b85f@2ndquadrant.com> From: Joe Conway Openpgp: id=4EA5B4659ED59CC9538139A5332B7E68B699434A Message-ID: <89e86cfd-6d13-fedc-89ed-268c84e7116f@joeconway.com> Date: Sat, 30 Dec 2017 13:04:52 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1bc948f8-3bab-6c54-50af-c0723a75b85f@2ndquadrant.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7mfjtlXVb3F4nWOEBNaAfFIj42bKjJOva" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --7mfjtlXVb3F4nWOEBNaAfFIj42bKjJOva Content-Type: multipart/mixed; boundary="tw7mOGO7gUBcurarJ56qJdUuvjGGxf2f1"; protected-headers="v1" From: Joe Conway To: Peter Eisentraut , Jaime Casanova Cc: pgsql-hackers Message-ID: <89e86cfd-6d13-fedc-89ed-268c84e7116f@joeconway.com> Subject: Re: [HACKERS] Re: [HACKERS] generated columns References: <1bc948f8-3bab-6c54-50af-c0723a75b85f@2ndquadrant.com> In-Reply-To: <1bc948f8-3bab-6c54-50af-c0723a75b85f@2ndquadrant.com> --tw7mOGO7gUBcurarJ56qJdUuvjGGxf2f1 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 12/27/2017 09:31 AM, Peter Eisentraut wrote: > On 9/12/17 15:35, Jaime Casanova wrote: >> On 10 September 2017 at 00:08, Jaime Casanova >> wrote: >>> >>> During my own tests, though, i found some problems: >=20 > Here is an updated patch that should address the problems you have foun= d. In the commit message it says: "The plan to is implement two kinds of generated columns: virtual (computed on read) and stored (computed on write). This patch only implements the virtual kind, leaving stubs to implement the stored kind later." and in the patch itself: + + The generation expression can refer to other columns in the table, but + not other generated columns. Any functions and operators used must be + immutable. References to other tables are not allowed. + Question -- when the "stored" kind of generated column is implemented, will the immutable restriction be relaxed? I would like, for example, be able to have a stored generated column that executes now() whenever the row is written/rewritten. Joe --=20 Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development --tw7mOGO7gUBcurarJ56qJdUuvjGGxf2f1-- --7mfjtlXVb3F4nWOEBNaAfFIj42bKjJOva Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJaR/90AAoJEDfy90M199hlrLkP+wTunW5k/eVSlsFrTwxX5iQE HEzuqu3tXb1RVzY1ZHcjFs3xRRJUnLmqTuc1ZcHm8EffyjsTO7b89YwQ8nuMkHx6 A3OmtWuVgqmteAbFS3vsyjgGAh2jPCJhI5A3Qf9kvrEl9H44uauk882rKuPZpE1G BewYlWTpJi3t6nkyC4pwNK7RNbLieT0EnWMomfhnaNxUeBxfMLTRoUusn8uHzlN3 4Pm80/WjFoMt8HVyrchGv5iAKppPLP3NPjDc51Q9IRoxaq52BUx/zOp/HQwaJU68 iwmMGQbEDNuvl309ux9yIGnxfDm08ixeLHd5tW/0nidVU3IJmStteZPGXNdQWlqZ j1Jw5ZA8E3lhfGYc450yuX/jwYpvNPXaQenHUIdJi90W7V+geAgeDpqzebqB73U/ Uiwd0yVQ7bm1vUZCnzR6ywC0Ho1EqojLlJwSC8wt8qUX8BFgCPDqtPkZmiWSC1We 4swX/gT4AQfRjY+uRss5U5rBHtxT+nZrKGy3uih2J1GYYUBPrCQ9pw001zQBao5a mlNpen7PKo9swU3KGWsQexk/MUmvXv1Qm1kEbW51m2F9wjvZ2VTTM9aK2mqjMdgh QC7KdCscJajJwQVmVrqTZqeCrN/GRmRNW9U+izCDUA5HKQYtM9vKlMo5LN7nO1V5 zOFTwSvGZ00uUzDKfcF8 =crsO -----END PGP SIGNATURE----- --7mfjtlXVb3F4nWOEBNaAfFIj42bKjJOva--