Re: [HACKERS] [PATCH] Generic type subscripting - Mailing list pgsql-hackers

From Chapman Flack
Subject Re: [HACKERS] [PATCH] Generic type subscripting
Date
Msg-id 5FDBD40D.2050101@anastigmatix.net
Whole thread Raw
In response to Re: [HACKERS] [PATCH] Generic type subscripting  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] [PATCH] Generic type subscripting
List pgsql-hackers
On 12/17/20 16:47, Tom Lane wrote:
> As far as "treat as" is concerned, we already have a spelling for
> that, it's called a cast.

I find them different; XQuery was the first language I had encountered
that provides both (a cast in XQuery is spelled 'cast as', just as you'd
expect), and the idea of an explicit operation that means "I am only
asserting statically what type this will have at run time; do not ever
perform any conversion or coercion, just give me an error if I'm wrong"
seems to be a distinct and useful one.

Even if there is no available SQL spelling for that, it might still one day
be a useful expression node that could be generated in certain chosen cases.

Regards,
-Chap



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] [PATCH] Generic type subscripting
Next
From: Chapman Flack
Date:
Subject: Re: [HACKERS] [PATCH] Generic type subscripting