Received: from R2-D2.NMS-LA.PSI.CL (R2D2.NMS-LA.PSI.CL [200.29.14.68]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0FFum082281 for ; Mon, 15 Jan 2001 10:56:49 -0500 (EST) (envelope-from bartschm@psi.com) Received: from psi.com (IDENT:bartschm@localhost.localdomain [127.0.0.1]) by R2-D2.NMS-LA.PSI.CL (8.11.0/8.11.0) with ESMTP id f0FFuck28793 for ; Mon, 15 Jan 2001 12:56:38 -0300 Message-ID: <3A631DB6.7EA75DFB@psi.com> Date: Mon, 15 Jan 2001 12:56:38 -0300 From: Marcelo Bartsch X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.16-22 i686) X-Accept-Language: en, es MIME-Version: 1.0 To: Postgres SQL list Subject: How to display a unixtimestamp from a timestamp record? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200101/145 X-Sequence-Number: 806 Hello! again i was faced to a problem i was trying to do create view in wich i had the next fields: CREATE TABLE "tbacct" ( "user_name" character varying(32), "nas_identifier" character varying(15), "nas_port" int4, "acct_session_id" character varying(15), "caller_id" character varying(16), "called_station_id" character varying(16), "framed_ip_address" character varying(15), "acct_disconnect_cause" character varying(40), "acct_session_time" int4, "acct_timestamp" timestamp, "realm" character varying(64) ); and i need view in wich acct_timestamp is a int8 USERNAME IP-ADDRESS 74 000B2E5B NULL 6572 IP-ADDRESS NULL 4 2000-11-13 14:19:45-03 REALM and i want it to be displayed something like this: USERNAME IP-ADDRESS 74 000B2E5B NULL 6572 IP-ADDRESS NULL 4 974135985 REALM i know it is possible using date_part select date_part( 'epoch' , timestamp '2000-11-13 14:30:40'); gave the right answer . but when i executte select user_name, date_part( 'epoch' , timestamp 'acct_timestamp') from tbacct limit 2; it said ERROR: Bad timestamp external representation 'acct_timestamp' how should i represent date_part( 'epoch' , timestamp 'acct_timestamp') to work? Thanks in Advance -- Marcelo Bartsch R. bartschm@psi.com PSINet Chile /O /Ot Minimize execution speed (default) Microsoft C/C++ Compiler Documentation, 'Enviroment and Tools', p531 Telefono : +56-2-3979000 Numero de Fax : +56-2-3979090 Numero de eFax : (815) 366-3177