IIRC, current_timestamp doesn't require parens. You could try something
like this:
select extract(epoch from current_timestamp)::int4 as result;
-Mark
On Mon, 2008-06-09 at 12:05 -0400, Michael Eshom wrote:
> I am a project manager for a popular forum system. We are adding
> support for PostgreS
On Mon, Jun 09, 2008 at 12:05:52PM -0400, Michael Eshom wrote:
> I am trying to create a "UNIX_TIMESTAMP()" function in PostgreSQL, which
> will return the current timestamp. However, whenever I try to add this
> function in phpPgAdmin, it says 'Syntax error at or near ")" at
> character 28'.
y
Hello
current_timestamp is some more than less constant :)
try, please
postgres=# select extract(epoch from current_timestamp);
date_part
--
1213030028.17068
(1 row)
or
postgres=# select extract(epoch from current_timestamp)::int;
date_part
1213030113
(1 row)
I am a project manager for a popular forum system. We are adding support
for PostgreSQL in the next version (which is currently in beta), and
have added several PostgreSQL functions to emulate MySQL functions of
the same name.
I am trying to create a "UNIX_TIMESTAMP()" function in PostgreSQL,
On Mon, 2008-06-09 at 01:29 -0700, Andrei wrote:
> The function above updates the rows between the ids start_id and
> end_id.
> I have a quad core procesor so i run two separate connections to the
> database: select populate_test_data(5000,1) and another select
> populate_test_data(5000,2). In thi
Andrei wrote:
The function above updates the rows between the ids start_id and
end_id. I have a quad core procesor so i run two separate connections
to the database: select populate_test_data(5000,1) and another select
populate_test_data(5000,2). In this case each function runs on one
core doing
I have the following case: a simple table
drop table test_data;
create table test_data (
id bigserial not null primary key,
content varchar(50),
processed varchar(1)
);
My function doing the inserts
CREATE OR REPLACE FUNCTION populate_test_data(IN nr_records BIGINT, IN proc_nr
BIGINT) RETURNS i