Re: ERROR: failed to find conversion function from key_vals_nn to record[]

2022-06-17 Thread Peter J. Holzer
On 2022-06-16 23:58:23 -0700, Bryn Llewellyn wrote: > david.g.johns...@gmail.com wrote: > > b...@yugabyte.com wrote: > > Can anybody show me an implementation of a realistic use case that > follows proper practice — like "every table must a primary key", "a > f

Re: ERROR: failed to find conversion function from key_vals_nn to record[]

2022-06-16 Thread Bryn Llewellyn
> david.g.johns...@gmail.com wrote: > >> b...@yugabyte.com wrote: >> >> Can anybody show me an implementation of a realistic use case that follows >> proper practice — like "every table must a primary key", "a foreign key must >> refer to a primary key", and "joins may be made only "on" columns

Re: ERROR: failed to find conversion function from key_vals_nn to record[]

2022-06-16 Thread David G. Johnston
On Thu, Jun 16, 2022 at 8:28 PM Bryn Llewellyn wrote: > > *Back to NULLs...* > > Your code examples ran without error and produced the results that you > described. I do understand the fact that, on its face, the NULLs in the > two cases arise for different reasons. But this (still) seems to me

Re: ERROR: failed to find conversion function from key_vals_nn to record[]

2022-06-16 Thread Bryn Llewellyn
> david.g.johns...@gmail.com wrote: > >> b...@yugabyte.com wrote: >> >> This is what the doc promises. But how can you see it as anything but a bug? >> The subquery evaluates to "null", and only then is the attempt made to >> create a new row which self-evidently violates the domain's constrain

Re: ERROR: failed to find conversion function from key_vals_nn to record[]

2022-06-16 Thread Tom Lane
"David G. Johnston" writes: > The fact that a domain over an array isn’t being seen as an array here > seems like a bug. Hmm. The attached quick-hack patch seems to make this better, but I'm not sure whether there are any cases it makes worse. regards, tom lane diff --g

Re: ERROR: failed to find conversion function from key_vals_nn to record[]

2022-06-15 Thread David G. Johnston
On Wed, Jun 15, 2022 at 11:07 PM Bryn Llewellyn wrote: > This is what the doc promises. But how can you see it as anything but a > bug? The subquery evaluates to "null", and only then is the attempt made to > create a new row which self-evidently violates the domain's constraint. How > is it any

Re: ERROR: failed to find conversion function from key_vals_nn to record[]

2022-06-15 Thread Bryn Llewellyn
> david.g.johns...@gmail.com wrote: > >> b...@yugabyte.com wrote: >> >> I’ve copied a self-contained testcase below. Is the error that the "as >> intended" test causes due to a known limitation—or even a semantic dilemma >> that I'm failing to spot? Or might it be due to a bug? > > I read the

Re: ERROR: failed to find conversion function from key_vals_nn to record[]

2022-06-15 Thread David G. Johnston
On Wednesday, June 15, 2022, Bryn Llewellyn wrote: > I’ve copied a self-contained testcase below. Is the error that the "as > intended" test causes due to a known limitation—or even a semantic dilemma > that I'm failing to spot? Or might it be due to a bug? > I read the note in create domain as