Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gIBZj-0007VM-4G for pgsql-admin@arkaria.postgresql.org; Thu, 01 Nov 2018 11:55:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gIBZg-0007CE-Th for pgsql-admin@arkaria.postgresql.org; Thu, 01 Nov 2018 11:55:44 +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.89) (envelope-from ) id 1gIBZ2-0004fl-Mm for pgsql-admin@lists.postgresql.org; Thu, 01 Nov 2018 11:55:04 +0000 Received: from pv35p18im-ztdg05101101.me.com ([17.133.188.44]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gIBZ0-00069N-4x for pgsql-admin@lists.postgresql.org; Thu, 01 Nov 2018 11:55:03 +0000 Received: from process-dkim-sign-daemon.pv35p18im-ztdg05101101.me.com by pv35p18im-ztdg05101101.me.com (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) id <0PHI00700J3E7D00@pv35p18im-ztdg05101101.me.com> for pgsql-admin@lists.postgresql.org; Thu, 01 Nov 2018 11:54:56 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1541073296; bh=WPo1SHffVgOyNUPR+u1OO+sc8YfP/PHbyCakKvwOAgA=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=oS9dKJYeaVbO1ZIKOX4QTLaVVU+SEPhVxVXfBMX7GVqIMzSGg9HB6Ibk5Y5RguX83 7/ghmMuypO6A9dkn7z3ow+vJ2qMq7np6mvAgUfSB+bEbax/ihPK+nwOAf5bPvv7fnR vhjqnoZY/OPHiclbb9Xz0UOh1YHmCLgYFefau9/O7Yf2qwenzPZDhps9Xz8NzborxX RiFeNbmIFaeFRQ3HmuOaK6ebIfLS7grWJeLrA0+Zzb77LkdhR2BlsYhugn1cpMjczz L09lgY6m+wJLXgspuLjXtc9rLF1pvhJRplZfKBdNRMM3ovoDuATJ4AlqStDC+FYS/D XM5JitjC+Egmg== Received: from icloud.com ([127.0.0.1]) by pv35p18im-ztdg05101101.me.com (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPSA id <0PHI00L86JRF5R00@pv35p18im-ztdg05101101.me.com>; Thu, 01 Nov 2018 11:54:54 +0000 (GMT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=895 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811010106 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-11-01_08:,, signatures=0 Content-type: multipart/alternative; boundary=Apple-Mail-02B63D9A-7742-436E-9504-C81C8A6E15D9 MIME-version: 1.0 (1.0) Subject: Re: change bigint column to int From: Evan Bauer X-Mailer: iPhone Mail (16A404) In-reply-to: Date: Thu, 01 Nov 2018 07:54:50 -0400 Cc: pgsql-admin@lists.postgresql.org Content-transfer-encoding: 7bit Message-id: <117C35AF-8395-4D7F-842B-A63B7141269B@mac.com> References: To: Mariel Cherkassky List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail-02B63D9A-7742-436E-9504-C81C8A6E15D9 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mariel, Just run a query and make certain that all values currently stored in the co= lumn fit in 4 bytes (+/- 2,147,483,648) before doing the ALTER. Cheers, Evan Sent from my iPhone > On Nov 1, 2018, at 06:20, Mariel Cherkassky w= rote: >=20 > Hi, >=20 > I want to change the column type from bigint to int to save space. By doin= g so, does it include some risks ? As I see it, I should only run vacuum ful= l afterwards if I want to return space to the os right ? >=20 --Apple-Mail-02B63D9A-7742-436E-9504-C81C8A6E15D9 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mariel,

Just run a query= and make certain that all values currently stored in the column fit in 4 by= tes (+/- 2,147,483,648) before doing the ALTER.

Cheers,

Evan

Sent from my iPhone<= /div>

On Nov 1, 2018, at 06:20, Mariel Cherkassky <mariel.cherkassky@gmail.com= > wrote:

Hi,

I want to change the column type from bigint to int to save space. B= y doing so, does it include some risks ? As I see it, I should only run vacu= um full afterwards if I want to return space to the os right ?

= --Apple-Mail-02B63D9A-7742-436E-9504-C81C8A6E15D9--