Skip site navigation (1) Skip section navigation (2)

cosmetic patch to large object regression test

From: Jeremy Drake <pgsql(at)jdrake(dot)com>
To: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: cosmetic patch to large object regression test
Date: 2007-03-02 21:47:50
Message-ID: Pine.BSO.4.64.0703021339260.18849@resin.csoft.net (view raw or flat)
Thread:
Lists: pgsql-patches
Since I have now learned that it is possible to input values in hex in
postgres, I submit this patch to clean up the ugly workaround I did in the
largeobject regression test to try to input hex values.  It does not
change the functionality of the test at all, it just makes it more
readable.

In detail, before when I needed to write hex values, for example
0x20000 | 0x40000,
for the flags to lo_open, I would write it:
CAST((2 | 4) * 16^4 AS integer)

Now, I write it:
CAST(x'20000' | x'40000' AS integer)

which is more like the C and other language consumers of the API, and also
is more obvious what I am trying to do, IMHO.


-- 
Real Programs don't use shared text.  Otherwise, how can they use
functions for scratch space after they are finished calling them?

Attachment: largeobj-regress-hex-flags.patch
Description: text/plain (5.7 KB)

Responses

pgsql-patches by date

Next:From: Bruce MomjianDate: 2007-03-02 22:05:41
Subject: Re: [HACKERS] Deadlock with pg_dump?
Previous:From: Tom LaneDate: 2007-03-02 20:55:05
Subject: Re: [HACKERS] Deadlock with pg_dump?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group