Re: Custom type literal conversion

From: hubert depesz lubaczewski <depesz(at)gmail(dot)com>
To: Chris Bandy <bandy(dot)chris(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Custom type literal conversion
Date: 2014-09-24 13:40:35
Message-ID: CAKrjmhe9v-PnN+LcptjqcDvVDCgDXrdM9mBJYbjczN6oMwMOZw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Sep 24, 2014 at 2:45 PM, Chris Bandy <bandy(dot)chris(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2014-09-24 13:44:52 Re: JSONB spaces in text presentation
Previous Message Chris Bandy 2014-09-24 12:45:27 Custom type literal conversion