PostgreSQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesPostgreSQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old April 18th, 2008, 10:28 PM
BLazeD1 BLazeD1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 4 BLazeD1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 42 sec
Reputation Power: 0
Question Changed Hosts, Lots of Errors in PostgreSQL - Help Please!

Hi All

I recently changed hosts for my PHP/PostgreSQL site and have been seeing alot of errors in the errors logs and also some on the site.

Quote:
PHP Warning: pg_query(): Query failed: ERROR: operator does not exist: timestamp without time zone > time without time zone at character 14\nHINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.\nQUERY: SELECT $1 > $2 \nCONTEXT: PL/pgSQL function "f_touch_user" line 29 at IF in /..../include/database.php on line 40


Quote:
PHP Warning: pg_fetch_array() expects parameter 1 to be resource, boolean given in /..../include/common.php on line 402


Quote:
PHP Warning: pg_query(): Query failed: ERROR: function pg_catalog.btrim(bigint) does not exist at character 62\nHINT: No function matches the given name and argument types. You might need to add explicit type casts. in /..../include/database.php on line 40


Quote:
PHP Notice: Undefined index: HTTP_REFERER in ..../include/common.php on line 483


Does anyone know what might be causing this? Here are the relevant lines from the code:

database.php on line 40

Quote:
$l_hResult = pg_query($this->m_pHandle, $i_sQuery);


common.php on line 402

Quote:
while ($l_asRow = pg_fetch_array($l_hResult)) {


common.php on line 483

Quote:
$l_sReferer = isset($_POST['referer']) ? trim($_POST['referer']) : base64_encode($_SERVER['HTTP_REFERER']);


Thank you!

Reply With Quote
  #2  
Old April 18th, 2008, 11:26 PM
BLazeD1 BLazeD1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 4 BLazeD1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 42 sec
Reputation Power: 0
OK, I've worked out the code for the database.php line 40 errors is from

Quote:
protected function DoLogin($i_iUserID)
{
$l_hResult = $this->m_pDB->query('SELECT
f_touch_user(' . $i_iUserID . ', \'' . SESSION_TIMEOUT . '\'::time)');
}


And have been trying to fix it to no avail. Anyone know what will work?

Reply With Quote
  #3  
Old April 19th, 2008, 11:53 AM
pabloj's Avatar
pabloj pabloj is online now
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,687 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 5 Days 17 h 59 m 31 sec
Reputation Power: 259
Which PostgreSQL version are you now on? Did you notice that
Quote:
You might need to add explicit type casts
?
Mind telling us more about function f_touch_user?

Reply With Quote
  #4  
Old April 19th, 2008, 07:38 PM
BLazeD1 BLazeD1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 4 BLazeD1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 42 sec
Reputation Power: 0
Version 8.3

And I think that user is the user when I login to the backend (admin) and it is controlling the session timeout.

Cheers!

Reply With Quote
  #5  
Old April 20th, 2008, 02:54 PM
BLazeD1 BLazeD1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 4 BLazeD1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 42 sec
Reputation Power: 0
The old version was 8.1.9

Reply With Quote
  #6  
Old April 20th, 2008, 05:01 PM
shammat shammat is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 963 shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 15 h 15 m 49 sec
Reputation Power: 57
8.3 is more restrictive when it comes to automatic type casts. Where old versions would silently gues the type that you might have meant, 8.3 simply gives you an error.

See the release notes:
http://www.postgresql.org/docs/8.3/interactive/release-8-3.html

Quote:
Originally Posted by manual
Non-character data types are no longer automatically cast to TEXT

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesPostgreSQL Help > Changed Hosts, Lots of Errors in PostgreSQL - Help Please!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway