Skip site navigation (1) Skip section navigation (2)

timestamp to date and time column migration

From: Bill Totman <totman(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: timestamp to date and time column migration
Date: 2007-07-29 18:39:13
Message-ID: 200707291339.30154.totman@gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hello all,

I created a table where I used a timestamp type column and after inserting 
about 300 entries into this table I would now rather have two separate 
columns for that data: one for just the date and the other for just the time.

I'm not sure what the best way would be to:
1) backup that information (from the current timestamp column), 
2) drop the timestamp table, 
3) add a date type table and a time type table, 
4) and ultimately import the already-space-separated timestamp data into these 
two columns.

Barring the above outline being erroneous, I suppose I just to know if there 
are any 'gotchas' that I should beware/know about before proceeding with this 
migration... as well as the syntax for piping data or running INSERT commands 
from a file on the commandline.


Thank you very, very much for any and all help you might have.

Bill Totman

Responses

pgsql-novice by date

Next:From: Michael GlaesemannDate: 2007-07-29 20:20:22
Subject: Re: timestamp to date and time column migration
Previous:From: Luca FerrariDate: 2007-07-29 13:34:22
Subject: expain INSERT INTO

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group