Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id E3C43632F3F for ; Tue, 29 Jun 2010 17:55:23 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 49145-06 for ; Tue, 29 Jun 2010 20:55:17 +0000 (UTC) X-Greylist: delayed 00:05:56.446312 by SQLgrey-1.7.6 Received: from spamfilter01.streamservice.nl (spamfilter01.streamservice.nl [91.199.167.162]) by mail.postgresql.org (Postfix) with ESMTP id D55C56329C7 for ; Tue, 29 Jun 2010 17:55:16 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spamfilter01.streamservice.nl (Postfix) with ESMTP id B14F82279D for ; Tue, 29 Jun 2010 22:49:16 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.2 (20081215) (Debian) at streamservice.nl Received: from spamfilter01.streamservice.nl ([127.0.0.1]) by localhost (spamfilter01.streamservice.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wP5SHyusmmde for ; Tue, 29 Jun 2010 22:49:15 +0200 (CEST) Received: from alpha.sinnerg.nl (alpha.sinnerg.nl [213.189.17.150]) by spamfilter01.streamservice.nl (Postfix) with ESMTPS id 8617122106 for ; Tue, 29 Jun 2010 22:49:15 +0200 (CEST) Received: from [89.30.134.13] (helo=[192.168.1.7]) by alpha.sinnerg.nl with esmtpa (Exim 4.67) (envelope-from ) id 1OThzV-0001kM-66 for pgsql-sql@postgresql.org; Tue, 29 Jun 2010 23:05:13 +0200 Message-ID: <4C2A5CB4.3000601@s-wise.nl> Date: Tue, 29 Jun 2010 22:51:00 +0200 From: Jerrel Kemper User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9pre) Gecko/20100217 Lightning/1.0b1 Shredder/3.0.3pre MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: How to select text field as interger Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.11 tagged_above=-5 required=5 tests=BAYES_50=0.8, RCVD_IN_DNSWL_LOW=-0.7, T_FILL_THIS_FORM_SHORT=0.01 X-Spam-Level: X-Archive-Number: 201006/117 X-Sequence-Number: 34308 Dear members, My table consist off the following fields CREATE TABLE test ( id bigserial NOT NULL, name character varying(100), CONSTRAINT logs_pkey PRIMARY KEY (log_id) ) with value : ID Name 1 001 2 01 3 1 4 11 Select name from test where name = '1' ; results in : Name 1 If the 'Name' field was define as a serial the result set ought to be Name 001 01 1 Question? How can I have the same result set as above Name 001 01 1 with the name field defined as character varying. Thanks