Re: Convert text to user defined datatype

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: aditya desai <admad123(at)gmail(dot)com>
Cc: "Voillequin, Jean-Marc" <Jean-Marc(dot)Voillequin(at)moodys(dot)com>, pgsql-sql <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Re: Convert text to user defined datatype
Date: 2021-10-23 14:39:03
Message-ID: 3094022.1634999943@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

aditya desai <admad123(at)gmail(dot)com> writes:
> Thanks Jean. However I am trying this inside procedure and getting an
> error. Will try to send screenshot.

That's frowned on around here. Can't you copy-and-paste the code
and the error message?

As Jean-Marc says, you shouldn't really need a defined CAST
object to cast to or from text; Postgres will interpret that
as a request to apply the datatype's I/O functions.

You can formalize that by creating a cast "WITH INOUT", but
you shouldn't need to, so I think your problem here is something
different from what you said. Hard to give more advice without
seeing the problem code and the specific error.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message aditya desai 2021-10-25 03:27:15 Re: Convert text to user defined datatype
Previous Message aditya desai 2021-10-23 14:31:52 Re: Convert text to user defined datatype