User defined type without single quotes

From: Rodrigo Barboza <rodrigombufrj(at)gmail(dot)com>
To: pgsql-docs(at)postgresql(dot)org
Subject: User defined type without single quotes
Date: 2013-04-04 22:50:49
Message-ID: CANs8QJbj9Ez6yjRy+pq2-bfBMq5wExzi1-WyCWwBfuB3AusaqQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Hello.
I defined a new type to represent an unsigned int, but when I try do run a
query it complains because it is not quoted and casted to my type.

Suppose I have a table:

-- 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?

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Erwin Brandstetter 2013-04-07 22:08:16 Code examples for 39.6.1. Returning From a Function
Previous Message 正品折扣护肤 2013-03-30 06:25:25 69元!抢购雅诗兰黛2011全能细胞亮白防晒调色BB霜SPF35/PA+++30ml隐没肌肤一切瑕疵,使肌肤均匀有致,更有不同凡响的防晒效果!让您出行更方便!(AD)