By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,982 Members | 1,932 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,982 IT Pros & Developers. It's quick & easy.

Substract hour into a function

P: 2
Hi, I need to substract a variable hour from a timestamp in PostgreSQL 8.2, I think I can use the following sentence

Expand|Select|Wrap|Line Numbers
  1. select '2007-05-14 12:36:47' + ('-5 hours'::reltime);
I try that line in console and works fine for my purposes, but I'm having troubles turning the '-5' into a parameter for a plpgsql function.

Do you have any recommendations about how this can be done?



PS: This is my first post, I hope I accomplish all the posting guidelines, any comment is welcome.
May 14 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 534
Welcome to the Forum!
Let's start with the code you've developed so far for your function.
Post it here; no matter how bad it can be at this point, we'll just use it as a launch pad.
May 15 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.