Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jX4R3-0000qe-0l for pgsql-general@arkaria.postgresql.org; Fri, 08 May 2020 14:57:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jX4R0-0001wI-UZ for pgsql-general@arkaria.postgresql.org; Fri, 08 May 2020 14:57:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jX4Qz-0001mr-6p for pgsql-general@lists.postgresql.org; Fri, 08 May 2020 14:57:06 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jX4Qt-0007xi-9F for pgsql-general@lists.postgresql.org; Fri, 08 May 2020 14:57:04 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A342C5C00B0; Fri, 8 May 2020 10:56:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 08 May 2020 10:56:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=w ckyWIZDpylm5UYUDStiK5Rc8ZlfVkk3dNcxN3XXQv0=; b=lwfqxTo9/i3TRmSi7 3cGAewhVFqAosv/ajeOhSiH1ogbsCGyH4ZGJ5T6DhuA/TKbDWbGHYHt4Rezq5ubt 06/Wkopxp2KKPDc8gqUdbWMy/GDkoLG1BIj2gLc6vY9v3KWAtX7HM0h9jIo9e2Wi uPhup0HVxG5iouq0Jeo8jQsU5CkX14BxMEKa6yFb4/E9RyDO/FGFDVe2wFP+BAF7 JVUnf0pQGYpK+j7krgVLfTPW7b/pCNAeGg5Q3TeLrXxrh85I3jPONS1oR+TNs7mb PtpfXCibXz333vx08H3RFsI/uDPn9Dze0SSGIBzeglM+5JnqusBUXiKq0jggnB+4 a2Bhg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=wckyWIZDpylm5UYUDStiK5Rc8ZlfVkk3dNcxN3XXQ v0=; b=IarkjJcZBLY6O0XVRc0m750MVvU4RDb+9125Ze6apxJh9QttgVfp/DM6Q YQ8RZhybxIX/PigYzYPtVmin7c8l7w6KeOAdPoyRQp5HcMGzLn8M46r9GK454+0C Rd8tElVOA+uFA0gUshHBbIQtkbvNx+qXY2fwnr5fTWLf4RSZXcu6y+bv+F2NjgTX 4PoICtEbJnKC2AwL6Zp/8DE+ntjad/R8G4Ccm/lvNyWNYyWfybYLXOhrwFNJrEfD 42hgycdedHPFzsV0I0lcysRDn/AhMCAgPFkQZ6PqKDadkLy+a7tF0ZBQBbHKXH9z dhVSa7BJEKwWtM6HQlxsSxH5jL20A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrkeefgddujecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuggftrfgrthhtvghrnhepkefgiedvueeuteevueduvdegleefiedtvdekvdettdfh veffudffveeiudfggeefnecuffhomhgrihhnpegthigsvghrthgvtgdqphhoshhtghhrvg hsqhhlrdgtohhmnecukfhppeejhedrudejvddrhedrvdefudenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrse grkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.3] (75-172-5-231.tukw.qwest.net [75.172.5.231]) by mail.messagingengine.com (Postfix) with ESMTPA id 927FB3280066; Fri, 8 May 2020 10:56:55 -0400 (EDT) Subject: Re: pg_temp schema created while using DB Link To: Jill Jade , Laurenz Albe Cc: pgsql-general@lists.postgresql.org References: <2322d8108dde9dd7e7f002e082839aeea055d084.camel@cybertec.at> From: Adrian Klaver Message-ID: Date: Fri, 8 May 2020 07:56:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 5/8/20 12:32 AM, Jill Jade wrote: > Hello > > We do not have any temporary tables in the Oracle database. The > temporary schema is created only while using the db_link. These temp > schemas (pg_temp, pg_toast) are not disappearing even after restarting > the database. > > These are empty schemas that do not contain anything (tables, views > etc). And these schemas keep on increasing each time the query using the > db_link is run. Postgres will keep empty pg_temp schemas around rather then having to recreate them the next time they are needed. Not sure where the cutoff is for number? > > Why the db_link is causing these schemas? Is there any issue with db_link? > > Thanks > > Regards, > Jill > > > On Fri, 8 May 2020 at 10:36, Laurenz Albe > wrote: > > On Fri, 2020-05-08 at 10:11 +0400, Jill Jade wrote: > > We have an issue with DB_Link from Oracle to PostgreSQL. When we > try to access tables from > > Oracle database via DB_link, temp schemas(pg_temp,pg_toast) are > automatically created > > in the database while using the query below. > > > > create table as select * from table@oralink > > > > Even if we reload the database, the temp schemas are still there. > > > > Do you know the reason why the temp schemas are being created > with DB_link? > > Does anyone has a solution for this problem? > > These schemas contain temporary tables and are not connected to your > connection > from Oracle (unless you create temporary tables via that connection). > > They are an implementation detail and should not bother you. > > What is your problem with these schemmas? > > Yours, > Laurenz Albe > -- > Cybertec | https://www.cybertec-postgresql.com > -- Adrian Klaver adrian.klaver@aklaver.com