Re: Custom type literal conversion - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: Custom type literal conversion
Date
Msg-id CAKrjmhe9v-PnN+LcptjqcDvVDCgDXrdM9mBJYbjczN6oMwMOZw@mail.gmail.com
Whole thread Raw
In response to Custom type literal conversion  (Chris Bandy <bandy.chris@gmail.com>)
Responses Re: Custom type literal conversion  (Chris Bandy <bandy.chris@gmail.com>)
List pgsql-general
On Wed, Sep 24, 2014 at 2:45 PM, Chris Bandy <bandy.chris@gmail.com> wrote:
I would like to create a new type for version strings that sorts numerically. The composite type below was quick to write and does not require superuser privileges. However, it doesn't respond to type casts the way I'd like.

Is there a way to implement this type's literal conversion without resorting to a base type?

I think you need to define casts too, but in any way - check if "semver" extension (available on pgxn) doesn't solve your problem.

depesz

pgsql-general by date:

Previous
From: Chris Bandy
Date:
Subject: Custom type literal conversion
Next
From: Merlin Moncure
Date:
Subject: Re: JSONB spaces in text presentation