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

Updating old code for new engine

From: Bob McConnell <rmcconne(at)lightlink(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Updating old code for new engine
Date: 2007-03-31 19:45:18
Message-ID: 460EBA4E.40803@lightlink.com (view raw or flat)
Thread:
Lists: pgsql-novice
Good morning,

I have been setting up a server at home as a workbench to learn PHP, 
Postgres, and a few other tools. I recently installed an application 
(PHPRecipeBook) that was written for Postgres 7.2.3. But I have 8.2.3 
installed. When I try to access the recipe book, I get a few errors; 
surprise, surprise. Is there any way to identify what adjustments I need 
to make in the queries to compensate for the difference in target 
versions? My dream option would be a form in which I enter the original 
target and the new target and get back a list of all the syntax changes 
I need to account for. I started to walk through the release notes, but 
there are far too many changes spread too widely to make sense of.

The first level errors I get are:

SELECT count(*) FROM recipe_recipes WHERE recipe_name LIKE 'A%' OR 
recipe_name LIKE 'a%' ORDER BY recipe_name
ERROR: column "recipe_recipes.recipe_name" must appear in the GROUP BY 
clause or be used in an aggregate function

SELECT recipe_id,recipe_name FROM recipe_recipes WHERE recipe_name LIKE 
'A%' OR recipe_name LIKE 'a%' ORDER BY recipe_name LIMIT OFFSET 0
ERROR: syntax error at or near "OFFSET" LINE 1: ...R recipe_name LIKE 
'a%' ORDER BY recipe_name LIMIT OFFSET 0 ^

I fully expect there will be more after I get these corrected. My setup 
is as follows:

Slackware 10.2
Apache 1.3.37
PHP 4.4.5
PostgreSQL 8.2.3

Thank you,

Bob McConnell
N2SPP

Responses

pgsql-novice by date

Next:From: Sean DavisDate: 2007-03-31 22:23:28
Subject: Re: Updating old code for new engine
Previous:From: Ron JohnsonDate: 2007-03-31 19:43:05
Subject: Re: Anyone know where I can get an 8.2.3 binary for ubuntu?

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