public inbox for [email protected]
help / color / mirror / Atom feedFrom: Rodrigo Barboza <[email protected]>
To: Peter Eisentraut <[email protected]>
Cc: [email protected]
Subject: Re: User defined type without single quotes
Date: Sat, 13 Apr 2013 14:23:14 -0300
Message-ID: <CANs8QJbRKWLiJ7SSBF+P6W0ckw4TRbTQp-OJ-FDqueReJrbxuA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CANs8QJbj9Ez6yjRy+pq2-bfBMq5wExzi1-WyCWwBfuB3AusaqQ@mail.gmail.com>
<[email protected]>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgsql-docs>
Thank you, Peter!
On Sat, Apr 13, 2013 at 10:06 AM, Peter Eisentraut <[email protected]> wrote:
> On Thu, 2013-04-04 at 19:50 -0300, Rodrigo Barboza wrote:
> > -- my_uint32 is my new type
> > CREATE TABLE test (a my_uin32);
> >
> > If I try to run this insert, postgres complain about the type:
> > INSERT INTO teste (a) VALUES (10);
> >
> > But this one works:
> > NSERT INTO teste (a) VALUES ('10'::my_uint);
> >
> > Is there a way to avoid the single quotes?
> >
> A constant like 10 is initially assigned one of the integer types (the
> exact rules are in the documentation). In order to be able to store
> that into a column of a custom type, you need to define a cast between
> the integer type and your type with at least assignment context.
>
>
view thread (3+ messages)
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: [email protected]
Cc: [email protected], [email protected]
Subject: Re: User defined type without single quotes
In-Reply-To: <CANs8QJbRKWLiJ7SSBF+P6W0ckw4TRbTQp-OJ-FDqueReJrbxuA@mail.gmail.com>
* 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