Fwd: Castable Domains for different JSON representations

2023-06-26 Thread Steve Chavez
> The bigger picture here, though, is what are you really buying compared to just invoking the special conversion function explicitly? > If you have to write "sometsrangecolumn::mytsrange::json", that's not shorter and certainly not clearer than writing a function call. The main benefit is to be a

Re: Castable Domains for different JSON representations

2023-06-25 Thread Tom Lane
Steve Chavez writes: > Currently domain casts are ignored. Yet this would be very useful for > representing data in different formats such as json. Hm. Usually what people ask for in this space is custom casts *to* a domain type, which is problematic because it's not clear how that should intera

Castable Domains for different JSON representations

2023-06-25 Thread Steve Chavez
Hello hackers, Currently domain casts are ignored. Yet this would be very useful for representing data in different formats such as json. Let's take a tsrange as an example. Its json output by default: select to_json('(2022-12-31 11:00, 2023-01-01 06:00)'::tsrange); to_jso