Re: Upgrading error

2022-10-23 Thread Tom Lane
;s something that kept it from starting, but there's no evidence offered here about what. regards, tom lane

Re: EXPLAIN ANALYZE does not return accurate execution times

2022-10-27 Thread Tom Lane
an example, using psql -c '\pset format unaligned' -c "SELECT * FROM unary" -o /dev/null this example drops from ~16s to ~1.7s on my machine. regards, tom lane

Re: EXPLAIN ANALYZE does not return accurate execution times

2022-10-27 Thread Tom Lane
Mark Mizzi writes: > So to confirm, EXPLAIN ANALYZE does not detoast rows? Not values that would have been transmitted to the client, no. regards, tom lane

Re: Re: Seeking the correct term of art for the (unique) role that is usually called "postgres"—and the mental model that underlies it all

2022-10-27 Thread Tom Lane
pedantic as well as confusing. Should we leave those usages alone, or reduce them to just "superuser"? regards, tom lane

Re: ERROR: could not find pathkey item to sort

2022-10-28 Thread Tom Lane
tion set. I think it's most likely a bug in parquet_fdw. We have tests of similar cases in postgres_fdw, and they work fine. regards, tom lane

Re: Does it equal to execute "CREATE ACCESS METHOD"?

2022-10-29 Thread Tom Lane
know > add those in pg_proc.dat and pg_am.dat, if it won't create access method for > spb, what else I need to > do? To be very blunt, it doesn't sound to me that your skills with Postgres are anywhere near up to the task of writing a new index access method. You should start with some less-ambitious project to gain some familiarity with the code base. regards, tom lane

Re: How to add a variable to a timestamp.

2022-10-29 Thread Tom Lane
'::interval + h.i * '1 hour'::interval (Or you can spell the constants like INTERVAL '1 day', if you prefer.) regards, tom lane

Re: Autovacuum on Partitioned Tables

2022-10-31 Thread Tom Lane
nt is to keep five years' worth of records and you want to drop the oldest month's records in bulk once a month, then partitioning by month would be pretty helpful to make those drops cheap. That would lead to 60 active partitions which is entirely reasonable. regards, tom lane

Re: Delete a table automatic?

2022-11-01 Thread Tom Lane
l_drop event trigger: I wonder whether the OP's purposes wouldn't be better served by making B a view or materialized view, instead of a separate table. Then the cascaded-drop behavior would be automatic. regards, tom lane

Re: pg_restore error on function

2022-11-03 Thread Tom Lane
hose to skip that object, or that one of them mistakenly thought that the CREATE FUNCTION should be issued first. None of those things should happen AFAICS, and none of them does happen in a simple test case, so there's something going on here that we've not been shown. regards, tom lane

Re: shutdown Postgres (standby) host causing timeout on other servers in replication

2022-11-03 Thread Tom Lane
e client-side replication logic. I suggest finding where it's coming from and then asking the appropriate authors. regards, tom lane

Re: server process (PID 2964738) was terminated by signal 11: Segmentation fault

2022-11-06 Thread Tom Lane
any reasonable way to proceed from here? contrib/amcheck might help to identify the faulty data (at this point there's reason to fear multiple corruptions ...). If you're running v14 or v15 there's a frontend for that called pg_amcheck. regards, tom lane

Re: server process (PID 2964738) was terminated by signal 11: Segmentation fault

2022-11-06 Thread Tom Lane
is to try using contrib/pageinspect to examine each page of the table. Its output is just gobbledegook to most people, but there's a good chance it'd fail visibly on the corrupted page(s). Also, please read https://wiki.postgresql.org/wiki/Corruption if you didn't already. regards, tom lane

Re: server process (PID 2964738) was terminated by signal 11: Segmentation fault

2022-11-07 Thread Tom Lane
an't be real sure that you identified and cleared all the data corruption. regards, tom lane

Re: server process (PID 2964738) was terminated by signal 11: Segmentation fault

2022-11-07 Thread Tom Lane
Ron writes: > On 11/7/22 08:02, Tom Lane wrote: >> call. It'd still be recommendable to pg_dumpall and restore into >> a freshly-initdb'd cluster, because otherwise you can't be real >> sure that you identified and cleared all the data corruption. > Why *

Re: Segmentation Fault PG 14

2022-11-07 Thread Tom Lane
exactly? Has anything else changed? > I could also get a little information from gdb, I'm not sure if it will > help: This looks pretty messed up. Are you sure the debug symbols you're using match the package? Even better, can you construct a self-contained test case? regards, tom lane

Re: Segmentation Fault PG 14

2022-11-07 Thread Tom Lane
below another Append. That shouldn't happen AFAIK --- the planner tries to collapse out such cases. Can you get us an EXPLAIN for the problem query? regards, tom lane

Re: Segmentation Fault PG 14

2022-11-07 Thread Tom Lane
Willian Colognesi writes: > No, the database is running well, no problem until now after disabled *jit.* Interesting. Which version of LLVM is installed? regards, tom lane

Re: Segmentation Fault PG 14

2022-11-07 Thread Tom Lane
awhile to see if that really fixed it. regards, tom lane

Re: Segmentation Fault PG 14

2022-11-08 Thread Tom Lane
is the best answer for you --- it's hard to say when we'll be able to make progress with this, given the lack of reproducible test cases. regards, tom lane

Re: Unnecessary locks for partitioned tables

2022-11-09 Thread Tom Lane
tables) the generic plan is pretty much always going to lose. That doesn't bother me enormously --- there are other query patterns with similar behavior. If you know that your queries always need custom plans, I question the value of using PREPARE at all. regards, tom lane

Re: IMMUTABLE function to cast enum to/from text?

2022-11-10 Thread Tom Lane
Whether you consider that elegant is up to you ;-) ... but it should work, as long as you don't break things by renaming the enum's values. regards, tom lane

Re: programmatically retrieve details of a custom Postgres type

2022-11-10 Thread Tom Lane
e from pg_type t left join pg_attribute a on t.typrelid = a.attrelid where typname = 'complex' order by attnum; attname | atttypid -+-- r | double precision i | double precision (2 rows) regards, tom lane

Re: programmatically retrieve details of a custom Postgres type

2022-11-10 Thread Tom Lane
and it will likely have associated entries in other catalogs that a composite type won't. But the core catalog entries are about the same. regards, tom lane

Re: reviving "custom" dump

2022-11-10 Thread Tom Lane
Rob Sargent writes: > Short version: Does a current version of postgres tolerate ascii dumps > from older versions? We intend it to. Have you got an actual problem? regards, tom lane

Re: change Log language

2022-11-11 Thread Tom Lane
d "pg_ctl reload". regards, tom lane

Re: pg_isready mandatory parameters?

2022-11-11 Thread Tom Lane
onder what you get from psql with the same command line option sets. regards, tom lane

Re: Upgrading to v12

2022-11-11 Thread Tom Lane
Corruption but in general the news is not going to be good. regards, tom lane

Re: Upgrading to v12

2022-11-11 Thread Tom Lane
here. Nonetheless, your path forward is clear: use pg_dump (or better pg_dumpall) and then load the output into a freshly initdb'd v12 installation. It'll be a bit slower than the pg_upgrade way, but it'll work. regards, tom lane

Re: Printf-like function

2022-11-11 Thread Tom Lane
Igor Korot writes: > Is there a printf-lilke function inside libpq that can be used > to create a proper query string with the proper quoting of the > literal? No. You'd be better off to transmit the literal value as a parameter. regards, tom lane

Re: Upgrading to v12

2022-11-12 Thread Tom Lane
that the older pg_dump might have bugs that are fixed in the newer version. But such bugs are rare, so usually it'll work fine to use the older one. We do endeavor to make sure that older dump output will load into newer versions, because in disaster-recovery scenarios an older dump might be all you have. regards, tom lane

Re: ON CONFLICT and WHERE

2022-11-13 Thread Tom Lane
a bit of a foot-gun. I wonder if we should make it safer by insisting that the resolved index be partial when there's a WHERE clause here. (This documentation text is about as clear as mud, too. What does "inferred" mean here? I think it means "chosen as arbiter index", but maybe I misunderstand.) regards, tom lane

Re: PANIC: could not flush dirty data: Cannot allocate memory

2022-11-14 Thread Tom Lane
ncy is preserved; without it we can't offer any guarantees. regards, tom lane

Re: PANIC: could not flush dirty data: Cannot allocate memory

2022-11-14 Thread Tom Lane
quest didn't get queued for lack of in-kernel memory space ... in which case "nothing happened". regards, tom lane

Re: PostgreSQL server "idle in transaction"

2022-11-15 Thread Tom Lane
rg/docs/current/ecpg-commands.html#ECPG-TRANSACTIONS regards, tom lane

Re: Calling function from VFP changes character field to Memo

2022-11-15 Thread Tom Lane
(firstname character(30), ...); create function testfunction() returns setof testfunction_result as ... regards, tom lane

Re: unrecognized node type: 350

2022-11-16 Thread Tom Lane
the like)? regards, tom lane

Re: pg_restore remap schema

2022-11-16 Thread Tom Lane
ally with > dynamic queries in PL/pgsql. Yeah --- I fear there is no hope of making a feature like this that works reliably enough that we'd accept it. pg_restore is just not that smart about what is in the chunks of DDL that it processes, and trying to make it smart enough is a losing game. regards, tom lane

Re: pg_restore remap schema

2022-11-16 Thread Tom Lane
his at dump time, you could just temporarily rename the schema on the server while making the dump. (Not that that would fix function bodies either.) regards, tom lane

Re: unrecognized node type: 350

2022-11-16 Thread Tom Lane
ostmaster log. regards, tom lane

Re: unrecognized node type: 350

2022-11-16 Thread Tom Lane
e any basis for filing a bug report. regards, tom lane

Re: unrecognized node type: 350

2022-11-16 Thread Tom Lane
check. It might or might not be related to the node-type error. regards, tom lane

Re: unrecognized node type: 350

2022-11-16 Thread Tom Lane
shashidhar Reddy writes: > Extension version is 2.2. Is anything need to be done? To fix this issue? You could start by getting the information I asked for, ie where is this error being thrown from according to log_error_verbosity=verbose. regards, tom lane

Re: unrecognized node type: 350

2022-11-16 Thread Tom Lane
headers. But you'd expect that it largely wouldn't work at all if so.) regards, tom lane

Re: Postgresql 11.3 doesn't use gist index on polygon column

2022-11-17 Thread Tom Lane
polygon,polygon) |9 | search gist | poly_ops| <<|(polygon,polygon) | 10 | search gist | poly_ops| |>>(polygon,polygon) | 11 | search gist | poly_ops| |&>(polygon,polygon) | 12 | search gist | poly_ops| <->(polygon,point) | 15 | ordering (13 rows) regards, tom lane

Re: Drop role cascade ?

2022-11-17 Thread Tom Lane
get rid of this role without revoking xxx in all > the individual DB objects he has privs too? Something like "drop role xxx > cascade" ? Not directly, but see REASSIGN OWNED and DROP OWNED. regards, tom lane

Re: Drop role cascade ?

2022-11-17 Thread Tom Lane
Ron writes: > On 11/17/22 17:16, Tom Lane wrote: >> Not directly, but see REASSIGN OWNED and DROP OWNED. > SIMULATE and VERBOSE options would be handy, to see what those commands > would actually do. Hmph. I'm surprised to realize that those commands don't produce t

Re: RES: session_user different from current_user after normal login

2022-11-18 Thread Tom Lane
f any such settings. I can't offhand think of any other server-side configuration that would do it. regards, tom lane

Re: Calculating average block write time

2022-11-18 Thread Tom Lane
would have much real-world significance if we did calculate it. You could argue that read() is also squishy since it might be satisfied from kernel buffers rather than actually getting bits off the disk. However, there is some physical reality there: before read() we did not have the data, and afterwards we do. regards, tom lane

Re: Appetite for `SELECT ... EXCLUDE`?

2022-11-18 Thread Tom Lane
ariation in how you spell it, where you can write it, and so on. My own inclination is to not do anything here until/unless the SQL committee standardizes something, because there's too much risk of finding ourselves incompatible with the standard. regards,

Re: Lots of read activity on index only scan

2022-11-18 Thread Tom Lane
map is fully set. Did you vacuum this table after building it, or wait long enough for autovacuum to do so? regards, tom lane

Re: RES: RES: session_user different from current_user after normal login

2022-11-18 Thread Tom Lane
ain it ... what applied that setting? regards, tom lane

Re: Duda sobre como imprimir un campo INTERVAL

2022-11-19 Thread Tom Lane
a linear sort order if we want to support btree indexes or ORDER BY on intervals. You can use justify_hours() to get from '26 hours' to '1 day 2 hours'. I'm not sure if there's a compact way to go the other direction, though you could always use extract() to get the components and sum them up. regards, tom lane

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-21 Thread Tom Lane
to buy into maintaining our own fork of Readline, if that's what you're trying to suggest. If it "just works" now, that'd be great. Otherwise, maybe you should be speaking to the Readline maintainers about what changes are needed in it? regards, tom lane

Re: security label and indexes

2022-11-22 Thread Tom Lane
. From a security standpoint, they're implementation details of the table they belong to. Whatever usage restrictions you want should be put on the table, instead. regards, tom lane

Re: Index filter instead of index condition w/ IN / ANY queries above certain set size

2022-11-23 Thread Tom Lane
stgresql.org/docs/current/indexes-multicolumn.html That is, tid and tidh need to be the first two index columns. regards, tom lane

Re: table inheritance partition and indexes

2022-11-23 Thread Tom Lane
to INHERITS-style partitioning. regards, tom lane

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-23 Thread Tom Lane
Andres Freund writes: > On 2022-11-21 10:58:06 -0500, Tom Lane wrote: >> It'd certainly be nice if we could use Readline on Windows. > 2) The last time I checked, msvc couldn't preprocess tab-complete.c with >USE_READLINE defined, due to running into some pr

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-23 Thread Tom Lane
Andres Freund writes: > On 2022-11-23 18:11:22 -0500, Tom Lane wrote: >> Huh ... do you recall the details? Large as tab-complete is, it's >> far smaller than gram.y: > So It might just be that we need to split up that very long "else if" chain in > psql_com

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-23 Thread Tom Lane
e an easy quick-fix. We'd need to refactor so that the cleanup housekeeping at the bottom of psql_completion() was in a wrapper function, but perhaps that wouldn't be too messy. regards, tom lane

Re: Index-only scan not working when IN clause has 2 or more values

2022-11-25 Thread Tom Lane
s sorted by trans_dttm anyway. You might try making extended stats on these three columns to see if that helps the planner to get a better rowcount estimate. If it understood that there were fewer than 50 matching rows, it might opt for the use-the-=ANY-and-sort plan type. regards, tom lane

Re: Practical maximum max_locks_per_transaction?

2022-11-25 Thread Tom Lane
as big as you want on any reasonably modern machine. I wouldn't blink at a few million locktable entries, at least not on 64-bit hardware. regards, tom lane

Re: collect2: error: ld returned 1 exit status

2022-11-26 Thread Tom Lane
stated command? BTW, it's pretty hard to believe that you need to use sudo for this. regards, tom lane

Re: delete statement returning too many results

2022-11-28 Thread Tom Lane
BY id LIMIT 1 FOR UPDATE SKIP LOCKED ) DELETE FROM queue WHERE id IN (SELECT * FROM target_rows) RETURNING *; regards, tom lane

Re: Upgrading to v12

2022-11-28 Thread Tom Lane
those enabled. > Is there anything else I want from initdb? If you can connect to the new installation, then you're done with that part, and can get on with the dump-and-restore part. regards, tom lane

Re: Re: Seeking the correct term of art for the (unique) role that is usually called "postgres"—and the mental model that underlies it all

2022-11-29 Thread Tom Lane
imes worth saying "database superuser" to ensure that you don't confuse people who might think of some external-to-Postgres meaning of "superuser", but otherwise plain "superuser" is fine. And we've settled on "bootstrap superuser" as the best term for the role with OID 10. So the present set of glossary entries looks fine to me. regards, tom lane

Re: delete statement returning too many results

2022-11-29 Thread Tom Lane
Harmen writes: > On Mon, Nov 28, 2022 at 12:11:53PM -0500, Tom Lane wrote: >> So basically it's unsafe to run the sub-select more than once, >> but the query as written leaves it up to the planner whether >> to do that. I'd suggest rephrasing as [...] > I'

Re: Finding free time period on non-continous tstzrange field values

2022-12-01 Thread Tom Lane
tstzmultirange | | func pg_catalog | tstzmultirange | tstzmultirange | VARIADIC tstzrange[] | func pg_catalog | tstzmultirange | tstzmultirange | tstzrange | func (3 rows) My guess is that your server is not in fact PG14, but some older version. regards, tom lane

Re: Stored procedure code no longer stored in v14 and v15, changed behaviour

2022-12-01 Thread Tom Lane
se it couldn't be maintained in a reasonable way. I think the answer here is "don't use the new syntax if you want the function body stored textually". You can have one set of benefits, or the other set, but not both at once. regards, tom lane

Re: how to secure pg_hba.conf

2022-12-01 Thread Tom Lane
hat's to stop the same actors from examining/modifying other configuration files, or even the actual database contents? If you don't think your data directory is secure, you have problems that Postgres can't fix. regards, tom lane

Re: Stored procedure code no longer stored in v14 and v15, changed behaviour

2022-12-01 Thread Tom Lane
ee the contradictions in this? You want the database to preserve the original DDL, but you also want it to update in response to subsequent alterations. You can't have both those things. regards, tom lane

Re: Stored procedure code no longer stored in v14 and v15, changed behaviour

2022-12-02 Thread Tom Lane
t telling so, but don't change the text > until next alter procedure is run. I'm astonished at the number of people who think that poorly-implemented Oracle behavior is something we should emulate. regards, tom lane

Re: Views "missing" from information_schema.view_table_usage

2022-12-02 Thread Tom Lane
matviews and sequences. Some other projects adopt more liberal views about what should be shown in those views, but that one is our policy. regards, tom lane

Re: print in plpython not appearing in logs

2022-12-03 Thread Tom Lane
not a Postgres question. Maybe you need an explicit fflush-equivalent step? Dunno. regards, tom lane

Re: PG 14.5 -- Impossible to restore dump due to interaction/order of views, functions, and generated columns

2022-12-06 Thread Tom Lane
dump has some heuristics for dealing with such cases, but maybe it needs more. Please create a self-contained example and submit it to pgsql-bugs. regards, tom lane

Re: Re[2]: PG 14.5 -- Impossible to restore dump due to interaction/order of views, functions, and generated columns

2022-12-07 Thread Tom Lane
rts of misbehaviors might ensue from that, but I'm pretty certain that the data in the GENERATED column after dump/restore won't match what you had there beforehand. regards, tom lane

Re: Is there a way to detect that code is inside CREATE EXTENSION?

2022-12-13 Thread Tom Lane
better look at the in_extension fields of CollectedCommands. I don't think we expose that state at the SQL level, but it's pretty hard to make a useful event trigger without writing any C ... regards, tom lane

Re: compiling postgres on windows - how to deal with unmatched file extension?

2022-12-13 Thread Tom Lane
have seen associated errors earlier in the build log. regards, tom lane

Re: tcp keepalives not sent during long query

2022-12-14 Thread Tom Lane
e certain that you applied the configuration change to your new installation? It'd be worth doing show tcp_keepalives_idle; in one of the sessions where you are having trouble. And maybe check the other keepalives settings too? regards, tom lane

Re: Test if a database has any privilege granted to public

2022-12-14 Thread Tom Lane
(3 rows) regards, tom lane

Re: tcp keepalives not sent during long query

2022-12-15 Thread Tom Lane
r I'd expect on a local (Unix-socket) connection ... you sure you're doing this from one of the problematic clients? regards, tom lane

Re: pg_dumpall renders ALTER TABLE for a view?

2022-12-15 Thread Tom Lane
to making pg_dump emit the more modern spelling (I think ... you'd need to look into pg_restore to make sure it's not assuming something in this area). But doing that won't really remove the hazard. regards, tom lane

Re: tsvector not giving expected results on one host

2022-12-17 Thread Tom Lane
s 'exampl', then only the first of these will match. So IMO the question is not "why is it failing on prod?", it's "how the heck did it work on the other machine?". You won't get nice results if websearch_to_tsquery is using a different TS configuration than to_tsvector did. regards, tom lane

Re: Postgres Date Type Value

2022-12-17 Thread Tom Lane
date is 8333 by my math. Looking at the bit-pattern for 1,466,004,328: 0x57617368, it seems totally unrelated, more like ASCII text ("Wash") than anything else. You sure you're reading the right column of the result? regards, tom lane

Re: integer square root function proposed

2022-12-17 Thread Tom Lane
described in > 8.1 Numeric Types). Our integers do not have infinities, nor NaNs. Anyway, I don't mean to slam the door on this idea completely, but I think you need to make a much better-supported argument for it. regards, tom lane

Re: dropped default locale

2022-12-21 Thread Tom Lane
uot;pin" entries. regards, tom lane

Re: PostgreSQL 12 service failing in Ubuntu 20.04 after a few hours

2023-01-01 Thread Tom Lane
;s not allowing non-credentialed logins from anywhere. And for pete's sake don't use a guessable password. regards, tom lane

Re: Updating column default values in code

2023-01-06 Thread Tom Lane
generate ALTER VIEW v ALTER COLUMN c SET DEFAULT LOCALTIMESTAMP(0) commands doesn't do what you need? regards, tom lane

Re: impact join syntax ?? and gist index ??

2023-01-07 Thread Tom Lane
inner or has the indexed table on the nullable side. We have no support for nestloop right join, which is what would be needed to make things run fast with no index on B. regards, tom lane

Re: impact join syntax ?? and gist index ??

2023-01-07 Thread Tom Lane
closer to shared_buffers, as it seems to indicate that fetches from kernel space are pretty expensive on your platform.) regards, tom lane

Re: Autovacuum Hung Due to Bufferpin

2023-01-11 Thread Tom Lane
h to do that. If you have a constant stream of readers it will never be able to get that lock. You'll need to find a way to momentarily block those readers. regards, tom lane

Re: Autovacuum Hung Due to Bufferpin

2023-01-11 Thread Tom Lane
don't think there's any ready way to discover that from SQL level. regards, tom lane

Re: EXPLAIN and FK references?

2023-01-11 Thread Tom Lane
references (index scan, seq scan, etc) during deletes (and > inserts and updates)? No, not directly, but you could look at EXPLAIN ANALYZE to see which of the RI triggers is eating the time. It's not going to be hard to figure out which one(s) are using indexed plans and which are not. regards, tom lane

Re: EXPLAIN and FK references?

2023-01-11 Thread Tom Lane
Ron writes: > On 1/12/23 00:07, Tom Lane wrote: >> No, not directly, but you could look at EXPLAIN ANALYZE to see which >> of the RI triggers is eating the time. > Good to know, but even deleting one day of data (90,000 rows using an index > scan on the date field) takes

Re: Intervals and ISO 8601 duration

2023-01-12 Thread Tom Lane
croseconds. If we're forced to interconvert between those units, we use 30 days = 1 month and 24 hours = 1 day, but it's usually best to avoid doing that. regards, tom lane

Re: Intervals and ISO 8601 duration

2023-01-13 Thread Tom Lane
t() keywords to make that easier. regards, tom lane

Re: Intervals and ISO 8601 duration

2023-01-13 Thread Tom Lane
is not what Ken is after IIUC. regards, tom lane

Re: synchronized standby: committed local and waiting for remote ack

2023-01-13 Thread Tom Lane
a different set of failure modes. It'd be particularly bad if you have more than one standby, because you could easily get into a situation where *none* of the nodes represent truth. regards, tom lane

Re: Why is a hash join preferred when it does not fit in work_mem

2023-01-14 Thread Tom Lane
rming the sort using an index scan instead of a bespoke sort step. AFAIR, cost_sort doesn't consider random_page_cost at all, and neither does cost_hashjoin. regards, tom lane

Re: row estimate for partial index

2023-01-14 Thread Tom Lane
t by setting up "extended statistics" on that pair of columns: https://www.postgresql.org/docs/current/planner-stats.html#PLANNER-STATS-EXTENDED (I might be wrong, but I think that will help even when one of the troublesome conditions is a null-check. If it doesn't, then we have something to improve there ...) regards, tom lane

<    9   10   11   12   13   14   15   16   17   18   >