Soma Interesting <[EMAIL PROTECTED]> writes:
> Why does the following code return the exact same value each time, instead 
> of a value based on the current time?

> CREATE FUNCTION memb_num () RETURNS INT4 AS '
>       BEGIN
>               RETURN date_part(''epoch'', CURRENT_DATE);
>       END;
> ' LANGUAGE 'plpgsql';

Because you asked for a value based on the current *date*.
If you waited till tomorrow and tried again, then you'd get a
different answer.  Perhaps you want

                RETURN date_part(''epoch'', CURRENT_TIMESTAMP);

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to