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 1elnHr-0000Pl-1W for pgsql-general@arkaria.postgresql.org; Wed, 14 Feb 2018 02:59:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1elnHo-0001eY-RL for pgsql-general@arkaria.postgresql.org; Wed, 14 Feb 2018 02:59:08 +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 ) id 1elnHo-0001eO-8Q for pgsql-general@lists.postgresql.org; Wed, 14 Feb 2018 02:59:08 +0000 Received: from mail-io0-x243.google.com ([2607:f8b0:4001:c06::243]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1elnHl-0004kS-17 for pgsql-general@postgresql.org; Wed, 14 Feb 2018 02:59:07 +0000 Received: by mail-io0-x243.google.com with SMTP id m11so23568616iob.2 for ; Tue, 13 Feb 2018 18:59:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=QHTmRMVPmIgTxec7sXL6P836AUHwwpEh+hvjyQ1UPA8=; b=QEC3OnJypnH++cuu3rO6DsPsWY7MYYlaVkI2Q2rmcElussSte5hglkvzL/yFckbuxW g5LQE5qPGOZxDyEM9fRu7tKE/rGp0IQWKfQHlMIXP9x66NpBfCBWfwfR+b6keXIoHLyd 9fJFZ8sukUgQzUjO6muXuFzheUkiPFsDtzBV6bclXN+hB4krHhfVXw7ZhY66JM3HGYee ARAszRJSXNqKV5f1r8HUUpS8L7Z+XUpDD2TplFoW3Q4Bh0GtuRTOj98CBUklxrhUM5S4 AtRQQ6lF7KJPRYRFJt1Niu1/gfvfAuXCl8iHh8aLBASgljE3H3nvKadECBBeN3QpiDFi XoZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=QHTmRMVPmIgTxec7sXL6P836AUHwwpEh+hvjyQ1UPA8=; b=UvyoI6rX9+7ONOzQbW9s6U1v+8KJzTSxHrqXTwnGqgzwGsyEeWyIel43ZGR1DMCObU 4cCjRR4tWJCC1ot5A97DpkEIo28oTNQ74qXePulC6h5HGGVWh8KzRzF5yl4kktn6O03Z OgegHcNrOfnHNV81mP3HeJhMpHUOEUzBwqGap8wo9Z/ld3nt22rMSa9VnqxIb+tZvE0a ssqb0kMlOCayNgti4Xa/QOVYYQ/Tv8Oa4tX+LaZB4WjdYNXbfNeZydbctw9Z9rxDQscQ 9YQSxndO7mxL4oxOMZKbmlTiKhM/L82IZpB/1/WzMFRZorP4nlUuRET6Wb2kq93jvqjJ iFLQ== X-Gm-Message-State: APf1xPA//c+G7jwirW6D87ln7LH8jscH1zTcn+SLDnp/alwrBATa54v5 YriZPzpvMf7fPzkb1cGjEHU= X-Google-Smtp-Source: AH8x227zsS8GJHlBSMVGcAYR31zdC2GjJ6oBTKd0FHu2CUPA9Fj4zvlQRbLU4wjo5Pncia2embir0w== X-Received: by 10.107.242.14 with SMTP id q14mr3699587ioh.211.1518577143738; Tue, 13 Feb 2018 18:59:03 -0800 (PST) Received: from ?IPv6:2605:a601:2062:d00:85e7:fe3e:3bf2:f172? ([2605:a601:2062:d00:85e7:fe3e:3bf2:f172]) by smtp.gmail.com with ESMTPSA id m203sm797126ioa.30.2018.02.13.18.59.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Feb 2018 18:59:02 -0800 (PST) From: armand pirvu Message-Id: <1CC76001-D74C-49A0-AC7F-2DE8AAC047C7@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_6B733243-ABBE-4DC4-8687-A40E1A0C55E1" Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: cursors and function question Date: Tue, 13 Feb 2018 20:58:27 -0600 In-Reply-To: Cc: Adrian Klaver , "pgsql-general@postgresql.org" To: "David G. Johnston" References: <149EBC11-E33E-4DBA-9130-8C93BE4B1B43@gmail.com> <83c954ba-4d14-ac71-f4ea-30ce25b9a310@aklaver.com> <0B711AA9-3ACA-4A26-BC40-9F971E250AE0@gmail.com> X-Mailer: Apple Mail (2.3273) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_6B733243-ABBE-4DC4-8687-A40E1A0C55E1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Feb 13, 2018, at 4:37 PM, David G. Johnston = wrote: >=20 > On Tue, Feb 13, 2018 at 3:31 PM, Adrian Klaver = > wrote: > 2) By global table do you mean a temporary table? If so not sure that = is going to work as I am pretty sure it will disappear after the = function is run. >=20 > =E2=80=8BTemporary tables can survive until either session or = transaction end - neither of which occurs automatically when exiting a = function. >=20 > https://www.postgresql.org/docs/10/static/sql-createtable.html = >=20 > "Temporary tables are automatically dropped at the end of a session, = or optionally at the end of the current transaction (see ON COMMIT = below)" >=20 > David J. >=20 Thank you both of you Adrian and David for the input and help I owe you some nice red wine :) Cheers - Armand= --Apple-Mail=_6B733243-ABBE-4DC4-8687-A40E1A0C55E1 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On Feb 13, 2018, at 4:37 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:

On Tue, Feb 13, 2018 = at 3:31 PM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
2) By global table do you mean a = temporary table? If so not sure that is going to work as I am pretty = sure it will disappear after the function is run.

=E2=80=8BTemporary = tables can survive until either session or transaction end - neither of = which occurs automatically when exiting a function.

https://www.postgresql.org/docs/10/static/sql-createtable.html<= /a>




Thank you both = of you Adrian and David for the input and help

I owe you some nice red wine = :)


Cheers
- = Armand
= --Apple-Mail=_6B733243-ABBE-4DC4-8687-A40E1A0C55E1--