Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UNt07-0003is-US for pgsql-docs@arkaria.postgresql.org; Thu, 04 Apr 2013 22:51:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UNt07-0002q9-4R for pgsql-docs@arkaria.postgresql.org; Thu, 04 Apr 2013 22:51:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UNt06-0002q3-9W for pgsql-docs@postgresql.org; Thu, 04 Apr 2013 22:51:22 +0000 Received: from mail-ia0-x233.google.com ([2607:f8b0:4001:c02::233]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UNszv-0003pj-6P for pgsql-docs@postgresql.org; Thu, 04 Apr 2013 22:51:21 +0000 Received: by mail-ia0-f179.google.com with SMTP id x24so2656535iak.38 for ; Thu, 04 Apr 2013 15:51:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to :content-type; bh=lhmdHRI5jyzDctmW7AzIbM6e1aOmOXXt2HCIjJiWk8s=; b=Bk21L4hgavuZpizDBdI4OhaZiB7dTOWq2+JUxH1sR10agZgCgSRR81XVFQdWAi0SS3 MO8hLIssmTzEJD2YKd9Qz4cAmilHhNIpRua8nBAg/xEKUHViq9SX3EYAVJ3mrPWkpGkv it6uxd386U3/p88fxoEXd633swcSA4HymHhSAGsMA1BF8UaaBw8YiIoIv/SLK142LQ8c Up2kIL70Z7/qmWHIaSdMcWg1xFneeFoBrkM5Cg9Cfs6tPvGYtbcfKgsxbIRlx7Oo3qm6 vxc9vRQWS7T37RSNmfpot11vXwaBNdJcHTgvoiipmYrq9fPImkHjXh8B/ZvjsTzw24jG 3qPQ== X-Received: by 10.50.192.201 with SMTP id hi9mr102855igc.48.1365115869764; Thu, 04 Apr 2013 15:51:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.64.134 with HTTP; Thu, 4 Apr 2013 15:50:49 -0700 (PDT) From: Rodrigo Barboza Date: Thu, 4 Apr 2013 19:50:49 -0300 Message-ID: Subject: User defined type without single quotes To: pgsql-docs@postgresql.org Content-Type: multipart/alternative; boundary=14dae9340d2f7ea29004d990ce12 X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org --14dae9340d2f7ea29004d990ce12 Content-Type: text/plain; charset=ISO-8859-1 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? --14dae9340d2f7ea29004d990ce12 Content-Type: text/html; charset=ISO-8859-1
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?
--14dae9340d2f7ea29004d990ce12--