Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNBJk-0000EN-N9 for pgsql-sql@arkaria.postgresql.org; Sat, 31 Dec 2016 04:30:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cNBJj-0008AA-Qo for pgsql-sql@arkaria.postgresql.org; Sat, 31 Dec 2016 04:30:51 +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 <6220104@qq.com>) id 1cNBIl-000702-3v for pgsql-sql@postgresql.org; Sat, 31 Dec 2016 04:29:51 +0000 Received: from mwork.nabble.com ([162.253.133.43]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from <6220104@qq.com>) id 1cNBIi-0003iw-N7 for pgsql-sql@postgresql.org; Sat, 31 Dec 2016 04:29:49 +0000 Received: from mben.nabble.com (unknown [162.253.133.72]) by mwork.nabble.com (Postfix) with ESMTP id 856665E0D85C for ; Fri, 30 Dec 2016 21:29:48 -0700 (MST) Date: Fri, 30 Dec 2016 21:29:48 -0700 (MST) From: "tank.zhang" <6220104@qq.com> To: pgsql-sql@postgresql.org Message-ID: <1483158588371-5936872.post@n3.nabble.com> Subject: How to use postgresql generated generated always COLUMN ? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.0 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org DB2 operation: db2 "create table emp(id int,name char(10),salary int,rev_salary integer generated always as (salary*50/100))" [db2inst2@db2 ~]$ db2 "insert into emp(id,name,salary) values(100,'asdf',51100)" [db2inst2@db2 ~]$ db2 "select * from emp" ID NAME SALARY REV_SALARY ----------- ---------- ----------- ----------- 100 asdf 500 250 100 asdf 6600 3300 100 asdf 51100 25550 *How to use postgresql implement?* Thank you! -- View this message in context: http://postgresql.nabble.com/How-to-use-postgresql-generated-generated-always-COLUMN-tp5936872.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql