Re: Using JSONB directly from application

2018-06-22 Thread Nico Williams
On Mon, Feb 26, 2018 at 09:36:52PM +0800, Craig Ringer wrote: > On 26 February 2018 at 04:05, Anthony Communier > wrote: > > It would be nice if application connected to a Postrgesql database could > > send and receive JSONB in binary. It could save some useless text > > conversion. All works coul

Re: NetBSD vs libxml2

2018-08-13 Thread Nico Williams
On Mon, Aug 13, 2018 at 11:16:23AM -0400, Tom Lane wrote: > Well, the issue is that new kinds of switches introduce new potential > for bugs. In the case of -Wl,-R..., I'm not even sure that you can > write that more than once per link, so absorbing one from xml2-config > might well break things o

Re: libpq should not look up all host addresses at once

2018-08-14 Thread Nico Williams
On Tue, Aug 14, 2018 at 03:18:32PM -0400, Garick Hamlin wrote: > On Tue, Aug 14, 2018 at 12:24:32PM +0200, Fabien COELHO wrote: > > I read the rational of the host/hostaddr artificial mapping. I cannot say > > I'm thrilled with the result: I do not really see a setting where avoiding a > > DNS quer

Re: Facility for detecting insecure object naming

2018-08-14 Thread Nico Williams
On Tue, Aug 14, 2018 at 03:00:55PM +, Robert Haas wrote: > The more I think about it, the more I think having a way to set a > lexically-scoped search path is probably the answer. [...] Yes please! This is what I want. Evaluate the search_path at function definition time, and record code wi

Re: Facility for detecting insecure object naming

2018-08-15 Thread Nico Williams
On Tue, Aug 14, 2018 at 11:50:24PM +, Nasby, Jim wrote: > On Aug 14, 2018, at 4:01 PM, Nico Williams wrote: > > > > On Tue, Aug 14, 2018 at 03:00:55PM +, Robert Haas wrote: > >> The more I think about it, the more I think having a way to set a > >>

Re: C99 compliance for src/port/snprintf.c

2018-08-15 Thread Nico Williams
There's also clang on Windows, which VS apparently supports. With clang on Windows PG could even make use of GCC/Clang C extensions :^)

Re: Allowing printf("%m") only where it actually works

2018-08-18 Thread Nico Williams
On Sat, Aug 18, 2018 at 04:34:50PM -0400, Tom Lane wrote: > So now I'm about ready to propose that we just *always* use > snprintf.c, and forget all of the related configure probing. Yes. > This'd have some advantages, notably that we'd get the > useful_strerror() behavior in frontend as well as

Re: Allowing printf("%m") only where it actually works

2018-08-19 Thread Nico Williams
On Sun, Aug 19, 2018 at 01:15:58AM -0400, Tom Lane wrote: > Nico Williams writes: > > On Sat, Aug 18, 2018 at 04:34:50PM -0400, Tom Lane wrote: > >> So now I'm about ready to propose that we just *always* use > >> snprintf.c, and forget all of the related configur

Re: proposal: schema private functions

2018-08-23 Thread Nico Williams
Couldn't this be handled by having a new permission on FUNCTIONs ("CALL"?) to distinguish EXECUTE? This would have to be made backwards-compatible, possibly by automatically granting CALL ON ALL FUNCTIONS to public at schema create time and/or PG upgrade time, which the schema owner could then REV

Re: pg16 && GSSAPI && Heimdal/Macos

2025-04-07 Thread Nico Williams
On Wed, Dec 06, 2023 at 10:57:15PM -0500, Tom Lane wrote: > The immediate reason for dropping that support is that Heimdal doesn't > have gss_store_cred_into(), without which we can't support delegated > credentials. AFAICT, Apple's version doesn't have that either. > We could argue about how impo

Re: pg16 && GSSAPI && Heimdal/Macos

2025-04-07 Thread Nico Williams
On Tue, Apr 08, 2025 at 02:18:40AM -0400, Tom Lane wrote: > Nico Williams writes: > > Heimdal in the master branch sure does; I'm the author if > > gss_store_cred_into() and gss_store_cred_into2(). Idk when we'll do an > > 8.0 release though. We've run o

Re: pg16 && GSSAPI && Heimdal/Macos

2025-04-07 Thread Nico Williams
On Wed, Dec 06, 2023 at 10:57:15PM -0500, Tom Lane wrote: > The immediate reason for dropping that support is that Heimdal doesn't > have gss_store_cred_into(), without which we can't support delegated > credentials. AFAICT, Apple's version doesn't have that either. > We could argue about how impo

Re: Feature freeze

2025-04-09 Thread Nico Williams
On Tue, Apr 08, 2025 at 11:24:39AM -0500, Nathan Bossart wrote: > I always forget if AoE is UTC+12 or UTC-12. [...] One isn't supposed to think "is the freeze on everywhere", just "is the freeze on for me" and "is the freeze on for this particular contribution (check the date header)". Nico --

Re: pg16 && GSSAPI && Heimdal/Macos

2025-04-10 Thread Nico Williams
On Wed, Dec 06, 2023 at 06:54:22PM -0500, kov...@omniscient.com wrote: > I wanted to follow up on the decision to blow off Apple's built-in > GSSAPI. Years back, for reasons I never found, Apple switched from MIT > to Heimdal and have been maintaining their own version of it. I'm not > clear how

Re: AIO writes vs hint bits vs checksums

2025-04-01 Thread Nico Williams
On Wed, Oct 30, 2024 at 02:16:51PM +0200, Heikki Linnakangas wrote: > Acquiring the exclusive lock in step 4 is just a way to wait for all the > existing share-lockers to release the lock. You wouldn't need to block new > share-lockers. We have LW_WAIT_UNTIL_FREE, which is almost what we need, but

Re: Remove restrictions in recursive query

2025-03-28 Thread Nico Williams
On Thu, Mar 27, 2025 at 12:37:53PM -0400, Robert Haas wrote: > A recursive CTE effectively takes two queries that will be run as > arguments. For some reason, instead of choosing syntax like WITH > RECURSIVE t1 AS BASE_CASE (initial_query) RECURSIVE_CASE > (iterated_query), somebody chose WITH RECU

Re: Giving the shared catalogues a defined encoding

2025-04-17 Thread Nico Williams
On Tue, Dec 10, 2024 at 02:29:09AM +1300, Thomas Munro wrote: > Here are some things I have learned about pathname encoding: > > * Some systems enforce an encoding: macOS always requires UTF-8, ext4 > does too if you turn on case insensitivity, zfs has a utf8only option, > and a few less interesti

Re: Wrong security context for deferred triggers?

2025-04-15 Thread Nico Williams
On Mon, Nov 06, 2023 at 02:23:04PM +0100, Laurenz Albe wrote: > SET CONSTRAINTS ALL DEFERRED; Some years ago I wrote and submitted a patch to allow one to create constraints that are ALWAYS DEFERRED so that they cannot be made IMMEDIATE with SET CONSTRAINTS ALL IMMEDIATE. I do think that one cou

Re: protocol support for labels

2025-03-11 Thread Nico Williams
On Tue, Mar 11, 2025 at 05:23:14PM +0100, Frits Hoogland wrote: > The usecase that I think might be useful is to have a database client send > metadata along with a query. > This partially is possible today by setting application_name, but that is a > separate request, it would be great if that c

Re: protocol support for labels

2025-03-13 Thread Nico Williams
On Wed, Mar 12, 2025 at 11:39:57PM -0700, Jeremy Schneider wrote: > Isn't multiple queries in one packet only possible with the simple > protocol, but not possible with the extended protocol? So this would be > entirely incompatible with prepared/parameterized statements? It's TCP. Packet and seg

Re: Proposal: Exploring LSM Tree‑Based Storage Engine for PostgreSQL (Inspired by MyRocks)

2025-05-12 Thread Nico Williams
On Sun, May 11, 2025 at 11:06:00AM -0700, Manish Rai Jain wrote: > The motivation stems from the well‑known write‑amplification issues > with B‑trees under high write throughput. An LSM‑based engine could > offer: Consider the ZFS copy-on-write b-tree-ish design, which has _even more_ write amplif

Re: Should we optimize the `ORDER BY random() LIMIT x` case?

2025-05-16 Thread Nico Williams
On Fri, May 16, 2025 at 09:01:50AM -0400, Tom Lane wrote: > Seems to me the obvious answer is to extend TABLESAMPLE (or at least, some > of the tablesample methods) to allow it to work on a subquery. The key here is that we need one bit of state between rows: the count of rows seen so far.

Re: Should we optimize the `ORDER BY random() LIMIT x` case?

2025-05-16 Thread Nico Williams
On Fri, May 16, 2025 at 11:10:49PM +0200, Vik Fearing wrote: > Isn't this a job for ? > > Example: > > SELECT ... > FROM ... JOIN ... > FETCH SAMPLE FIRST 10 ROWS ONLY > > Then the nodeLimit could do some sort of reservoir sampling. The query might return fewer than N rows. What reservoir samp

Re: Should we optimize the `ORDER BY random() LIMIT x` case?

2025-05-16 Thread Nico Williams
On Thu, May 15, 2025 at 02:41:15AM +0300, Aleksander Alekseev wrote: > SELECT t.ts, t.city, t.temperature, h.humidity > FROM temperature AS t > LEFT JOIN LATERAL > ( SELECT * FROM humidity > WHERE city = t.city AND ts <= t.ts > ORDER BY ts DESC LIMIT 1 > ) AS h ON TRUE > WHERE t.ts < '2

Re: Violation of principle that plan trees are read-only

2025-05-20 Thread Nico Williams
On Mon, May 19, 2025 at 08:41:06AM -0400, Isaac Morland wrote: > I assume this question has an obvious negative answer, but why can't we > attach const declarations to the various structures that make up the plan > tree (at all levels, all the way down)? I know const doesn't actually > prevent a va

Re: Should we optimize the `ORDER BY random() LIMIT x` case?

2025-05-19 Thread Nico Williams
On Mon, May 19, 2025 at 01:25:00PM +0300, Aleksander Alekseev wrote: > I agree this would be most convenient for the user. Unfortunately this > will require us to check every SELECT query: "oh, isn't it by any > chance ORDER BY random() LIMIT x?". I don't think we can't afford such > a performance

Re: Should we optimize the `ORDER BY random() LIMIT x` case?

2025-05-19 Thread Nico Williams
On Mon, May 19, 2025 at 10:38:19AM -0500, Nico Williams wrote: > On Mon, May 19, 2025 at 01:25:00PM +0300, Aleksander Alekseev wrote: > > I agree this would be most convenient for the user. Unfortunately this > > will require us to check every SELECT query: "oh, isn't it b

<    1   2