Re: Table with differerent Data Types

From: Klint Gore <kgore4(at)une(dot)edu(dot)au>
To: xaviergxf <xaviergxf(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Table with differerent Data Types
Date: 2008-04-24 06:04:21
Message-ID: 481022E5.40807@une.edu.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

xaviergxf wrote:
> Hi,
>
>
> I´m trying to do the follow: create a table like:
> create table t(
> cod serial,
> data_type char(10),
> value ???
> );
>
> I would like to do the follow the table would tell me what data type
> its the value. For instance:
>
> insert into t values(1, 'Integer', 12);
> insert into t values(2, 'String', 'test');
> insert into t values(3, 'Float', 1.23);
>
> How can i do that? Its that possible? How Can i solve this problem?
>
see http://www.varlena.com/varlena/GeneralBits/110.php

klint.

--
Klint Gore
Database Manager
Sheep CRC
A.G.B.U.
University of New England
Armidale NSW 2350

Ph: 02 6773 3789
Fax: 02 6773 3266
EMail: kgore4(at)une(dot)edu(dot)au

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Martin 2008-04-24 06:30:27 timestamp with time zone output incorrect
Previous Message Martijn van Oosterhout 2008-04-24 06:02:58 Re: error connecting to database: could not open relation