Piwigo Bugtracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001766Piwigodatabasepublic2010.07.05 23:572010.07.06 14:17
Reportermadman 
Assigned Tonikrou 
PrioritynormalSeverityminorReproducibilitysometimes
StatusclosedResolutionfixed 
PlatformPostgresqlOSCentOS 5.4OS VersionPostgresql 8.4.2
Product Version2.1.2 
Target VersionFixed in Version2.1.3 
Summary0001766: [PostgreSQL] unkown database function UNIX_TIMESTAMP()
DescriptionA database function UNIX_TIMESTAMP is used, but this function isn't created in the PostgreSQL database. It is used in include/functions_session.inc.php on line 178. The following code can be used to create a database function unix_timestamp()

create language plpgsql;

create or replace function UNIX_TIMESTAMP(in_timestamp timestamp with time zone) returns integer as $$
begin
    return floor(extract(epoch FROM in_timestamp));
end;
$$ LANGUAGE plpgsql;
Additional Information
Warning: pg_query() [function.pg-query]: Query failed: ERROR: function unix_timestamp(timestamp with time zone) does not exist LINE 4: WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(expiration) >... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. in /var/www/sites/fotos.aarjan.nl/piwigo/piwigo_svn/include/dblayer/functions_pgsql.inc.php on line 122
DELETE FROM piwigo_sessions WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(expiration) > 3600 ;
ERROR: function unix_timestamp(timestamp with time zone) does not exist LINE 4: WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(expiration) >... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.
TagsNo tags attached.
browserMozilla
Database engine and versionPostgresql 8.4.2
PHP version5.3.2
Web serverApache 2.2.3
Attached Files

- Relationships

-  Notes
(0004032)
nikrou (developer)
2010.07.06 14:12

I'm not sure that introduce a pl function is a good idea but tell me if you think it's a good idea.
I prefer to introduce a new php function to calculate timestamp from a date.
(0004033)
svn (reporter)
2010.07.06 14:14

[Subversion] r6666 by nikrou on trunk

-----[Subversion commit log]----------------------------------------------------
Bug 1766 fixed : [PostgreSQL] unkown database function UNIX_TIMESTAMP()
Add a new function pwg_db_date_to_ts() to calculate a timestamp from a date
(0004034)
svn (reporter)
2010.07.06 14:17

[Subversion] r6667 by nikrou on branch 2.1

-----[Subversion commit log]----------------------------------------------------
Bug 1766 fixed : [PostgreSQL] unkown database function UNIX_TIMESTAMP()
Add a new function pwg_db_date_to_ts() to calculate a timestamp from a date
Merge from trunk

- Issue History
Date Modified Username Field Change
2010.07.05 23:57 madman New Issue
2010.07.05 23:57 madman browser => Mozilla
2010.07.05 23:57 madman Database engine and version => Postgresql 8.4.2
2010.07.05 23:57 madman PHP version => 5.3.2
2010.07.05 23:57 madman Web server => Apache 2.2.3
2010.07.06 14:12 nikrou Note Added: 0004032
2010.07.06 14:12 nikrou Status new => assigned
2010.07.06 14:12 nikrou Assigned To => nikrou
2010.07.06 14:14 svn Checkin
2010.07.06 14:14 svn Note Added: 0004033
2010.07.06 14:17 svn Checkin
2010.07.06 14:17 svn Note Added: 0004034
2010.07.06 14:17 nikrou Status assigned => closed
2010.07.06 14:17 nikrou Resolution open => fixed
2010.07.06 14:17 nikrou Fixed in Version => 2.1.3


Copyright © 2000 - 2015 MantisBT Team
Contact
Powered by Mantis Bugtracker