Re: prevent users from SELECT-ing from pg_roles/pg_database

2024-05-24 Thread Tom Lane
ying catalog. regards, tom lane

Re: Strange issue with unique index

2024-05-23 Thread Tom Lane
INITIALLY DEFERRED. regards, tom lane

Re: expected authentication request from server, but received H

2024-05-23 Thread Tom Lane
a dozen years ago, and anyway that particular problem required a server that is in dire straits. regards, tom lane

Re: Hash join and picking which result set to build the hash table with.

2024-05-22 Thread Tom Lane
ack of any) so that the planner knows that the column is unique and thus safe to use as a hash key. Now, it should have known that anyway, unless maybe this is a freshly-built table that auto-analyze hasn't gotten to yet? regards, tom lane

Re: Missed compiler optimization issue in function select_rtable_names_for_explain

2024-05-22 Thread Tom Lane
been zeroed by memset already, so I > don't see any value in the explicit assignments. I have to concede that it's unclear why we're filling just these fields explicitly and not any others. We're at least consistent: all the callers of select_rtable_names do it the same way. regards, tom lane

Re: search_path wildcard?

2024-05-22 Thread Tom Lane
any user with the wits to create a trojan-horse function or operator. Generally speaking, you want admins to run with a minimal search path not a maximal one. regards, tom lane

Re: search_path and SET ROLE

2024-05-22 Thread Tom Lane
wear there are no bugs in this area.) > Am I missing something, or is that PG's behavior? I bet what you missed is granting (at least) USAGE on the schema to that role. PG will silently ignore unreadable schemas when computing the effective search path. regards, tom lane

Re: Missed compiler optimization issue in function select_rtable_names_for_explain

2024-05-22 Thread Tom Lane
macros. Still not our problem.) regards, tom lane

Re: problem with query

2024-05-21 Thread Tom Lane
ptions. Also, as David already mentioned, ANALYZE on pg_class might help. regards, tom lane

Re: pg_dump and not MVCC-safe commands

2024-05-20 Thread Tom Lane
hat finds this to be unacceptable should probably not be using sequences. regards, tom lane

Re: utf8 vs UTF-8

2024-05-18 Thread Tom Lane
e to use whichever spelling you think is preferable; the strings appearing in datcollate and datctype aren't stored anywhere else. (But experiment in a scratch installation to verify that ... and don't try changing them to something that you don't know to be semantically equivalent.) regards, tom lane

Re: Left join syntax error

2024-05-18 Thread Tom Lane
t what is the syntactic precedence in FROM clauses. regards, tom lane

Re: utf8 vs UTF-8

2024-05-17 Thread Tom Lane
TBH, I doubt it's worth worrying about. regards, tom lane

Re: Seeing new stuff in log after upgrading from 11 to 15

2024-05-15 Thread Tom Lane
informational? This is checkpoint logging, which is on by default now (a decision I didn't particularly approve of). Feel free to set "log_checkpoints = off" if you don't want it. regards, tom lane

Re: Valid until

2024-05-14 Thread Tom Lane
at the *password* is not usable after the specified date. If the user logs in via some non-password-based authentication method, that's fine (and it's on the infrastructure of that auth method to enforce whatever restrictions it thinks are appropriate). regards, tom lane

Re: UTC is not a time zone?

2024-05-13 Thread Tom Lane
file, it caches that in a hash table that it will never flush (which is arguably a bug for other reasons, since those files aren't really immutable, but that's how it behaves today). So you've got 0 chance of hitting this via repeat SET TIMEZONE in a single backend. regards, tom lane

Re: UTC is not a time zone?

2024-05-13 Thread Tom Lane
Christophe Pettus writes: > On May 13, 2024, at 11:17, Tom Lane wrote: >> What's causing that I can't say. It doesn't look like we log the >> errno anywhere when failing to read a zone file :-( > File descriptor exhaustion? (Of course, that would mean something somewhere

Re: UTC is not a time zone?

2024-05-13 Thread Tom Lane
a parallel worker process, which'd have to read the file for itself during startup. What's causing that I can't say. It doesn't look like we log the errno anywhere when failing to read a zone file :-( regards, tom lane

Re: how to completely turn off statement error logging

2024-05-13 Thread Tom Lane
though. > I set "log_min_error_statement = panic" according to the docs: > To effectively turn off logging of failing statements, set this parameter to > PANIC. This setting controls whether the STATEMENT: detail is appended to a message, but not the basic choice of whether to emit the message.

Re: Feature Request: Option for TLS no SSLRequest with psql

2024-05-11 Thread Tom Lane
%40iki.fi regards, tom lane

Re: Unnecessary buffer usage with multicolumn index, row comparison, and equility constraint

2024-05-10 Thread Tom Lane
ost=0.43..4.45 rows=1 width=8) (actual time=0.001..0.002 rows=0 loops=1) Index Cond: ((a >= 123450) AND (a = 0)) Heap Fetches: 0 Planning: Buffers: shared hit=4 Planning Time: 0.081 ms Execution Time: 0.013 ms (7 rows) For that, it's able to see that the index conditions are contradictory, so it fetches no index pages whatever. regards, tom lane

Re: SELECT DISTINCT chooses parallel seqscan instead of indexscan on huge table with 1000 partitions

2024-05-10 Thread Tom Lane
Dimitrios Apostolou writes: > On Fri, 10 May 2024, Tom Lane wrote: >> I'd say the blame lies with that (probably-default) estimate of >> just 200 distinct rows. That means the planner expects to have >> to read about 5% (10/200) of the tables to get the result, and >&g

Re: SELECT DISTINCT chooses parallel seqscan instead of indexscan on huge table with 1000 partitions

2024-05-10 Thread Tom Lane
ve to read about 5% (10/200) of the tables to get the result, and that's making fast-start plans look bad. Possibly an explicit ANALYZE on the partitioned table would help. regards, tom lane

Re: Question regarding how databases support atomicity

2024-05-07 Thread Tom Lane
systems out there that would give you guarantees in this area, but it'd require non-POSIX and hence non-portable system calls. regards, tom lane

Re: Forcing INTERVAL days display, even if the interval is less than one day

2024-05-07 Thread Tom Lane
days ago", even when days ago is zero? > Explicitly casting "day to second" didn't work. to_char() could be your friend here. regards, tom lane

Re: \dt shows table but \d says the table doesn't exist ?

2024-05-03 Thread Tom Lane
docs closely enough to know the option exists, let alone that it will help them. But maybe there's more use-case than I'm thinking of. regards, tom lane

Re: \dt shows table but \d says the table doesn't exist ?

2024-05-03 Thread Tom Lane
"David G. Johnston" writes: > On Friday, May 3, 2024, Tom Lane wrote: >> By and large, I'd expect people using mixed-case table names to get >> accustomed pretty quickly to the fact that they have to double-quote >> those names in SQL. I don't see why it's a sur

Re: \dt shows table but \d says the table doesn't exist ?

2024-05-03 Thread Tom Lane
stomed pretty quickly to the fact that they have to double-quote those names in SQL. I don't see why it's a surprise that that is also true in \d commands. regards, tom lane

Re: Question regarding how databases support atomicity

2024-05-03 Thread Tom Lane
ctness problem, but we do have dead rows that must eventually get vacuumed away to prevent indefinite storage bloat. That can be done by background housekeeping processes though (a/k/a autovacuum). I believe Oracle, for one, actually does use UNDO. I don't know what they do about failure-to-UNDO. regards, tom lane

Re: How to Build Postgres in a Portable / Relocatable fashion?

2024-05-03 Thread Tom Lane
most Linux distros forbid static linking of libraries from different sources. regards, tom lane

Re: How to Build Postgres in a Portable / Relocatable fashion?

2024-05-03 Thread Tom Lane
ferent versions, different build options, yadda yadda. Maybe you should be thinking in terms of a docker container or the like? regards, tom lane

Re: \dt shows table but \d says the table doesn't exist ?

2024-05-03 Thread Tom Lane
since it's been marked up to be a regex I fear that'd introduce even more confusion than it solves. regards, tom lane

Re: \dt shows table but \d says the table doesn't exist ?

2024-05-03 Thread Tom Lane
/ Did not find any relation named "public.some_idIds". So it is in fact looking for public.some_idids. regards, tom lane

Re: Listing only the user defined types (with owners)

2024-05-02 Thread Tom Lane
ema", pg_catalog.format_type(t.oid, NULL) AS "Name", t.typname AS "Internal name", CASE WHEN t.typrelid != 0 THEN CAST('tuple' AS pg_catalog.text) WHEN t.typlen < 0 THEN CAST('var' AS pg_catalog.text) ELSE CAST(t.typlen AS pg_catalog.text) END

Re: Posgresql 14 and CarbonBlack on RHEL8?

2024-04-30 Thread Tom Lane
o aggressive about applying JIT. regards, tom lane

Re: Introduction of a new field in pg_class indicating presence of a large object in a table

2024-04-30 Thread Tom Lane
m containing any OIDs that *weren't* large object OIDs. Given that recording a large object OID elsewhere in the database is purely an application decision, I don't think there's a reasonable way for the system to track it. regards, tom lane

Re: is there an immutable function to switch from date to character?

2024-04-24 Thread Tom Lane
pretty safe: neither datestyle nor timezone should affect the timestamp-without-timezone variant of to_char(), and this particular format string doesn't depend on lc_time. regards, tom lane

Re: Password forgotten

2024-04-23 Thread Tom Lane
USER to reset the role's password. regards, tom lane

Re: altering a column to to make it generated

2024-04-22 Thread Tom Lane
> https://www.postgresql.org/docs/current/sql-altertable.html > And none seem to involve the generated expression column. So the answer is > no. I think what you'd need to do is drop the existing column and then add a generated column. regards, tom lane

Re: CLUSTER vs. VACUUM FULL

2024-04-22 Thread Tom Lane
Marcos Pegoraro writes: > But wouldn't it be good that VACUUM FULL uses that index defined by > Cluster, if it exists ? No ... what would be the difference then? regards, tom lane

Re: CLUSTER vs. VACUUM FULL

2024-04-21 Thread Tom Lane
surprised that's not noticeable in your test case. regards, tom lane

Re: error in trigger creation

2024-04-21 Thread Tom Lane
ll their commands. This might not even require malicious intent, merely faulty coding --- but the opportunity for malicious intent is staggeringly large. regards, tom lane

Re: query multiple schemas

2024-04-21 Thread Tom Lane
bit wasteful. But it'll likely outperform any other solution for the union queries. Notably, adding or deleting a partition would be much less painful than redefining a UNION ALL view. regards, tom lane

Re: error in trigger creation

2024-04-21 Thread Tom Lane
f you're letting a user that's not 100.00% trusted write event triggers. (Much less execute any SQL command whatsoever, which is what it sounds like David is suggesting you create a function to do.) regards, tom lane

Re: Not able to grant access on pg_signal_backend on azure flexible server

2024-04-19 Thread Tom Lane
n particular, it does not grant you any powers over installation-wide objects such as roles. regards, tom lane

Re: Why does it sort rows after a nested loop that uses already-sorted indexes?

2024-04-18 Thread Tom Lane
out ordering. regards, tom lane

Re: constant crashing

2024-04-14 Thread Tom Lane
have that suggests any plausible line of investigation towards a software problem. If we can see a crash stack trace or two, maybe that would change. regards, tom lane

Re: constant crashing

2024-04-14 Thread Tom Lane
finitions. Or ... do you have any PG extensions installed? regards, tom lane

Re: constant crashing

2024-04-14 Thread Tom Lane
se it'd show up as the backend dying from SIGKILL). regards, tom lane

Re: constant crashing

2024-04-14 Thread Tom Lane
8G RAM, but maybe something is misconfigured to give up way below that. In any case, you'll never find the cause from the client side. > Last attempts have been with ubuntu 22.04.04 and postgreSQL 16. 16 dot which? regards, tom lane

Re: (When) can a single SQL statement return multiple result sets?

2024-04-11 Thread Tom Lane
Thomas Kellerer writes: > Tom Lane schrieb am 11.04.2024 um 01:02: >> Jan Behrens writes: >>> While writing a PostgreSQL client library for Lua supporting >>> Pipelining (using PQsendQueryParams), I have been wondering if there >>> are any single SQL comma

Re: (When) can a single SQL statement return multiple result sets?

2024-04-10 Thread Tom Lane
that in other RDBMSes and probably somebody will be motivated to make it possible in Postgres. regards, tom lane

Re: Two server instances on one server

2024-04-10 Thread Tom Lane
memory > using numactl (or similar commands regarding cpuset) and partitioning. Seems straightforward enough to me, as long as you put the instances onto distinct port numbers. Are you encountering problems? regards, tom lane

Re: Failure of postgres_fdw because of TimeZone setting

2024-04-10 Thread Tom Lane
t do leap seconds.) The real number of distinct zones in a standard tzdata file set these days is a shade under 600. regards, tom lane

Re: Failure of postgres_fdw because of TimeZone setting

2024-04-10 Thread Tom Lane
Adnan Dautovic writes: > On 05. Apr 2024, at 16:13, Tom Lane wrote: >> Out of curiosity, does >> SET timezone to 'GMT'; >> work? > Yes, it yields: >> SET >> >> Query returned successfully in 84 msec. I expected that, because the name &qu

Re: mystery with postgresql.auto.conf

2024-04-10 Thread Tom Lane
ce about it until you did a postmaster restart. regards, tom lane

Re: [Code: 0, SQL State: 0A000] when "typing" from pg_catalog

2024-04-09 Thread Tom Lane
gt; PG_CATALOG.PG_ROLES.ROLNAME%type Exactly. The %type bit is important. regards, tom lane

Re: Issue with date/timezone conversion function

2024-04-09 Thread Tom Lane
esql.org/docs/current/datatype-datetime.html#DATATYPE-TIMEZONES regards, tom lane

Re: prepared statement "cu1" already exists (but it does not)

2024-04-09 Thread Tom Lane
ich is a thin wrapper over the wire-protocol Parse command). There is a different namespace for cursors. Cursors do share that namespace with the wire-protocol "portal" concept, but libpq doesn't directly expose portals. regards, tom lane

Re: prepared statement "cu1" already exists (but it does not)

2024-04-08 Thread Tom Lane
same "portal" namespace. regards, tom lane

Re: Query regarding functions of postgres

2024-04-07 Thread Tom Lane
t unexpected times --- for instance, it might appear once during the planner's constant-folding phase, even though naive interpretation of the query suggests that it should appear many times or not at all. But beyond that possible POLA violation, neither of these functions will bother Postgres any. regards, tom lane

Re: pg_dumpall - restoration problem

2024-04-06 Thread Tom Lane
ng to restore onto a different OS platform with different locale naming conventions. The easiest way to deal with it probably is to edit the dump file and change "C.UTF-8" to "C.UTF8" everywhere. (Manually editing an 8G dump file might be no fun, but "sed" should make short work of it.) regards, tom lane

Re: Failure of postgres_fdw because of TimeZone setting

2024-04-05 Thread Tom Lane
y a fair number of entries in that have gone missing. Postgres itself would never modify that data after installation, so we're left to speculate about filesystem corruption or somebody's odd desire to remove "unnecessary" files. Out of curiosity, does SET timezone to 'GMT'; work? regards, tom lane

Re: What permissions are required for e.g. EXPLAIN UPDATE ...

2024-04-04 Thread Tom Lane
ot requiring there to be different code paths for EXPLAIN and normal query running in various places. regards, tom lane

Re: Failure of postgres_fdw because of TimeZone setting

2024-04-03 Thread Tom Lane
lling to work on fixing it, I suggest finding a job where you don't have to deal with that. regards, tom lane

Re: How to interpret 'depends on' errors in pg_restore?

2024-03-28 Thread Tom Lane
Fire Emerald writes: > The partitioning must be the problem somehow. [ shrug... ] You're still not providing any details that would let somebody else reproduce or diagnose the problem. https://wiki.postgresql.org/wiki/Guide_to_reporting_problems regards, tom lane

Re: Problems caused by type resolution for the unknown type

2024-03-28 Thread Tom Lane
ed on Microsoft SQL Server. SQL Server doesn't need to worry about an extensible type system. regards, tom lane

Re: How to interpret 'depends on' errors in pg_restore?

2024-03-28 Thread Tom Lane
hat FK constraints are satisfied on-the-fly. regards, tom lane

Re: After 10 -> 15 upgrade getting "cannot commit while a portal is pinned" on one python function

2024-03-27 Thread Tom Lane
them", and that the reason your code is failing is that there's still a reference to the PLyCursor somewhere after the plpython function exits, perhaps in a Python global variable. regards, tom lane

Re: Use of max_slot_wal_keep_size parameter

2024-03-26 Thread Tom Lane
Don Seiler writes: > On Tue, Mar 26, 2024 at 9:09 AM Tom Lane wrote: >> ... So you could overshoot the specified target by >> more or less the amount of WAL that could be emitted between two >> checkpoints. Perhaps it's tighter nowadays, but I really doubt that >>

Re: Use of max_slot_wal_keep_size parameter

2024-03-26 Thread Tom Lane
t's tighter nowadays, but I really doubt that it's exact-to-the-kilobyte-at-all-times. regards, tom lane

Re: No warning for a no-op REVOKE

2024-03-25 Thread Tom Lane
s that we should warn only when the command is a complete no-op, that is none of the mentioned privileges matched. But I've not thought about it very hard. regards, tom lane

Re: Is this a buggy behavior?

2024-03-24 Thread Tom Lane
ne should get notified of. To do that, we'd have to remember that you'd said NULL, which we don't: the word is just discarded as a noise clause. Considering that this usage of NULL isn't even permitted by the SQL standard, that seems like a bit too much work. regards, tom lane

Re: Seq scan vs index scan

2024-03-22 Thread Tom Lane
hat the planner does with a small table is what it will do with a large table.) regards, tom lane

Re: soft lockup - CPU#16 stuck for 3124s! [postmaster:2273]

2024-03-22 Thread Tom Lane
CPU#25 stuck for 3121s! [migration/25:166] Sounds like failing hardware to me :-( regards, tom lane

Re: pg_locks-exclusivelock for select queries

2024-03-22 Thread Tom Lane
ble, only with the transaction's own existence. It can't conflict when acquired, because the virtual XID is unique (at least across existing sessions). It exists so that other sessions can wait for this one if needful, by trying to take share lock on the virtualxid. regards, tom lane

Re: After 10 -> 15 upgrade getting "cannot commit while a portal is pinned" on one python function

2024-03-20 Thread Tom Lane
Adrian Klaver writes: > Haven't had a chance to go through this yet. I'm going to say though > that Tom Lane is looking for a shorter generic case that anyone could > run on their system. Yeah, it's a long way from that trigger function definition to a working (i.e. failing

Re: After 10 -> 15 upgrade getting "cannot commit while a portal is pinned" on one python function

2024-03-20 Thread Tom Lane
ined example that triggers this? regards, tom lane

Re: How to store in hours:minutes:seconds where hours may be bigger than 24

2024-03-19 Thread Tom Lane
regards, tom lane

Re: set local statement_timeout within a stored procedure

2024-03-19 Thread Tom Lane
untdown is already running (or not) for the current command, and it's too late to change it with effect for that command. regards, tom lane

Re: Implementing product-aggregate

2024-03-14 Thread Tom Lane
lot of decimal places by the end of the query, I fear. regards, tom lane

Re: Seeing high query planning time on Azure Postgres Single Server version 11.

2024-03-09 Thread Tom Lane
hassan rafi writes: > The issue of high query planning time seems to intermittently resolve > itself, only to reoccur after a few hours. I wonder if you are running into the lack of this fix: Author: Tom Lane Branch: master Release: REL_16_BR [9c6ad5eaa] 2022-11-22 14:40:20 -0500

Re: Thoughts on user-defined types for talk at Postgres conference?

2024-03-07 Thread Tom Lane
that, it wouldn't be terribly practical to insist on creating a separate copy of record_out (and every other function that accepts composite types) just so that it could have a hard-wired notion of what rowtype it's going to deal with. regards, tom lane

Re: Thoughts on user-defined types for talk at Postgres conference?

2024-03-06 Thread Tom Lane
n't say that these problems are insoluble, but they do look pretty difficult. regards, tom lane

Re: postgres_fdw aggregate pushdown for group by with expressions

2024-03-04 Thread Tom Lane
this rule is applied after constant-folding, so that what we're left with is normally going to contain variables at every level. extract() is problematic because it combines a text constant with a datetime (collation-less) variable. regards, tom lane

Re: When manual analyze is needed

2024-03-03 Thread Tom Lane
ortant for performance. regards, tom lane

Re: postgres_fdw aggregate pushdown for group by with expressions

2024-03-03 Thread Tom Lane
proving that mess sometime. One thought that comes to mind is to have a server option authorizing postgres_fdw to believe that all local collations exist on the remote side. regards, tom lane

Re: Content for talk on Postgres Type System at PostgresConf

2024-02-29 Thread Tom Lane
s still a Frickin Lot Of Money in any non-hyperinflated currency, but it's the sort of restriction that banks don't like to hear of. regards, tom lane

Re: Non-Stored Generated Columns

2024-02-28 Thread Tom Lane
aurenz that it's hard to see much use-case here that's not sufficiently covered already. regards, tom lane

Re: PQftype(copy_rset) returns zero OIDs???

2024-02-27 Thread Tom Lane
pyOutResponse messages don't carry any column name or type indications, so yes it's normal. https://www.postgresql.org/docs/current/protocol-message-formats.html Maybe we missed a bet there, but AFAIR you are the first person to ask for this in twenty-plus years. regards, tom lane

Re: pPL/pgSQL restriction on characters for copying types?

2024-02-26 Thread Tom Lane
umn not existing. Maybe it's okay to let plpgsql_parse_wordtype etc throw the error for themselves, though. regards, tom lane

Re: Clarity regarding the procedures call in postgresql for public and non-public schema

2024-02-26 Thread Tom Lane
uld be explained if the users have different search paths. regards, tom lane

Re: pPL/pgSQL restriction on characters for copying types?

2024-02-26 Thread Tom Lane
ot about the special characters in the names, rather about search_path not including the NODE⠒V view. Consider schema-qualifying the view name, or attaching a "SET search_path" clause to the function. regards, tom lane

Re: Fwd: Unexpected Multiple Records from Randomized Query

2024-02-23 Thread Tom Lane
x WHERE name = 'User '||trunc(r*100) ; or in this case better to shove the whole constant computation into the CTE. regards, tom lane

Re: How to schema-qualify "IS DISTINCT FROM" on trigger definition? (I created a db that cannot be dump/restored)

2024-02-21 Thread Tom Lane
But it hasn't gotten further than preliminary discussion. For the moment, I think the only feasible solution is for your trigger function to set the search path it needs by adding a "SET search_path = whatever" clause to the function's CREATE command. regards, tom lane

Re: Question on Table creation

2024-02-20 Thread Tom Lane
the quotes from the schema owner. I'd advise reading this section carefully: https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS Notably, the advice to "always quote a particular name or never quote it" could be a useful rule for you here. regards, tom lane

Re: Function inserting into tstzrange ? (syntax error at or near...)

2024-02-18 Thread Tom Lane
e(p_start_time,p_end_time)) ... regards, tom lane

Re: Version 6 binaries for RHEL 7

2024-02-17 Thread Tom Lane
of thing is one of the fundamental advantages that open-source distros have over closed-source ones, so you shouldn't ignore it. regards, tom lane

Re: Query regarding function cleanup in extension upgrade path

2024-02-14 Thread Tom Lane
he diff between the .out files isn't pretty self-explanatory, you can try checking the git log for the "_1.out" file to see why it was created. regards, tom lane

Re: Query regarding function cleanup in extension upgrade path

2024-02-14 Thread Tom Lane
version of the extension's SQL declarations. Those are likely to remain there indefinitely. regards, tom lane

  1   2   3   4   5   6   7   8   9   10   >