Re: [HACKERS] MIN not defined for OID types - Mailing list pgsql-hackers

From Roland Roberts
Subject Re: [HACKERS] MIN not defined for OID types
Date
Msg-id x6yaryo8nu.fsf@tycho.rlent.pnet
Whole thread Raw
In response to Re: [HACKERS] MIN not defined for OID types  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
-----BEGIN PGP SIGNED MESSAGE-----

>>>>> "Thomas" == Thomas G Lockhart <lockhart@alumni.caltech.edu> writes:

    Thomas> Also, it's a bit hard to get too excited about a missing
    Thomas> feature to allow someone to "optimize a hack" Isn't that
    Thomas> like "patching a patch" or "fixing a repair"? :)

Yes, well, in this case, it comes about as a result of trying to make
something database independent.  Keystone has functions for both
PostgreSQL and MySQL, and the MySQL way of doing things seems to be
limitation.  As a result, the DB-independent code does a "select *
from <table>" then queries to find what the column names are.
Obviously, we don't need to do it that way with PostgreSQL.  My "hack"
was to change the query so it wouldn't pull back the whole table just
to find the column names, so I did a "select * from <table> where
oid=min(oid)".

I have no idea how useful the function is in general, but it still
seems like an obvious hole to not be able to ask what the min of a
numeric column is.  I can ask what the min(rowid) is in Oracle (but
don't get me started on Oracle's abysmal "support"...ack!).

roland
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQCVAwUBNfFfI+oW38lmvDvNAQFI4gP/cCV6JCVmyBiQQqB4GI4lRAMCdbfTI7Wi
4gtMrHqvy9ct6S2UKbXZFREfVduRzfM9kwxaEw6W5BbcXdaSKQCgoAQrhohMLRtq
IhcTT0CAqbYuF8oy0cxeHq7EI/nJumXhbxk11ZHFYwsxBFKoxjKqGuzP9GExiAQ5
P5y78KFJhzQ=
=NB6u
-----END PGP SIGNATURE-----
--
Roland B. Roberts, PhD                  Custom Software Solutions
roberts@panix.com                           101 West 15th St #4NN
                                               New York, NY 10011

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: new office webcam
Next
From: Roland Roberts
Date:
Subject: Re: [HACKERS] MIN not defined for OID types