agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: aditya desai <admad123@gmail.com>
Cc: Voillequin, Jean-Marc <Jean-Marc.Voillequin@moodys.com>
Cc: pgsql-sql <pgsql-sql@lists.postgresql.org>
Subject: Re: Convert text to user defined datatype
Date: Sat, 23 Oct 2021 10:39:03 -0400
Message-ID: <3094022.1634999943@sss.pgh.pa.us> (raw)
In-Reply-To: <CAN0SRDFGYOKxvpR5svU8s2rjmQ9+tr5+jGdnfSYvn6eMPJ1PFQ@mail.gmail.com>
References: <CAN0SRDFsxNhWMOdSj_gveb3=7E6ktRR_q1Masr6EmiLGg5J53A@mail.gmail.com>
	<MN2PR20MB27357EFC60D632C6315A02D5BE819@MN2PR20MB2735.namprd20.prod.outlook.com>
	<CAN0SRDFGYOKxvpR5svU8s2rjmQ9+tr5+jGdnfSYvn6eMPJ1PFQ@mail.gmail.com>

aditya desai <admad123@gmail.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





view thread (5+ messages)  latest in thread

Message-ID: <3094022.1634999943@sss.pgh.pa.us>
Permalink:  ../3094022.1634999943@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3094022.1634999943@sss.pgh.pa.us

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, admad123@gmail.com, Jean-Marc.Voillequin@moodys.com, pgsql-sql@lists.postgresql.org
  Subject: Re: Convert text to user defined datatype
  In-Reply-To: <3094022.1634999943@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox