Bad queries; G2 with postgres7

matounet

Joined: 2003-05-01
Posts: 11
Posted: Sat, 2003-05-03 12:08

All was good, i have configured netpbm and imagemagick find.

so when i restart main.php, i have new queries errors:

http://matounet.dyndns.org/error.txt

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2003-05-04 07:12

That's weird. I can't reproduce that on my Postgres 7.3.2 install from the FreeBSD port (7.3.2_1, to be precise). But, I adjusted the query to include the target of the group-by clause in the select clause so it *should* work for you. I can't test it, though since I can't make it fail in the first place :sad: Let me know if it works for you.

 
matounet

Joined: 2003-05-01
Posts: 11
Posted: Sun, 2003-05-04 18:08

hum ...

it seem's not better :/

http://matounet.dyndns.org/errors2.txt

sorry to find all the time new problems .... :wink:

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2003-05-04 19:54

Unfortunately, your site isn't available at the moment so I can't see the error. What version of Postgres are you using? You mention 7.3 and 7.3.2 in your posts under the other topic.

Can you post the relevant error part of your debug output? Just look for the query that Postgres complains about and post that here, along with the Postgres error.

 
matounet

Joined: 2003-05-01
Posts: 11
Posted: Sun, 2003-05-04 20:12

http://matounet.dyndns.org/errors2.txt

works fine ...
Nevertheless, my postgres version is postgresql-7.3.2
and here and extract of the log :

Error (ERROR_STORAGE_FAILURE)
in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 1072
in modules/core/classes/Gallery.class at line 359
in modules/core/classes/GalleryItem.class at line 507
in layouts/classic/layout.inc at line 115
in layouts/classic/layout.inc at line 58
in modules/core/ShowItem.inc at line 126
in modules/core/classes/GalleryView.class at line 234
Gallery Debug Output
--------------------------------------------------------------------------------
(postgres7): set datestyle='ISO'
--------------------------------------------------------------------------------

Trying to load core version. If you see an error like table Xxx doesn't
exist here, that's OK.
--------------------------------------------------------------------------------
(postgres7):
SELECT
g2_ModuleParameterMap.g_parameterName,
g2_ModuleParameterMap.g_parameterValue
FROM
g2_ModuleParameterMap
WHERE
g2_ModuleParameterMap.g_moduleName = 'core'

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

....
Array
(
[limit] => Array
(
[count] => 9
[offset] => 0
)

)

postgres7 error: [ERROR: For SELECT DISTINCT, ORDER BY expressions must
appear in target list
: ERROR: For SELECT DISTINCT, ORDER BY expressions must appear in target
list
] in EXECUTE("
SELECT
DISTINCT(g2_ChildEntity.g_id)
FROM
g2_ChildEntity, g2_UserGroupMap, g2_PermissionMap, g2_Item
WHERE
g2_ChildEntity.g_parentId = 5
AND
(g2_PermissionMap.g_userId = 4
OR
(g2_UserGroupMap.g_userId = 4
AND
g2_PermissionMap.g_groupId = g2_UserGroupMap.g_groupId))
AND
g2_PermissionMap.g_permission &
'00000000000000000000000000000001' > '00000000000000000000000000000000'
AND
g2_PermissionMap.g_itemId = g2_ChildEntity.g_id
AND g2_Item.g_id = g2_ChildEntity.g_id
GROUP BY
g2_ChildEntity.g_id
ORDER BY g2_Item.g_title
LIMIT 9")

--------------------------------------------------------------------------------
(postgres7):
SELECT
DISTINCT(g2_ChildEntity.g_id)
FROM
g2_ChildEntity, g2_UserGroupMap, g2_PermissionMap, g2_Item
WHERE
g2_ChildEntity.g_parentId = 5
AND
(g2_PermissionMap.g_userId = 4
OR
(g2_UserGroupMap.g_userId = 4
AND
g2_PermissionMap.g_groupId = g2_UserGroupMap.g_groupId))
AND
g2_PermissionMap.g_permission &
'00000000000000000000000000000001' > '00000000000000000000000000000000'
AND
g2_PermissionMap.g_itemId = g2_ChildEntity.g_id
AND g2_Item.g_id = g2_ChildEntity.g_id
GROUP BY
g2_ChildEntity.g_id
ORDER BY g2_Item.g_title
LIMIT 9
--------------------------------------------------------------------------------

Warning: PostgreSQL query failed: ERROR: For SELECT DISTINCT,
ORDER BY expressions must appear in target list
in
/var/www/html/gallery2/lib/adodb/drivers/adodb-postgres64.inc.php on
line 454
ERROR: For SELECT DISTINCT, ORDER BY expressions must appear in target
list
: ERROR: For SELECT DISTINCT, ORDER BY expressions must appear in target
list

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2003-05-05 06:36
matounet wrote:
Error (ERROR_STORAGE_FAILURE)
in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 1072
in modules/core/classes/Gallery.class at line 359
in modules/core/classes/GalleryItem.class at line 507
in layouts/classic/layout.inc at line 115
in layouts/classic/layout.inc at line 58
in modules/core/ShowItem.inc at line 126
in modules/core/classes/GalleryView.class at line 234

You need to cvs update your code. The above stack trace shows that you're running with an older version of GalleryItem.class. I checked in a fix for this at 2003/05/04 07:10:03 GMT.

 
matounet

Joined: 2003-05-01
Posts: 11
Posted: Mon, 2003-05-05 12:47

Ok , sorry for my ignorance ... )
i update code from the cvs, but i have a new error ;-)

postgres7 error [ERROR Attribute g2_item.g_title must be GROUPed or used
in an aggregate function
ERROR Attribute g2_item.g_title must be GROUPed or used in an aggregate
function
] in EXECUTE("
SELECT
DISTINCT(g2_ChildEntity.g_id) , g2_Item.g_title
FROM
g2_ChildEntity, g2_UserGroupMap, g2_PermissionMap, g2_Item
WHERE
g2_ChildEntity.g_parentId = 5
AND
(g2_PermissionMap.g_userId = 3
OR
(g2_UserGroupMap.g_userId = 3
AND
g2_PermissionMap.g_groupId = g2_UserGroupMap.g_groupId))
AND
g2_PermissionMap.g_permission &
'00000000000000000000000000000001' > '00000000000000000000000000000000'
AND
g2_PermissionMap.g_itemId = g2_ChildEntity.g_id
AND g2_Item.g_id = g2_ChildEntity.g_id
GROUP BY
g2_ChildEntity.g_id
ORDER BY g2_Item.g_title
LIMIT 9")

sorry again )

Mat

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2003-05-06 04:19
matounet wrote:
Ok , sorry for my ignorance ... :)
i update code from the cvs, but i have a new error ;-)

Drat. I wish I could reproduce this with my local Postgres install. Can you send me your postgresql.conf file so that I can compare your settings to mine? If I can reproduce the problems locally I can fix them all instead of one at a time :-)

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2003-05-06 11:14

Ah! I managed to reproduce this with my Postgres setup over here. I'll fix this and check it in tomorrow (it's 4 AM -- time for bed).

 
matounet

Joined: 2003-05-01
Posts: 11
Posted: Tue, 2003-05-06 19:50

Arf ;-) , ok, so good night or good morning, it is according to. :)

do you still want my postgresql.conf version ?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Wed, 2003-05-07 05:20

Ok, check it out now. That problem should be fixed (but I'm sure you'll find another one :-) )

 
matounet

Joined: 2003-05-01
Posts: 11
Posted: Wed, 2003-05-07 07:31

My felicitations, everything works perfectly now... At the moment :)

thx