Re: BUG #15940: json_populate_recordset fails with ERROR: record type has not been registered

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, yarexeray(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15940: json_populate_recordset fails with ERROR: record type has not been registered
Date: 2019-08-09 12:59:31
Message-ID: CAHyXU0zbjbAyEHvxxyx=8txvvJgMoeWXGiHMVfSCM-q=HB__SQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Aug 8, 2019 at 9:35 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Tue, Aug 06, 2019 at 02:53:45PM -0500, Merlin Moncure wrote:
> > For posterity I agree that OP was essentially exploiting undefined, or
> > at least poorly defined, behavior. For my money, I'd advise using
> > this function for cases where you don't want to use an in place type,
> > just a column list:
>
> If I were to change something here, that would be this error string
> exposed to the user. With the current error, there is no real way
> that the user knows what is wrong and why he/she should not do that.
> Could it be possible to add some recommendation for example on top of
> an error "cannot do that because blah"?

Good question. Maybe something like, "ERROR: Unable to expand generic
rowtype. HINT: Try using explicit cast on rowtype"

merlin

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Piotr Włodarczyk 2019-08-09 16:28:37 Recovery mode with partitioned tables and ANY(NULL) in WHERE clause
Previous Message Kyotaro Horiguchi 2019-08-09 07:42:01 Re: [HELP] Unable to initiate database cluster