[GENERAL] Importing data w/ Unix timestamp

2000-06-29 Thread brianb-pggeneral
I want to copy in some data from a tab-delimited flat file, but one of the columns that should translate into a datetime is in Unix timestamp format (seconds since epoch). The data should go into this table: create table logins ( uname varchar(100), timein datetime, duration int,

Re: [GENERAL] Importing data w/ Unix timestamp

2000-06-29 Thread brianb-pggeneral
[EMAIL PROTECTED] writes: I want to copy in some data from a tab-delimited flat file, but one of the columns that should translate into a datetime is in Unix timestamp format (seconds since epoch). The data should go into this table: create table logins ( uname varchar(100),

Re: [GENERAL] Importing data w/ Unix timestamp

2000-06-29 Thread Tom Lane
[EMAIL PROTECTED] writes: I want to copy in some data from a tab-delimited flat file, but one of the columns that should translate into a datetime is in Unix timestamp format (seconds since epoch). COPY isn't going to apply any datatype conversions for you. What you could do, though, is

Re: [GENERAL] Importing data w/ Unix timestamp

2000-06-29 Thread Thomas Lockhart
insert into RealTable select uname, timestamp(abstime(timeinAsInt4)), duration, etc from TempTable; Another side comment: afaik an explicit conversion to abstime is not required to go from Unix time to timestamp. So insert into RealTable select uname,