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

Re: Two test failures on v16 (compared to v14)

2024-02-14 Thread Tom Lane
in v16, the loOpen fails, returning -1, while > it used to be OK. > So this must be a bug fix of some kind I guess. Using INV_READ fixed the > test. Yup, see commit 55f480278 regards, tom lane

Re: Safest pgupgrade jump distance

2024-02-12 Thread Tom Lane
ibility before making the change on your production database. There are likely to be a few gotchas. regards, tom lane

Re: Query hangs (and then timeout) after using COPY to import data

2024-02-11 Thread Tom Lane
ou use a cursor, and that doesn't always work well :-( regards, tom lane

Re: Error on create extension pgcrypto. Undefined symbol "EVP_bf_ecb"

2024-02-07 Thread Tom Lane
some false positives.) Alternatively, change your PATH to put /usr/local/bin in front of /usr/bin. regards, tom lane

Re: Improving pg_dump performance when handling large numbers of LOBs

2024-02-05 Thread Tom Lane
u could make that happen. In any case, more eyeballs reviewing that patchset would be welcome. regards, tom lane

Re: update schema table permission denied

2024-02-02 Thread Tom Lane
enied for table outbox_event You need SELECT privilege too in order to read the "id" column. regards, tom lane

Re: using palloc/pfree for OpenSSL allocations with CRYPTO_set_mem_functions

2024-02-01 Thread Tom Lane
her involves only free() operations and no other resources). I think the only real win we'd get from such a layer is that OpenSSL's allocations would be better exposed for accounting purposes, eg the pg_backend_memory_contexts view. That's not negligible, but I don't find it a compelling reason to do the work, either. regards, tom lane

Re: TableOID in description of inlined function

2024-02-01 Thread Tom Lane
uot;returns table(id int)" of the function, which has no associated table. regards, tom lane

Re: field error on refreshed materialized view

2024-01-27 Thread Tom Lane
hat and not rechecked the length while storing into the matview. Not sure if this behavior change was intentional or an accidental product of refactoring. regards, tom lane

Re: permission denied on socket

2024-01-25 Thread Tom Lane
Atul Kumar writes: > I checked the permissions on /tmp directory and it shows "drwxrwxrwt." > already, do I need to check something else as well ? That seems fine, but what about the socket file itself? regards, tom lane

Re: field error on refreshed materialized view

2024-01-25 Thread Tom Lane
ould be to remove or increase all the varchar limits in the matview declaration, load the data, and then probe for bad entries with something like "select * from matview where length(some_varchar_field) > 255". regards, tom lane

Re: permission denied on socket

2024-01-25 Thread Tom Lane
socket does not > exist? Nope, that should mean either that /tmp is not readable, or that the socket file is there but has restrictive permissions. That doesn't necessarily make Adrian's answer wrong though. regards, tom lane

Re:

2024-01-25 Thread Tom Lane
.00..1.05 rows=5 width=16) NOTICE:-> Hash (cost=1.05..1.05 rows=5 width=4) NOTICE: -> Seq Scan on int4_tbl (cost=0.00..1.05 rows=5 width=4) DO regards, tom lane

Re: undefined symbol when installing pgcrypto on 16.1

2024-01-24 Thread Tom Lane
eory, if you use --enable-depend, you needn't do "make clean". But I don't trust that a whole lot personally. I find that using ccache gets most of the win with fewer assumptions. regards, tom lane

Re: undefined symbol when installing pgcrypto on 16.1

2024-01-24 Thread Tom Lane
t in LIBS if you specified --with-openssl, but maybe it failed to. Can you check the configured value of LIBS (in src/Makefile.global) to see? If it's not there, it would be useful to see the contents of the config.log log file. regards, tom lane

Re: Daterange question

2024-01-19 Thread Tom Lane
tant which this isn't, nor does << have a negator operator that could allow the NOT to be simplified out. Wouldn't drange && daterange(CURRENT_DATE, NULL, '[)') serve the purpose? That should be indexable. regards, tom lane

Re: B-tree index balance?

2024-01-19 Thread Tom Lane
ow unbalanced they are? (Assume PG12+.) As far as I know, we don't have a problem of that sort. Continued insertions will eventually force a split of the root node, which will rebalance the tree. regards, tom lane

Re: Explain and filter over subplans

2024-01-18 Thread Tom Lane
ould print "(ALL t.a >= $0 FROM SubPlan 1)". Some of the other SubLinkTypes might be harder to represent in a way that makes sense to users. I made a quick-hack patch to play with, if you're interested. regards, tom lane diff --git a/src/backend/utils/adt/ru

Re: Tips on troubleshooting slow DELETE (suspect cascades)

2024-01-18 Thread Tom Lane
Jim Vanns writes: > I should have already stated I did begin with EXPLAIN but given they > don't easily work with (the internals) stored/procedures, it wasn't > useful in this case. auto_explain with nested statements enabled might help? regards, tom lane

Re: undefined symbol when installing pgcrypto on 16.1

2024-01-18 Thread Tom Lane
might matter for such a low-level failure as this. regards, tom lane

Re: Moving to Postgresql database

2024-01-17 Thread Tom Lane
Dominique Devienne writes: > On Tue, Jan 16, 2024 at 10:59 PM Tom Lane wrote: >> The problem is that now you have a switch somewhere (whether a GUC >> or something else, still a switch) that fundamentally changes the >> transactional semantics seen by applications

Re: Tips on troubleshooting slow DELETE (suspect cascades)

2024-01-16 Thread Tom Lane
;> confirm my suspicion - does anyone have any tips on that? > Explain: > https://www.postgresql.org/docs/current/sql-explain.html Specifically, if EXPLAIN ANALYZE shows a lot of time spent in the enforcement trigger for the FK, this is likely what's happening. regards, tom lane

Re: Moving to Postgresql database

2024-01-16 Thread Tom Lane
ken client code. regards, tom lane

Re: Why scan all columns when we select distinct c1?

2024-01-14 Thread Tom Lane
step won't really care. See use_physical_tlist() in createplan.c. What I'm confused about is why 9.4 didn't do the same. That optimization heuristic is very old, and certainly would be applied by 9.4 in some circumstances. Testing says the behavior in this specific case changed at 9.6. I'm not quite interested enough to drill down further... regards, tom lane

Re: COBOL PRECOMPILER for PostGreSQL

2024-01-12 Thread Tom Lane
uff might be needed in that infrastructure to make it work for a COBOL wrapper ... but I think somebody else has to take point on making that happen. regards, tom lane

Re: How much size saved by updating column to NULL ?

2024-01-12 Thread Tom Lane
ings -- we simply don't store anything for a null column). There's more detail at https://www.postgresql.org/docs/current/storage-page-layout.html regards, tom lane

Re: Time zone offset in to_char()

2024-01-11 Thread Tom Lane
format fields. As noted upthread, SET LOCAL together with a (dummy) "SET timezone" clause in the function definition can be used to get the effect of a function-local setting of the parameter. I don't know of another way to achieve that result above the C-code level. regards, tom lane

Re: undefined symbol when installing pgcrypto on 16.1

2024-01-11 Thread Tom Lane
Did you get any warnings during build? regards, tom lane

Re: ERROR: invalid byte sequence for encoding UTF8: 0x00

2024-01-09 Thread Tom Lane
umn. Check again. I am guessing that the OP tried to put a literal NUL character into the COPY data. A bytea value in COPY data needs to be text-encoded as per one of the alternatives explained in the manual. Alternatively, you could jump through the hoops involved in sending binary COPY data. regards, tom lane

Re: How to \ef a function ?

2024-01-08 Thread Tom Lane
like an oversight. regards, tom lane

Re: How to \ef a function ?

2024-01-08 Thread Tom Lane
code though. regards, tom lane

Re: Hard max_stack_depth / WIN32_STACK_RLIMIT PostgreSQL Windows Query

2024-01-05 Thread Tom Lane
umber and re-compile, or would that break other > things? A bit of "git blame" archaeology says that that traces back to commit bf7737a938827608ce79586efe55c642c1a4a7d3 Author: Tom Lane Date: Wed Jan 26 21:55:26 2005 + On Windows, set the postmaster executabl

Re: Need help

2023-12-29 Thread Tom Lane
egards, tom lane

Re: Increased storage size of jsonb in pg15

2023-12-29 Thread Tom Lane
regards, tom lane

Re: Query crash with 15.5 on debian bookworm/armv8

2023-12-25 Thread Tom Lane
ctual fix, perhaps a newer version of LLVM is needed? I don't see a problem testing this query on my RPI with Ubuntu 23.10 (LLVM 16). regards, tom lane

Re: Version 16.x search_path behavior change?

2023-12-24 Thread Tom Lane
o have an exception for that. regards, tom lane

  1   2   3   4   5   6   7   8   9   10   >