Re: Data type conversion

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Jan Pips <jan_pips(at)op(dot)pl>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Data type conversion
Date: 2003-10-03 19:44:53
Message-ID: 20031003194453.GA23110@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, Oct 03, 2003 at 09:23:46 +0200,
Jan Pips <jan_pips(at)op(dot)pl> wrote:
> How to convert the interval type into integer, float or any "countable" data
> type at the time of table creation using
> select ... into?

You can use extract to do that. See the date/time function documentation.
Note that months get treated as 30 days when extracting periods less
than a month from an interval.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2003-10-03 19:45:07 Re: Bug in psql - Postgresql 7.3.1?
Previous Message Wei Weng 2003-10-03 19:37:33 Re: Bug in psql - Postgresql 7.3.1?