dbTalk Databases Forums  

Re: XMIN/xid vs UNION

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss Re: XMIN/xid vs UNION in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Martijn van Oosterhout
 
Posts: n/a

Default Re: XMIN/xid vs UNION - 10-29-2004 , 10:52 AM






Try a cast, or just use UNION ALL

On Fri, Oct 29, 2004 at 04:44:37PM +0200, Karsten Hilbert wrote:
Quote:
Dear all,

some of my views are created with help of the UNION operator.
Now, I also need to include the base table XMIN system column
into those views. Which works fine (as long as I alias them)
except that UNION does an internal sort. My PG version (7.4)
complains about not being able to find a sort operator for
data type XID (of which XMIN is).

Searching the web unearthes a solution for loading those
missing operators for as early as 6.4.1 (1998) !

http://archives.postgresql.org/pgsql...1/msg00096.php

Strangely enough I see those operators listed in the release
notes for 7.2 ...

http://www.postgresql.org/docs/7.2/i...lease-7-2.html

Are those operators included in PG > 7.4 ? Should they be ? Is
it my version that's compiled without them, perhaps ?

Thanks,
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org
--
Martijn van Oosterhout <kleptog (AT) svana (DOT) org> http://svana.org/kleptog/
Quote:
Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
tool for doing 5% of the work and then sitting around waiting for someone
else to do the other 95% so you can sue them.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFBgmdTY5Twig3Ge+YRArYjAJ9VXQ5rKhvcutM0uusgU5 NXu/g8CACg2gLH
WivWg6V52cnXFrvl2Bp01co=
=l9YH
-----END PGP SIGNATURE-----



Reply With Quote
  #2  
Old   
Karsten Hilbert
 
Posts: n/a

Default Re: XMIN/xid vs UNION - 10-29-2004 , 04:51 PM






Quote:
Try a cast, or just use UNION ALL
Thanks.

Casting didn't work (it was missing the proper cast function
from xid to int4) but using UNION ALL worked. This was also
possible to use in my case since both parts of the UNION do
indeed return distinct sets of rows so UNION ALL does not
produce duplicates.

However, the question still holds true: Is there any
particular reason those operators aren't found in my PG
installation despite being listed as added since 7.2 ?
IOW why does
select 1::xid::int2/int4/int8
fail (on 7.4) despite 7.2 docs suggesting it should work ?

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org



Reply With Quote
  #3  
Old   
Tom Lane
 
Posts: n/a

Default Re: XMIN/xid vs UNION - 10-29-2004 , 05:27 PM



Karsten Hilbert <Karsten.Hilbert (AT) gmx (DOT) net> writes:
Quote:
However, the question still holds true: Is there any
particular reason those operators aren't found in my PG
installation despite being listed as added since 7.2 ?
The only thing that was added in 7.2 was xid equality.

There was some talk recently of adding the other comparison operations,
but I'm not sure it's a good idea. For many purposes you'd want such
comparison operators to use the same semantics as TransactionIdPrecedes
(ie, compare mod 2^31) but that would mean that some of the usual
arithmetic laws break down (no transitive law, no triangle inequality)
and in particular you could not sort or build a btree index with such
operators. Which in turn means that you still wouldn't get the behavior
you wanted of having UNION or ORDER BY "just work".

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.