Re: "A transaction cannot be ended inside a block with exception handlers."

2022-05-06 Thread David G. Johnston
I do understand better now and indeed the current limitation has no workaround that I can come up with. I was hoping maybe subblocks would work but its pretty clear cut that to catch an error at the commit command you must catch it within a block and the commit error will be raised first. On Fri,

Re: "A transaction cannot be ended inside a block with exception handlers."

2022-05-06 Thread Bryn Llewellyn
> t...@sss.pgh.pa.us wrote: > >> b...@yugabyte.com wrote: >> >> I want to demonstrate how to meet this requirement: >> >> « >> Encapsulate each business function in a user-defined subprogram that hides >> all the implementation details like table names and the SQL statements that >> manipulate

Re: How to get value wrapped in json?

2022-05-06 Thread David G. Johnston
On Friday, May 6, 2022, Shaozhong SHI wrote: > A json object is like this - {3}. > > How to get the value -3 out of this json object {3} > > That isn’t valid json so your question doesn’t make sense. Just treat it as a text type and use one or more of the documented text functions to manipulate

Re: "A transaction cannot be ended inside a block with exception handlers."

2022-05-06 Thread Tom Lane
Bryn Llewellyn writes: > I want to demonstrate how to meet this requirement: > « > Encapsulate each business function in a user-defined subprogram that hides > all the implementation details like table names and the SQL statements that > manipulate their contents so the they cannot be seen usin

Re: "A transaction cannot be ended inside a block with exception handlers."

2022-05-06 Thread Bryn Llewellyn
> david.g.johns...@gmail.com wrote: > >> b...@yugabyte.com wrote: >> >> Is there simply no way that inserts into table "t" in my example can be >> encapsulated in PL/pgSQL so that the error from the failing trigger can be >> handled rather there than escaping, raw, to the client? > > Any poten

pg_dump: VACUUM and REINDEXING

2022-05-06 Thread Hasan Marzooq
Hello! I've some questions around Backup & Restore. 1: Is it necessary to perform a VACUUM and REINDEXING operation after restoring the dump from Postgres 9.6 to Postgres 13? The dump size could be 1/2 TB to 1 TB. 2: Also, are there any other operations that are recommended to perform after pg_r

How to get value wrapped in json?

2022-05-06 Thread Shaozhong SHI
A json object is like this - {3}. How to get the value -3 out of this json object {3} David

Re: Vertical partition

2022-05-06 Thread David G. Johnston
On Friday, May 6, 2022, Rama Krishnan wrote: > Thanks a lot. Which means normal primary key and foreign key relationship > right can u pls send me any reference link > Like what? Read the documentation for those commands and features. David J.

Re: Vertical partition

2022-05-06 Thread Rama Krishnan
Thanks a lot. Which means normal primary key and foreign key relationship right can u pls send me any reference link On Sat, 7 May, 2022, 06:21 David G. Johnston, wrote: > > > On Friday, May 6, 2022, Rama Krishnan wrote: > >> Hi , >> >> Can you pls tell us how to do a vertical partition in pos

Re: Vertical partition

2022-05-06 Thread David G. Johnston
On Friday, May 6, 2022, Rama Krishnan wrote: > Hi , > > Can you pls tell us how to do a vertical partition in postgresql > Manually. “Create table” with the columns you want in each. You FK column will also be your PK column on the non-primary table. David J.

Vertical partition

2022-05-06 Thread Rama Krishnan
Hi , Can you pls tell us how to do a vertical partition in postgresql Thanks RamaKrishnan

Re: "A transaction cannot be ended inside a block with exception handlers."

2022-05-06 Thread David G. Johnston
On Fri, May 6, 2022 at 4:40 PM Bryn Llewellyn wrote: > > Is there simply no way that inserts into table "t" in my example can be > encapsulated in PL/pgSQL so that the error from the failing trigger can be > handled rather there than escaping, raw, to the client? > > Any potential solution to thi

"A transaction cannot be ended inside a block with exception handlers."

2022-05-06 Thread Bryn Llewellyn
The PG doc section 43.8. Transaction Management: https://www.postgresql.org/docs/current/plpgsql-transactions.html says "A transaction cannot be ended inside a block with exception handlers." It's easy to demonstrate the restriction by adding this just before the final "end;" in the simple examp

Re: Replication with Patroni not working after killing secondary and starting again

2022-05-06 Thread Zb B
> Does https://patroni.readthedocs.io/en/latest/replication_modes.html help? Thanks. I have found the same meanwhile. The effects I experienced were caused by the fact that Patroni configures async replication by default. After changing it to sync everything worked as expected

Re: Psycopg3 fails to resolve 'timezone localtime' on MacOS

2022-05-06 Thread Francisco Olarte
Jerry: On Fri, 6 May 2022 at 03:04, Jerry Sievers wrote: > Has anyone run into This? > Psycopg3 fails to resolve timezone localtime on MacOS (Catalina). > > It falls back to UTC regardless of whether running with/without the > tzdata package which I did try. > > There is a /etc/localtime symlink