From: | Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> |
---|---|
To: | Aleksander Alekseev <aleksander(at)timescale(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Michael Paquier <michael(at)paquier(dot)xyz> |
Subject: | Re: [PATCH] Add get_bytes() and set_bytes() functions |
Date: | 2025-03-01 11:30:47 |
Message-ID: | CAEZATCUQhKQ+i-R2ELvNL4YFKq68Qb4QUNpa-zYFZF2OeoQp=w@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Fri, 24 Jan 2025 at 13:00, Aleksander Alekseev
<aleksander(at)timescale(dot)com> wrote:
>
> Thank you. Here is the corrected patch.
>
This looks pretty good to me. I have a just a couple of minor comments:
* The loop in bytea_integer() can be written more simply as a "for"
loop. Given that it's only a few lines of code, it might as well just
be coded directly in each cast function, which avoids the need to go
via a 64-bit integer for every case. In addition, it should use the
BITS_PER_BYTE macro rather than "8". Doing that leads to code that's
consistent with bittoint4() and bittoint8().
* In pg_proc.dat, it's not necessary to write "proleakproof => 'f'",
because that's the default, and no other function does that.
* I think it's worth using slightly more non-trivial doc examples,
including positive and negative cases, to make the behaviour more
obvious.
* I also tweaked the regression tests a bit, and copied the existing
test style which displays both the expected and actual results from
each test.
With those updates, I think this is ready for commit, which I'll do in
a day or two, if there are no further comments.
Regards,
Dean
Attachment | Content-Type | Size |
---|---|---|
v10-0001-Allow-casting-between-bytea-and-integer-types.patch | text/x-patch | 12.1 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Alena Rybakina | 2025-03-01 11:39:11 | Re: Replace IN VALUES with ANY in WHERE clauses during optimization |
Previous Message | Ryo Kanbayashi | 2025-03-01 10:45:15 | Re: [PATCH] Add regression tests of ecpg command notice (error / warning) |