Re: strict-aliasing warning

2025-12-09 Thread Michael Paquier
On Tue, Dec 09, 2025 at 07:04:23PM -0800, Adrian Klaver wrote: > On 12/9/25 18:27, ma lz wrote: >> Don't use IsA may fix this problem > > Why is it a problem? Well, I don't think that this has proved to be a problem until now in the buildfarm. I doubt that it would be the only problematic area i

Re: strict-aliasing warning

2025-12-09 Thread Adrian Klaver
On 12/9/25 18:27, ma lz wrote: What version of Postgres? In function "ExecEvalJsonCoercionFinish()"      if (SOFT_ERROR_OCCURRED(&jsestate->escontext)) may produce strict-aliasing warning Don't use IsA may fix this problem Why is it a problem? This is something that should be submitted

strict-aliasing warning

2025-12-09 Thread ma lz
In function "ExecEvalJsonCoercionFinish()" if (SOFT_ERROR_OCCURRED(&jsestate->escontext)) may produce strict-aliasing warning Don't use IsA may fix this problem 1.patch Description: 1.patch

Re: How do I check for NULL

2025-12-09 Thread Justin Swanhart
The key is the scalar subquery. A scalar subquery which selects no rows returns NULL. https://sqlfiddle.com/postgresql/online-compiler?id=e439059a-d46d-4d49-b8ab-9ff533656066 On Tue, Dec 9, 2025, 5:33 PM Thiemo Kellner wrote: > > On 12/9/25 18:29, David G. Johnston wrote: > > On Tue, Dec 9, 20

Re: How do I check for NULL

2025-12-09 Thread Thiemo Kellner
On 12/9/25 18:29, David G. Johnston wrote: On Tue, Dec 9, 2025 at 10:14 AM Thiemo Kellner wrote: I feel, you meant to say, the subquery does not return any record which is not the same as returns NULL. For a scalar subquery the final output of a zero-row query is the null value.

Re: How do I check for NULL

2025-12-09 Thread David G. Johnston
On Tue, Dec 9, 2025 at 1:40 PM Juan Rodrigo Alejandro Burgos Mella < [email protected]> wrote: > > Did you try setting a default value to the field? > >> >> Defaults don't work if you actually intend to conditionally override them -- or at least it requires something beyond a simple sel

Re: Ecpg fetch issue

2025-12-09 Thread Tzuriel Kahlon
Yes , and this is our issue that we try to solve in our product , we are working with IBM for cobol and try our luck to see if someone get any advance on that topic. *בברכה * *צוריאל כחלון * 0523851143 On Tue, Dec 9, 2025, 22:49 Juan Rodrigo Alejandro Burgos Mella < [email protected]

Re: Ecpg fetch issue

2025-12-09 Thread Juan Rodrigo Alejandro Burgos Mella
The issue is that there's no direct ECPG for COBOL; ECPG is a C preprocessor and can only be used as an external function. Alternatively, you can use libpq as a wrapper, but you'll still need to compile the C code. Atte JRBM El mar, 9 dic 2025 a las 15:30, Tzuriel Kahlon () escribió: > Hey thank

Re: How do I check for NULL

2025-12-09 Thread Juan Rodrigo Alejandro Burgos Mella
Hi Did you try setting a default value to the field? Atte JRBM El lun, 8 dic 2025 a las 21:40, Igor Korot () escribió: > Hi, ALL, > Consider the following scenario: > > CREATE TABLE test(a INT, b VARCHAR(256), c INT, d VARCHAR(256), /* > more fields follows*/); > CREATE UNIQUE INDEX test_x( b, c

Re: Ecpg fetch issue

2025-12-09 Thread Tzuriel Kahlon
Hey thank you for the answer , the solution you suggest is modified the code in the application side i want to open the ecpg like procob in oracle and set it there without any intervention. On the code itself . *בברכה * *צוריאל כחלון * 0523851143 On Tue, Dec 9, 2025, 22:27 Juan Rodrigo Alejand

Re: Ecpg fetch issue

2025-12-09 Thread Juan Rodrigo Alejandro Burgos Mella
Hi When using ECPG, if you have a simple FETCH, it will do it row by row; the way to download more than one row at a time is by using data arrays. In my case, when I want to extract, for example, 100 records at once, I use the following model: I define a data array: EXEC SQL BEGIN DECLARE SECTION

Ecpg fetch issue

2025-12-09 Thread Tzuriel Kahlon
Hey all , We are using IBM for cobol and connextint postgres db with ecpg the precompiler , problem is when we running cursor against db the prefetch are not set correctly and provide one row each time he approach to db and this decrease the performance significantly if twvle have 10 rows it ta

Re: How do I check for NULL

2025-12-09 Thread David G. Johnston
On Tue, Dec 9, 2025 at 10:14 AM Thiemo Kellner wrote: > I feel, you meant to say, the subquery does not return any record which is > not the same as returns NULL. > For a scalar subquery the final output of a zero-row query is the null value. David J.

How do I check for NULL

2025-12-09 Thread Thiemo Kellner
Btw, the exact error message could be helpful and should be provided to see misinterpretations.

How do I check for NULL

2025-12-09 Thread Thiemo Kellner
Hi I believe there is a misconception. I feel, you meant to say, the subquery does not return any record which is not the same as returns NULL. In any case, I suggest you to use the "insert select" construct, see examples in https://www.postgresql.org/docs/current/sql-insert.html, e.g. "NSERT I

Re: How do I check for NULL

2025-12-09 Thread Adrian Klaver
On 12/8/25 23:53, Igor Korot wrote: Hi, Davd, On Mon, Dec 8, 2025 at 6:44 PM David G. Johnston wrote: On Monday, December 8, 2025, Igor Korot wrote: However,, I'd like to still insert the record and I'd like to do something like: INSERT INTO test VALUES( 0, 'abc', 12345, IF( (SELECT foo

Re: How do I check for NULL

2025-12-09 Thread David G. Johnston
Tuesday, December 9, 2025, Igor Korot wrote: > Hi, Davd, > > On Mon, Dec 8, 2025 at 6:44 PM David G. Johnston > wrote: > > > > On Monday, December 8, 2025, Igor Korot wrote: > >> > >> > >> However,, I'd like to still insert the record and I'd like to do > something like: > >> > >> INSERT INTO t