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 1izMDd-0003sZ-6k for pgsql-general@arkaria.postgresql.org; Wed, 05 Feb 2020 15:03:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1izMDa-0000gW-Kc for pgsql-general@arkaria.postgresql.org; Wed, 05 Feb 2020 15:03:54 +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 1izMDa-0000gO-8T for pgsql-general@lists.postgresql.org; Wed, 05 Feb 2020 15:03:54 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1izMDX-0008BI-Eh for pgsql-general@postgresql.org; Wed, 05 Feb 2020 15:03:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=LTjnTT5XY/qDtT8bgSyP9FCLPiFvzk+zBp0gbxfL20g=; b=iuM45hl6Wgu2LgYixu286fFT2i 0YeygtxCiBaei53kwJ5wyCvvxVcI7ErwU3Al/hOXtpISb3MULc7YRnaI1MJun76FDItlLad0LDKpQ HrnExAoXDydL3LOD8c3jK9yQP8cNuRsgSsDBWAPUQnMFj57bqWkmXzbHUDNEiO9ej6y0=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.92) (envelope-from ) id 1izMDW-0002LU-CZ; Wed, 05 Feb 2020 16:03:50 +0100 Date: Wed, 5 Feb 2020 16:03:50 +0100 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Raul Kaubi Cc: Postgres General Subject: Re: Error handling: Resume work after error Message-ID: <20200205150350.GA5752@depesz.com> Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Feb 05, 2020 at 04:17:09PM +0200, Raul Kaubi wrote: > Let's say I want my procedure/function to resume work after specific error > ( duplicate_table ). > Is it possible to resume work after error..? > EXCEPTION > > WHEN duplicate_table then ......; Sure you can: https://www.postgresql.org/docs/current/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING Best regards, depesz