Is this error expected ?

2022-10-18 Thread Yavuz TANRIVERDİ
Hi, i have an "ERROR: UNION types "char" and text cannot be matched CASE WHEN indisprimary THEN" error from https://github.com/yiisoft/yii/blob/e7c298343bf1f76186d443b62ff853d2d36e19f0/framework/db/schema/pgsql/CPgsqlSchema.php#L233 I read release notes, but can't find any related change, It

Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP

2022-10-18 Thread Christophe Pettus
> On Oct 18, 2022, at 19:18, gogala.mla...@gmail.com wrote: > > Commit within a loop is an extremely bad idea. This is an over-generalization. There are many use-cases for this (if there were not, procedures wouldn't have been nearly as important a feature). For example, if you are processi

Re: Attaching database

2022-10-18 Thread Julien Rouhaud
Hi, On Tue, Oct 18, 2022 at 10:06:40PM -0500, Igor Korot wrote: > Hi, guys, > After reading the documentation on > https://www.postgresql.org/docs/current/postgres-fdw.html > and checking the example I have a different question. > > The presentation in the link referenced doesn't explain how to ge

Re: Attaching database

2022-10-18 Thread Igor Korot
Hi, guys, After reading the documentation on https://www.postgresql.org/docs/current/postgres-fdw.html and checking the example I have a different question. The presentation in the link referenced doesn't explain how to get the table list on the remote server and the information on the specific ta

Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP

2022-10-18 Thread gogala . mladen
On Tue, 2022-10-18 at 14:31 -0700, Christophe Pettus wrote: > > Rather than have a loop inside the BEGIN / END, you could put the > BEGIN EXCEPTION END inside the loop, catch the error, store the > important parts of the exception in a variable, and then do the > COMMIT after the END statement but

Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP

2022-10-18 Thread gogala . mladen
On Tue, 2022-10-18 at 17:33 -0400, Tom Lane wrote: > Bryn Llewellyn writes: > > x...@thebuild.com wrote: > > > You can commit in a loop, but not in BEGIN / END block that has > > > an exception handler: that creates a subtransaction for the > > > duration of the BEGIN / END. > > > This surprised

Re: what's inherited

2022-10-18 Thread Laurenz Albe
On Tue, 2022-10-18 at 16:41 -0500, Ted Toth wrote: > When I create a table that inherits from another table what all is > inherited i.e. ownership, security policy, ...? None of that, only the column definitione. Yours, Laurenz Albe

Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP

2022-10-18 Thread Laurenz Albe
On Tue, 2022-10-18 at 17:33 -0400, Tom Lane wrote: > Bryn Llewellyn writes: > > x...@thebuild.com wrote: > > > You can commit in a loop, but not in BEGIN / END block that has an > > > exception handler: that creates a subtransaction for the duration of the > > > BEGIN / END. > > > This surprise

what's inherited

2022-10-18 Thread Ted Toth
When I create a table that inherits from another table what all is inherited i.e. ownership, security policy, ...? Ted

Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP

2022-10-18 Thread Christophe Pettus
> On Oct 18, 2022, at 14:15, Bryn Llewellyn wrote: > Could the limitation be lifted by making tractable internal implementation > changes? Or is it rooted in profoundly deep features of the > architecture—meaning that it could never be lifted? That is a very good question. One of the issues

Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP

2022-10-18 Thread Tom Lane
Bryn Llewellyn writes: > x...@thebuild.com wrote: >> You can commit in a loop, but not in BEGIN / END block that has an exception >> handler: that creates a subtransaction for the duration of the BEGIN / END. > This surprised me when I first started to use PG (after all those years > with ORCL).

Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP

2022-10-18 Thread Christophe Pettus
> On Oct 18, 2022, at 14:29, Ravi Krishna wrote: > > > You can commit in a loop, but not in BEGIN / END block that has an > > exception handler: > > that creates a subtransaction for the duration of the BEGIN / END. > > The reason I have to deal with error exception is that I want to ignore

Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP

2022-10-18 Thread Ravi Krishna
> You can commit in a loop, but not in BEGIN / END block that has an exception > handler:> that creates a subtransaction for the duration of the BEGIN / END. The reason I have to deal with error exception is that I want to ignore failure on a table and move on to next table.  I thought I can tric

Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP

2022-10-18 Thread Bryn Llewellyn
> x...@thebuild.com wrote: > >> s_ravikris...@aol.com wrote: >> >> I am getting error at COMMIT -> cannot commit while a subtransaction is >> active... > > You can commit in a loop, but not in BEGIN / END block that has an exception > handler: that creates a subtransaction for the duration of

Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP

2022-10-18 Thread Christophe Pettus
> On Oct 18, 2022, at 13:14, Ravi Krishna wrote: > > I am getting error at COMMIT -> cannot commit while a subtransaction is > active. > Is commit not possible in a loop You can commit in a loop, but not in BEGIN / END block that has an exception handler: that creates a subtransaction for t

COMMIT IN STORED PROCEDURE WHILE IN A LOOP

2022-10-18 Thread Ravi Krishna
AWS Aurora based on PG 13 I am writing a sproc to copy a schema into another.  Here is the relevant portion of the code. Basically I want to commit after every table is created.  In big schemas with hundreds of table I do not want to run entire operation in one transaction. I am getting error a

Re: byte-size of column values

2022-10-18 Thread Tom Lane
Dominique Devienne writes: > Hi. I'm surprised by the result for bit(3) and char, when calling > pg_column_size(). > Why 6, instead of 1? The doc does mention 5-8 bytes overhead, but I > expected those for varying bit, not fixed-sized bit typed values. How > come? Your expectation is incorrect.

Re: byte-size of column values

2022-10-18 Thread David G. Johnston
On Tue, Oct 18, 2022 at 8:53 AM Dominique Devienne wrote: > Hi. I'm surprised by the result for bit(3) and char, when calling > pg_column_size(). > > Why 6, instead of 1? The doc does mention 5-8 bytes overhead, but I > expected those for varying bit, not fixed-sized bit typed values. How > come?

byte-size of column values

2022-10-18 Thread Dominique Devienne
Hi. I'm surprised by the result for bit(3) and char, when calling pg_column_size(). Why 6, instead of 1? The doc does mention 5-8 bytes overhead, but I expected those for varying bit, not fixed-sized bit typed values. How come? Similarly, why 2 for char? Is it linked to Unicode? 1 byte for the va