Thread: Hash problem

Hash problem

From
Madison Kelly
Date:
Hi all,

   I am back to trying to get the forum software called 'Ikonboard'
working under postgres (it's advertised as being supported but the
developers confirmed their pgSQL person left a while back).

   At the moment I am (well, the program is) getting trying to perform
this query:

SELECT * FROM tf_forum_posts WHERE FORUM_ID = HASH(0x868d4e0) AND
TOPIC_ID = AND QUEUED = '0' ORDER BY POST_DATE LIMIT 2;

which throws this error:

ERROR:  parser: parse error at or near "x868d4e0" at character 53

   Most of the problems so far have stemmed from changes from (I think)
pgSQL 7.2 (the last version the program was actively tested on) to 7.4.
I have yet to test it under 8.0. Does this seem like an obvious syntax
error in the newer versions of pgSQL? If so, what is a valid substitution.

   Thanks a lot! (I'm not -quite- a n00b but I am still learning. :) )

Madison

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Madison Kelly (Digimer)
TLE-BU, The Linux Experience; Back Up
http://tle-bu.thelinuxexperience.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Re: Hash problem

From
Ian Barwick
Date:
On Sat, 12 Mar 2005 02:18:55 -0500, Madison Kelly <linux@alteeve.com> wrote:
> Hi all,
>
>    I am back to trying to get the forum software called 'Ikonboard'
> working under postgres (it's advertised as being supported but the
> developers confirmed their pgSQL person left a while back).
>
>    At the moment I am (well, the program is) getting trying to perform
> this query:
>
> SELECT * FROM tf_forum_posts WHERE FORUM_ID = HASH(0x868d4e0) AND
> TOPIC_ID = AND QUEUED = '0' ORDER BY POST_DATE LIMIT 2;
>
> which throws this error:
>
> ERROR:  parser: parse error at or near "x868d4e0" at character 53
>
>    Most of the problems so far have stemmed from changes from (I think)
> pgSQL 7.2 (the last version the program was actively tested on) to 7.4.
> I have yet to test it under 8.0. Does this seem like an obvious syntax
> error in the newer versions of pgSQL? If so, what is a valid substitution.

This is a syntax "error" in Perl (assuming Ikonboard is a Perl app; it's hard to
see from their homepage) of the kind you get when interpolating a hash
reference where a scalar value is expected, e.g.:

  perl -e '%a = (); print \%a;'

You'll need to find the offending section of the code and work out
what's gone wrong; also "TOPIC_ID" seems to be missing a value.

Possibly - and this is speculation - a preceding query has thrown
an error which the app isn't dealing with (e.g. due to some change in
PostgreSQL between 7.2 and 7.4, possibly a "LIMIT x,y" type clause
or an attempt to insert a value which is longer than the database field
etc.) and this is causing the insertion of invalid values in the
above statement.

Ian Barwick

Re: Hash problem

From
Kaloyan Iliev Iliev
Date:
Hi Madison,

When you migrate from PG7.2 to PG7.4 didn't you change the Perl too.
When we migrate the PG, we also change the OS verison and the Perl and
etc. So this may be Perl migration error. We have some in our own
scripts (from the same type you posted). As Ian says, you should check
the Perl code and how parameters form Perl were passed to Postgres.

Kaloyan

Madison Kelly wrote:

> Hi all,
>
>   I am back to trying to get the forum software called 'Ikonboard'
> working under postgres (it's advertised as being supported but the
> developers confirmed their pgSQL person left a while back).
>
>   At the moment I am (well, the program is) getting trying to perform
> this query:
>
> SELECT * FROM tf_forum_posts WHERE FORUM_ID = HASH(0x868d4e0) AND
> TOPIC_ID = AND QUEUED = '0' ORDER BY POST_DATE LIMIT 2;
>
> which throws this error:
>
> ERROR:  parser: parse error at or near "x868d4e0" at character 53
>
>   Most of the problems so far have stemmed from changes from (I think)
> pgSQL 7.2 (the last version the program was actively tested on) to
> 7.4. I have yet to test it under 8.0. Does this seem like an obvious
> syntax error in the newer versions of pgSQL? If so, what is a valid
> substitution.
>
>   Thanks a lot! (I'm not -quite- a n00b but I am still learning. :) )
>
> Madison
>