I don't think a cast that doesn't cater for all the forms json can take is going to work very well. At the very least you would need to error out in cases you didn't want to cover, and have tests for all of those errors. But the above is only a tiny fraction of those. If the error cases are going to be so much more than the cases that work it seems a bit pointless.
Hi everyone I changed my mail account to be officially displayed in the correspondence. I also made an error conclusion if we are given an incorrect value. I believe that such a cast is needed by PostgreSQL since we already have several incomplete casts, but they perform their duties well and help in the right situations.
cheers Antoine Violin
Antoine
On Mon, Jul 15, 2024 at 12:42 PM Andrew Dunstan <andrew@dunslane.net> wrote:
On 2024-04-02 Tu 11:43, ShadowGhost wrote:
Atthemoment, this cast supportsonlythesestructures,asitwasenoughformytasks:
{str:numeric}
{str:str}
{str:bool}
{str:null}
Butit's a greatideaandI'll thinkaboutimplementingit.
I don't think a cast that doesn't cater for all the forms json can take is going to work very well. At the very least you would need to error out in cases you didn't want to cover, and have tests for all of those errors. But the above is only a tiny fraction of those. If the error cases are going to be so much more than the cases that work it seems a bit pointless.