On Tue, Feb 3, 2009 at 7:00 AM, Devan Goodwin <[email protected]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hey guys, blocked on another spot in the installer and wanted to queue
> these items up for porting:
>
> Out of backend/satellite_tools/satCerts.py:
>
> _query_latest_version = rhnSQL.Statement("""
> SELECT nvl(version, 0) version, version orig_version, cert,
> TO_CHAR(issued, 'YYYY-MM-DD HH24:MI:SS') issued,
> TO_CHAR(expires, 'YYYY-MM-DD HH24:MI:SS') expires
> FROM rhnSatelliteCert
> WHERE label = :label
> ORDER BY version DESC NULLS LAST
> """)
>
> So rhnSatelliteCert needs some mappings, I think the TO_CHAR looks
> usable in PostgreSQL, is it just the nvl that needs to change here?
>
> You can see quite a few other queries in the file, I don't know how
> many of them are going to end up getting called but this is the first
> one I hit.
>
> Thoughts?
>
>
As Jan said, nvl() is provided by Orafce. But I'd recommend using ANSI
standard COALESCE() for the purpose as that is available in both Oracle and
Postgres.
BTW, I am more worried about the NULLS LAST part of the query. As I have
mentioned in the
Worklog<https://fedorahosted.org/spacewalk/wiki/PostgresWorklog>,
this feature is available in Postgres only since 8.3. And I have no freakin'
clue how to get the same behaviour in PG < 8.3!
It seems that the code which is using _query_latest_version actually
needs only one row (fetchone_dict()). Can this knowledge be used to get rid
of NULLS LAST somehow? (say we add version IS NOT NULL to the WHERE clasuse
and handle that in the calling function! just a thought)
Best regards,
--
gurjeet[[email protected]
EnterpriseDB http://www.enterprisedb.com
singh.gurj...@{ gmail | hotmail | indiatimes | yahoo }.com
_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel