Re: Idea: Add first() and last() aggregate functions to the main release

2023-03-11 Thread Erwin Brandstetter
On Sat, 11 Mar 2023 at 23:38, Ben Clements wrote: > Idea/request for enhancement: > > Add the first() and last() aggregate functions to the main release (CREATE > EXTENSION first_last_agg). > > Use Case: PostgreSQL equivalent to Oracle's MAX(...) KEEP (DENSE_RANK > FIRST/LAST ORDER BY ...)

Re: Fast, stable, portable hash function producing 4-byte or 8-byte values?

2019-12-11 Thread Erwin Brandstetter
On Tue, Dec 10, 2019 at 11:34 PM Miles Elam wrote: > In terms of "wasted computation", MD5, SHA1, and the others always compute > the full length before they are passed to a UUID, int, or whatever. It's a > sunk cost. It's also a minor cost considering many hash algorithms are > performed in CPU

Re: Fast, stable, portable hash function producing 4-byte or 8-byte values?

2019-12-11 Thread Erwin Brandstetter
s Erwin On Tue, Dec 10, 2019 at 11:13 PM Laurenz Albe wrote: > On Tue, 2019-12-10 at 22:11 +0100, Erwin Brandstetter wrote: > > I am looking for stable hash functions producing 8-byte or 4-byte hashes > from long text values in Postgres 10 or later. > > > > [...] > >

Fast, stable, portable hash function producing 4-byte or 8-byte values?

2019-12-10 Thread Erwin Brandstetter
I am looking for stable hash functions producing 8-byte or 4-byte hashes from long text values in Postgres 10 or later. There is md5(), the result of which can be cast to uuid. This reliably produces practically unique, stable 16-byte values. I have usecases where an 8-byte or even 4-byte hash wo

Re: Can functions containing a CTE be PARALLEL SAFE?

2019-10-17 Thread Erwin Brandstetter
Makes sense, thanks for the confirmation. Maybe clarify in the manual? Regards Erwin On Thu, Oct 17, 2019 at 11:20 AM Tom Lane wrote: > Erwin Brandstetter writes: > >> The following operations are always parallel restricted. > >> - Scans of common table expressions (

Can functions containing a CTE be PARALLEL SAFE?

2019-10-16 Thread Erwin Brandstetter
ld the new inlining of CTEs in Postgres 12 have any role in this? I posted a [similar question on dba.SE][4]. Regards Erwin Brandstetter [1]: https://www.postgresql.org/docs/12/parallel-safety.html [2]: https://www.postgresql.org/docs/12/parallel-safety.html#PARALLEL-LABELING [3]: https://www.po

EXCLUDE USING hash(i WITH =)

2019-03-06 Thread Erwin Brandstetter
The manual currently advises: https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-EXCLUDE EXCLUDE [ USING *index_method* ] ( *exclude_element* WITH *operator* [, ... > ] ) *index_parameters* [ WHERE ( *predicate* ) ][...]Although it's > allowed, there is little point in us

How to reply to an existing bug?

2018-05-27 Thread Erwin Brandstetter
I found an existing bug report and have something to add to it. What's the best way to reply to it? Just using a browser, with no newsreader installed. This one: https://www.postgresql.org/message-id/flat/20170925084522.1442.32786%40wrigleys.postgresql.org#20170925084522.1442.32...@wrigleys.postg