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

Extract Function

From: "Derrick Betts" <Derrick(at)Blue-Axis(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Extract Function
Date: 2004-03-19 14:44:25
Message-ID: 004201c40dc0$acc65ee0$0200a8c0@main (view raw or flat)
Thread:
Lists: pgsql-novice
I am trying to use the EXTRACT function in pl/pgsql and running into a problem.

This is the command:

SELECT EXTRACT(EPOCH FROM TIMESTAMP variable_name) INTO Temp;

The variable_name is of type text (I've also tried it as type timestamp), but the parser breaks when it attempts to perform this function.  It works great when I substitute the variable_name with '2004-1-10 00:00:00' , however, when I use a variable, it doesn't.

Any one have any ideas on how I can get variable substitution to work in my function using EXTRACT?

Thanks,
Derrick

Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2004-03-19 14:57:53
Subject: Re: connect from network PC
Previous:From: Paulo Jorge de Oliveira Cantante de MatosDate: 2004-03-19 14:06:01
Subject: Images in Database

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