Re: insert a SYSTIMESTAMP value in postgres - Mailing list pgsql-general

From David Johnston
Subject Re: insert a SYSTIMESTAMP value in postgres
Date
Msg-id 009c01cc2f83$a8f43660$fadca320$@yahoo.com
Whole thread Raw
In response to insert a SYSTIMESTAMP value in postgres  ("Leon Match" <leon.match@convergia.net>)
List pgsql-general

Please look at the section on Date/Time Functions in the PostgreSQL documentation (Section 9.9 in Version 9.0 documentation) for a full listing of the date and time functions available in PostgreSQL and how they work.  There is a sub-section (9.9.4) that specifically details functions that return the current time.  Feel free to post with whichever function you feel is the correct one if you are still unsure after looking at the available options.

 

Your conversion from Oracle to PostgreSQL is going to go VERY slowly if you are going to ask a question for every syntax or feature that exists in Oracle that is different in PostgreSQL.  You need to understand WHAT the original code is doing and then at least look for what feature/syntax in PostgreSQL will accomplish the same result.

 

Personally I can see where the missing MERGE feature maybe warrants a list posting but, really, getting the “Current Time” from a function call is basic functionality that you can be expected to be readily found in the PostgreSQL documentation if you had attempted to look.

 

There are some articles in the WIKI about database migrations that may be worth a read as well – though I have not perused them myself.

 

No disrespect intended, and the community appreciates newcomers, but please at least look through the extensive documentation before posting any more “how do I do this in PostgreSQL” questions.  Then, if you still need to post, try describe what you are trying to accomplish WITHOUT resorting to posting Oracle code (code is OK but odds are many/most people on this list have never used Oracle).  In this instance, “SYSTIMESTMP” looks like a function but we do not know for sure.  And does it return a clock-time or a session-time?

 

David J.

 

 

From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Leon Match
Sent: Monday, June 20, 2011 3:33 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] insert a SYSTIMESTAMP value in postgres

 

Hello,

 

I am trying to re-create few objects  from oracle into postgres.

 

I have a problem inserting a timestamp value into the table:

 

insert into request_queue (request_id, received_time

                                                        )

        values   (new.request_id, SYSTIMESTAMP

                          );

 

How can I insert a dynamic timestamp value in postgress, please?

 

Thank you,

Leon

leon.match@convergia.net

 

 

pgsql-general by date:

Previous
From: Scott Ribe
Date:
Subject: Re: insert a SYSTIMESTAMP value in postgres
Next
From: hyelluas
Date:
Subject: Re: how to find a tablespace for the table?