Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hR1FZ-00041L-52 for pgsql-general@arkaria.postgresql.org; Wed, 15 May 2019 21:15:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hR1FX-0002j4-WB for pgsql-general@arkaria.postgresql.org; Wed, 15 May 2019 21:15:43 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1hR1FW-0002iC-VD for pgsql-general@lists.postgresql.org; Wed, 15 May 2019 21:15:43 +0000 Received: from mail-oln040092000095.outbound.protection.outlook.com ([40.92.0.95] helo=NAM01-BN3-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hR1FT-0002l0-PL for pgsql-general@lists.postgresql.org; Wed, 15 May 2019 21:15:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UV2Ei4zdIrkVRJG5k3aiVSLxLoIipGW/ut5tfN5Xy7I=; b=sxPYmZhla2tzdFlUXUr2kxlg7jc7vawYoZwvLwYZCJTKJaeT26dG6lv5iIt8T24mjfzedZbJQmcRRRPvrXKa7FZ41NEzr+SF1wjKNT0aGQxWJ7C5tGJi9+HXjXkz3t82WMY8SL2ofGGVImXjtFy5TJQcXwGae7Az5tU0deoLzhbLCRGLoBnUvIE6gJyx940PXXCOSu6rEJ0J+hseF+IoYR3RyxunhrRaEFRbOaqp3IzMWyJr3HQK0FsekYtzdlFgqL/ioI5QCccSgcD6IEO0gPyve7O0H2gErwTjXFKFU+jcX56/9sCV9/1gWHrgl8E7NzoHRM+tMR8ZtfnV1fzLUw== Received: from BY2NAM01FT006.eop-nam01.prod.protection.outlook.com (10.152.68.52) by BY2NAM01HT142.eop-nam01.prod.protection.outlook.com (10.152.68.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.11; Wed, 15 May 2019 21:15:36 +0000 Received: from BYAPR08MB5014.namprd08.prod.outlook.com (10.152.68.56) by BY2NAM01FT006.mail.protection.outlook.com (10.152.68.230) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.11 via Frontend Transport; Wed, 15 May 2019 21:15:36 +0000 Received: from BYAPR08MB5014.namprd08.prod.outlook.com ([fe80::d9fb:bca2:3018:3513]) by BYAPR08MB5014.namprd08.prod.outlook.com ([fe80::d9fb:bca2:3018:3513%5]) with mapi id 15.20.1900.010; Wed, 15 May 2019 21:15:36 +0000 From: Julie Nishimura To: Adrian Klaver , "David G. Johnston" CC: "pgsql-general@lists.postgresql.org" Subject: Re: default_tablespace in 8.3 postgresql Thread-Topic: default_tablespace in 8.3 postgresql Thread-Index: AQHVC1LRf5EjIXLPnkq3LH4ZEkrRWqZsl38AgAAAObeAAAmfAIAAB4T0gAAF7oCAAABqdw== Date: Wed, 15 May 2019 21:15:36 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:6248A819403108B2DA10E8DBFB9A7A8A9E5FFADAC3F2CDDA3E2E6FFB17089619;UpperCasedChecksum:6CCC40BC8579616BC35674E3F41773CB1060EBFC89DC25C3343AFA74B37164DD;SizeAsReceived:7242;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [7L13Jkk2gPyaC2TFymwjAEBz2XGfgs7r] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(5050001)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031323274)(2017031324274)(2017031322404)(1601125500)(1603101475)(1701031045);SRVR:BY2NAM01HT142; x-ms-traffictypediagnostic: BY2NAM01HT142: x-microsoft-antispam-message-info: FtDKd2kNA21CW3b8eMCDEAXtt/KGqnyaew15QHT8cpsKXBB0gGTQqDgPobQD7C00NN7GJ+rN5FJHAZVjXMVoAweddIaDjgDdsfXbK+EiJq/LkSEl9pQp+whjjn668jc+4bpeGBGXMoTrjWeJbsZGZ/jv4J+zxbvPN5UCNFmM0YUVW4P+AzHN/O43+/UiXNZv Content-Type: multipart/alternative; boundary="_000_BYAPR08MB50144C4CA7DAE9B80BB3ACE5AC090BYAPR08MB5014namp_" MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 0f0b763c-c43a-4df6-f326-08d6d97a7985 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 May 2019 21:15:36.6643 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2NAM01HT142 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_000_BYAPR08MB50144C4CA7DAE9B80BB3ACE5AC090BYAPR08MB5014namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sure, thank you guys! CREATE TABLESPACE vol4 OWNER postgres LOCATION '/data/vol4'; ALTER DATABASE tables_ericb SET default_tablespace =3D 'vol4'; ALTER DATABASE conversion_feasibility_too SET default_tablespace =3D 'vol4'; ... and so on for 60 dbs... but not for all 70+ ________________________________ From: Adrian Klaver Sent: Wednesday, May 15, 2019 2:11 PM To: Julie Nishimura; David G. Johnston Cc: pgsql-general@lists.postgresql.org Subject: Re: default_tablespace in 8.3 postgresql On 5/15/19 1:57 PM, Julie Nishimura wrote: > This puzzles me too! I found that bizarre myself. What is even more > interesting, we have about 80 databases, and all of them now have > default_tablespace=3Dvol4, except only one - "control" database. The only > explanation I would have that all of those databases which have > tablespace vol4 as default were copied from template1 without explicitly > specified tablespace name... > > postgres=3D# select * from pg_database limit 10; > datname | datdba | encoding | datistemplate | > datallowconn | datconnlimit | datlastsysoid | datfrozenxid | > dattablespace | datconfig | datacl > -----------------------------+--------+----------+---------------+-------= -------+--------------+---------------+--------------+---------------+-----= ----------------------+----------------------------------------------------= - > template0 | 10 | 0 | t | f > | -1 | 11510 | 378 | 1663 > | | {=3Dc/postgres,postgres=3DCTc/postgres} > postgres | 10 | 0 | f | t > | -1 | 11510 | 7554523 | 1663 > | | > control | 16389 | 6 | f | t > | -1 | 11510 | 7554887 | 16384 > | {default_tablespace=3Dvol1} | {=3DT/dba,dba=3DCTc/dba,oper=3Dc/dba,nagi= os=3Dc/dba} > template1 | 10 | 0 | t | t > | -1 | 11510 | 7554847 | 16384 > | {default_tablespace=3Dvol4} | {=3Dc/postgres,postgres=3DCTc/postgres} > conversion_alerts_fs | 16393 | 0 | f | t > | -1 | 11510 | 7554847 | 16384 > | {default_tablespace=3Dvol4} | > {=3DT/build,build=3DCTc/build,tableau_readonly=3Dc/build} > conversion_feasibility_too | 16393 | 0 | f | t > | -1 | 11510 | 7554847 | 16384 > | {default_tablespace=3Dvol4} | > conversion_feasibility_tool | 16393 | 0 | f | t > | -1 | 11510 | 7554847 | 16384 > | {default_tablespace=3Dvol4} | > custom_searches_au | 16393 | 6 | f | t > | -1 | 11510 | 7554847 | 16384 > | {default_tablespace=3Dvol4} | > {=3DT/build,build=3DCTc/build,tableau_readonly=3Dc/build} > > I've found that very bizarre myself, that default_tablespace would be > changed for already existing databases without me altering it explicitly.= .. > Sigh Can we see an example of the script you used to modify the databases? > ------------------------------------------------------------------------ > *From:* David G. Johnston > *Sent:* Wednesday, May 15, 2019 1:23 PM > *To:* Julie Nishimura > *Cc:* Adrian Klaver; pgsql-general@lists.postgresql.org > *Subject:* Re: default_tablespace in 8.3 postgresql > On Wed, May 15, 2019 at 1:01 PM Julie Nishimura > wrote: > > However, since I have modified template1 (and most likely, those > databases were copied from it in the past), it changed > default_parameter for them as well. > > > This seems unlikely to be the case - changing template1 should not be > affecting other existing databases. > > David J. > -- Adrian Klaver adrian.klaver@aklaver.com --_000_BYAPR08MB50144C4CA7DAE9B80BB3ACE5AC090BYAPR08MB5014namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Sure, thank you guys!

CREATE TABLESPACE vol4
 OWNER postgres
 LOCATION '/data/vol4';

ALTER DATABASE tables_ericb
SET default_tablespace =3D 'vol4';
 ALTER DATABASE conversion_feasibility_too
 SET default_tablespace =3D 'vol4';

... and so on for 60 dbs...

but not for all 70+


From: Adrian Klaver <a= drian.klaver@aklaver.com>
Sent: Wednesday, May 15, 2019 2:11 PM
To: Julie Nishimura; David G. Johnston
Cc: pgsql-general@lists.postgresql.org
Subject: Re: default_tablespace in 8.3 postgresql
 
On 5/15/19 1:57 PM, Julie Nishimura wrote:
> This puzzles me too! I found that bizarre myself. What is even more > interesting, we have about 80 databases, and all of them now have
> default_tablespace=3Dvol4, except only one - "control" datab= ase. The only
> explanation I would have that all of those databases which have
> tablespace vol4 as default were copied from template1 without explicit= ly
> specified tablespace name...
>
> postgres=3D# select * from pg_database limit 10;
>             datname     &= nbsp;     | datdba | encoding | datistemplate |
> datallowconn | datconnlimit | datlastsysoid | datfrozenxid |
> dattablespace |         datconfig     &n= bsp;   |                  = ;     datacl
> -----------------------------+--------+----------+--------= -------+--------------+--------------+---------------+-----= ---------+---------------+---------------------------+---------= --------------------------------------------
>   template0              =     |     10 |        0 | t  =           | f  
>           |         =   -1 |         11510 |        =  378 |          1663
> |                    = ;       | {=3Dc/postgres,postgres=3DCTc/postgres}
>   postgres               =      |     10 |        0 | f &= nbsp;           | t  
>           |         =   -1 |         11510 |      7554523= |          1663
> |                    = ;       |
>   control               &= nbsp;     |  16389 |        6 | f  =           | t  
>           |         =   -1 |         11510 |      7554887= |         16384
> | {default_tablespace=3Dvol1} | {=3DT/dba,dba=3DCTc/dba,oper=3Dc/dba,n= agios=3Dc/dba}
>   template1              =     |     10 |        0 | t  =           | t  
>           |         =   -1 |         11510 |      7554847= |         16384
> | {default_tablespace=3Dvol4} | {=3Dc/postgres,postgres=3DCTc/postgres= }
>   conversion_alerts_fs        |  16= 393 |        0 | f           &= nbsp; | t  
>           |         =   -1 |         11510 |      7554847= |         16384
> | {default_tablespace=3Dvol4} |
> {=3DT/build,build=3DCTc/build,tableau_readonly=3Dc/build}
>   conversion_feasibility_too  |  16393 |   &n= bsp;    0 | f             | t =  
>           |         =   -1 |         11510 |      7554847= |         16384
> | {default_tablespace=3Dvol4} |
>   conversion_feasibility_tool |  16393 |     =    0 | f             | t  = ;
>           |         =   -1 |         11510 |      7554847= |         16384
> | {default_tablespace=3Dvol4} |
>   custom_searches_au          | &nb= sp;16393 |        6 | f         &nb= sp;   | t  
>           |         =   -1 |         11510 |      7554847= |         16384
> | {default_tablespace=3Dvol4} |
> {=3DT/build,build=3DCTc/build,tableau_readonly=3Dc/build}
>
> I've found that very bizarre myself, that default_tablespace would be =
> changed for already existing databases without me altering it explicit= ly...
> Sigh

Can we see an example of the script you used to modify the databases?

> ----------------------------------------------------------------------= --
> *From:* David G. Johnston <david.g.johnston@gmail.com>
> *Sent:* Wednesday, May 15, 2019 1:23 PM
> *To:* Julie Nishimura
> *Cc:* Adrian Klaver; pgsql-general@lists.postgresql.org
> *Subject:* Re: default_tablespace in 8.3 postgresql
> On Wed, May 15, 2019 at 1:01 PM Julie Nishimura <juliezain@hotmail.= com
> <mailto:juliezain@hotmail.= com>> wrote:
>
>     However, since I have modified template1 (and = most likely, those
>     databases were copied from it in the past), it= changed
>     default_parameter for them as well.
>
>
> This seems unlikely to be the case - changing template1 should not be =
> affecting other existing databases.
>
> David J.
>


--
Adrian Klaver
adrian.klaver@aklaver.com
--_000_BYAPR08MB50144C4CA7DAE9B80BB3ACE5AC090BYAPR08MB5014namp_--