Re: Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "merge".

2018-03-07 Thread Alvaro Herrera
Vinodh NV wrote: > Sir, > > I am facing the error Caused by: org.postgresql.util.PSQLException: ERROR: > syntax error at or near "merge". when I execute the below query in > postgres database. The same works fine in Oracle. > > merge into net n using dual on (n.id=:id) when matched then update s

Re: Help troubleshooting SubtransControlLock problems

2018-03-07 Thread Alvaro Herrera
Laurenz Albe wrote: > Scott Frazer wrote: > > Hi, we have a Postgres 9.6 setup using replication that has recently > > started seeing a lot of processes stuck in > > "SubtransControlLock" as a wait_event on the read-replicas. Like this, only > > usually about 300-800 of them: > > > > > > 17970

Re: Help troubleshooting SubtransControlLock problems

2018-03-07 Thread Alvaro Herrera
Scott Frazer wrote: > Currently this seems to be happening when the server just starts taking > connections. It doesn't even need time to scale up anymore (previously it > took about 8 hours for the problem to re-appear) > > It's only happening on the read replicas, though. I've just set my maste

Re: ERROR could not access transaction/Could not open file pg_commit_ts

2018-03-09 Thread Alvaro Herrera
Jeremy Finzel wrote: > UPDATE: what is actually failing is a call to > pg_xact_commit_timestamp(xmin) on a given table under the view. We still > think we must have some corruption though with pg_commit_ts. This is not a valid query, because the xmin may belong to a frozen tuple. pg_commit_ts d

Re: found xmin from before relfrozenxid on pg_catalog.pg_authid

2018-03-19 Thread Alvaro Herrera
Jeremy Finzel wrote: > Getting some concerning errors in one of our databases that is on 9.5.11, > on autovacuum from template0 database pg_authid and pg_auth_members. I > only saw some notes on the list about this error related to materialized > views. FWIW, we did use pg_upgrade to upgrade this

Re: found xmin from before relfrozenxid on pg_catalog.pg_authid

2018-03-22 Thread Alvaro Herrera
I admit I'm pretty surprised by this whole episode. I have no useful advice to offer here. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: [GENERAL] missing public on schema public

2018-03-26 Thread Alvaro Herrera
Was this ever fixed? -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: Can PostgreSQL create new WAL files instead of reusing old ones?

2018-04-17 Thread Alvaro Herrera
David Pacheco wrote: > tl;dr: We've found that under many conditions, PostgreSQL's re-use of old > WAL > files appears to significantly degrade query latency on ZFS. The reason is > complicated and I have details below. Has it been considered to make this > behavior tunable, to cause PostgreSQL t

Re: Long running INSERT+SELECT query

2018-04-26 Thread Alvaro Herrera
Vitaliy Garnashevich wrote: > > > Have not worked through all of the above, but a first draft suggestion: > > > > Move the SELECT minus the aggregation functions into a sub-query that > > uses FOR UPDATE. Then do the aggregation on the results of the > > sub-query. > > The aggregated table has h

Re: Index/trigger implementation for accessing latest records

2018-05-02 Thread Alvaro Herrera
Alastair McKinley wrote: > create function latest_record_update() returns trigger as > $$ > BEGIN > update location_records set latest_record = false where person_id = > new.person_id and latest_record is true and id != new.id; > return new; > END; > $$ language plpgsql; > > crea

Re: relkind='p' has no pg_stat_user_tables

2018-05-03 Thread Alvaro Herrera
Adrian Klaver wrote: > and from here: > > https://www.postgresql.org/docs/10/static/sql-createtable.html > > "A partitioned table is divided into sub-tables (called partitions), which > are created using separate CREATE TABLE commands. The partitioned table is > itself empty. A data row inserted

Re: Control PhoneNumber Via SQL

2018-05-15 Thread Alvaro Herrera
On 2018-May-15, John McKown wrote: > I don't have any code for you, if that is what you are soliciting. I did > find a couple of informative web sites which help explain how international > phone numbers are formatted. These are known as E.164 numbers. Michael Glaesemann wrote a e.164 datatype yea

Re: pg_multixact/members growing

2018-05-23 Thread Alvaro Herrera
On 2018-May-23, Tom Lane wrote: > Tiffany Thang writes: > > Where do I find pg_controldata? I could not locate it on the file system. > > Hmm, should be one of the installed PG executables. > > > pg_clog/ or pg_subtrans/ or pg_multixact/offsets/ are getting larger too > > but by only a few hun

Re: found xmin from before relfrozenxid on pg_catalog.pg_authid

2018-05-24 Thread Alvaro Herrera
Hmm .. surely diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 5016181fd7..5d7fa1fb45 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -6690,7 +6690,7 @@ heap_prepare_freeze_tuple(HeapTupleHeader tuple, xid = Heap

Re: found xmin from before relfrozenxid on pg_catalog.pg_authid

2018-05-24 Thread Alvaro Herrera
On 2018-May-24, Andres Freund wrote: > FWIW, even if that weren't the case: a) there'd be a lot more wrong with > this routine imo. b) some of the tuples affected clearly weren't > frozen... Right. BTW is it just a coincidence or are all the affected tables pg_authid? Maybe the problem is shared

Re: found xmin from before relfrozenxid on pg_catalog.pg_authid

2018-05-24 Thread Alvaro Herrera
On 2018-May-24, Andres Freund wrote: > On 2018-05-24 13:08:53 -0400, Alvaro Herrera wrote: > > Hmm .. surely > > xid = HeapTupleHeaderGetXmin(tuple); > > xmin_frozen = ((xid == FrozenTransactionId) || > >HeapTupleHeaderXmi

Re: found xmin from before relfrozenxid on pg_catalog.pg_authid

2018-05-24 Thread Alvaro Herrera
On 2018-May-24, Andres Freund wrote: > On 2018-05-24 16:49:40 -0400, Alvaro Herrera wrote: > > BTW is it just a coincidence or are all the affected tables pg_authid? > > Maybe the problem is shared relations ..? Maybe the fact that they have > > separate relfrozenxid (!?) i

Re: existence of a savepoint?

2018-05-29 Thread Alvaro Herrera
On 2018-May-27, Stuart McGraw wrote: > Is there some way to to test if a savepoint of a given name > exists? Or better yet, the number of stacked savepoints of > that name? What is the use case for this? -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7

Re: existence of a savepoint?

2018-05-29 Thread Alvaro Herrera
On 2018-May-29, Stuart McGraw wrote: > Alternatively if there were a setting to tell Postgresql to > follow the SQL standard behavior of overwriting rather stacking > savepoints, that too would also solve my current problem I think. > Perhaps it is just my limited experience but the former behavio

Re: Code of Conduct plan

2018-06-04 Thread Alvaro Herrera
On 2018-Jun-05, Gavin Flower wrote: > If we are all adults, then we don't need a CoC. "We're all adults" is wishful thinking. Some old people are just kids who aged but didn't actually mature. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, R

Re: Code of Conduct plan

2018-06-06 Thread Alvaro Herrera
On 2018-Jun-06, David G. Johnston wrote: > On the topic of privacy - who exactly, from an administrative aspect, has > access to the systems that house these kinds of confidential > communications? Do these emails end up in PostgreSQL.org servers long-term > or is it mainly transient distribution

Re: Performance problem postgresql 9.5

2018-06-08 Thread Alvaro Herrera
On 2018-Jun-08, Miguel Angel Sanchez Sandoval wrote: > Hi guys, migrate from 8.4 to 9.5, all OK except that 2-3 days pass and the > database experiences slowness, I execute the linux top command and it shows > me a postgres user process executing a strange command (2yhdgrfrt63788) > that I consume

Re: ALTER TABLE SET (toast.asdf) is not rejected

2018-06-11 Thread Alvaro Herrera
On 2018-Jun-11, Justin Pryzby wrote: > I noticed that this is accepted: > > postgres=# ALTER TABLE t SET (toast.asdf=128); > ALTER TABLE > > I thought since "toast" was a core namespace, it would've been rejected? > > I recall having read a discussion about verifying these ... I wasn't able > t

Re: Impact of multixact "members" limit exceeded

2018-06-13 Thread Alvaro Herrera
On 2018-Jun-13, Daniel Lagerman wrote: > Hello! > > I have a question where I'm trying to determine the seriousness of the > problem. What's your server version? The way to reclaim members space is to move forwards the pg_database.datminmxid value from the database where it is oldest; and the w

Re: Impact of multixact "members" limit exceeded

2018-06-14 Thread Alvaro Herrera
Hello Daniel The advice from Lawrence downthread is very much on point. If you can upgrade to 9.5, do it. He mentions savepoints, but one more case is plpgsql blocks with EXCEPTION clauses. On 2018-Jun-13, Daniel Lagerman wrote: > Hello Álvaro, > > I'm running at 9.4.3, I know its an older ve

Re: Impact of multixact "members" limit exceeded

2018-06-14 Thread Alvaro Herrera
On 2018-Jun-14, Daniel Lagerman wrote: > > Set vacuum_multixact_freeze_table_age to 0 (causing all vacuums to scan > > tables fully) and vacuum_multixact_freeze_min_age to some value like one > > million (so that they remove most of the oldest multixacts, leaving > > just the frontmost one million

Re: Is there a way to be notified on the CREATE TABLE execution?

2018-06-20 Thread Alvaro Herrera
On 2018-Jun-20, Igor Korot wrote: > [quote] > In order to create an event trigger, you must first create a function > with the special return type event_trigger. This function need not > (and may not) return a value; the return type serves merely as a > signal that the function is to be invoked as

Re: Sv: Re: Sv: Re: CTE optimization fence

2018-06-28 Thread Alvaro Herrera
On 2018-Jun-27, Andreas Joseph Krogh wrote: > I know. I hate the INLINE proposal and hope default-behaviour will be like in > other DBs, inline like sub-query as default. GUC for preserving fence is what > I > hope will happen. I am probably biased ;-) but I like my proposal #1 in this email h

Re: dumping only table definitions

2018-06-29 Thread Alvaro Herrera
On 2018-Jun-29, Kevin Brannen wrote: > I'm trying to figure out how to dump only the table definitions, well those > and things they need directly, like sequences & types. What I do NOT want are > all the millions (not literally but it feels like it :)) of functions we > have. Triggers would be

Re: ddl_command_end not firing DROP events

2018-07-08 Thread Alvaro Herrera
On 2018-Jul-08, Demitri Muna wrote: Hi > I’ve created a trigger where I want to capture schema-changing events. > I’m finding that DROP events are not being triggered when using > “ddl_command_end". The test case below demonstrates this. I am running > PostgreSQL 10.4. The trigger is fired for th

Re: ERROR: found multixact from before relminmxid

2018-07-13 Thread Alvaro Herrera
On 2018-Jul-13, Sean McIntyre wrote: > Quick correction :) > > I am running PostgreSQL *9.6.8* on AWS RDS. I'm going to try to pg-repack > the table and will look to upgrade to *9.6.9* (though it's not presently > available on RDS). Yay RDS ... -- Álvaro Herrerahttps://www.2ndQ

Re: User documentation vs Official Docs

2018-07-16 Thread Alvaro Herrera
On 2018-Jul-16, Joshua D. Drake wrote: > Think of this (if we can figure out how to pull this off): User on > StackOverflow says, "How do I do X", someone answers with a direct > link to a recipe on PostgreSQL.Org that tells them exactly how to do X > (with caveats of course). There isn't much mo

Re: User documentation vs Official Docs

2018-07-20 Thread Alvaro Herrera
On 2018-Jul-20, Adrian Klaver wrote: > On 07/20/2018 11:45 AM, Joshua D. Drake wrote: > > Back to the original idea, it would be great if those participating > > would be willing to help even a little in determining an actual > > direction to take this. > > I would say that discussion should tak

Re: In certain cases, can UPDATE transactions fail rather than block waiting for “FOR UPDATE lock”?

2018-07-20 Thread Alvaro Herrera
On 2018-Jul-20, Praveen Kumar wrote: > Regarding UPDATEs on rows that are locked via "SELECT FOR UPDATE" in > another transaction, I read the above as follows: other transactions that > attempt UPDATE of these rows will be blocked until the current transaction > ( which did "SELECT FOR UPDATE" fo

Re: logical replication snapshots

2018-07-24 Thread Alvaro Herrera
On 2018-Jul-24, Dimitri Maziuk wrote: > On 7/23/2018 6:51 PM, Andres Freund wrote: > > Could you describe what exactly you did into that situation? > > Created a database, few publications, as per TFM, and a few subscriptions on > another host. Went on vacation for 3 weeks. The problem host is c

Re: Need text wrapping inside a column to avoid record wrapping (tabular output of 'select')

2018-07-25 Thread Alvaro Herrera
On 2018-Jul-25, David Gauthier wrote: > Hi: > > psql (9.6.7, server 9.1.9) on RHEL6 > > In order to avoid record wrapping in the tabular output of a "select" > statement, I need to limit the width of certain columns. For those > columns, I would like to have text wrapping so as not to lose any

Re: Template0 datfrozenxid age is 160million and progressing

2018-08-01 Thread Alvaro Herrera
On 2018-Aug-01, Andres Freund wrote: > On 2018-08-01 12:07:16 -0400, Tom Lane wrote: > > Andres Freund writes: > > > On 2018-08-01 10:24:24 -0400, Tom Lane wrote: > > >> IMO, the action you need to take is enabling autovacuum. We've > > >> seen many many people go down the path you are taking, a

Re: ALTER TABLE .. SET STATISTICS

2018-08-05 Thread Alvaro Herrera
On 2018-Aug-05, Ron wrote: > For columns of type bytea which store image data (PDFs, JPGs, etc) would it > speed up the ANALYZE process to SET STATISTICS = 0? Yes. I'd suggest also looking at ALTER TABLE ... SET STORAGE to avoid having Postgres try to compress those columns, which is useless was

Re: Vacuum process waiting on BufferPin

2018-08-13 Thread Alvaro Herrera
On 2018-Aug-13, Don Seiler wrote: > This afternoon I discovered an autovacuum process that had been running for > over 6 days. It was waiting on BufferPin event. I kicked off a manual > vacuum+analyze of the table, which automatically killed that autovacuum. > This ran for a few minutes before it

Re: MultiXactId 24018 has not been created yet -- apparent wraparound error

2018-08-23 Thread Alvaro Herrera
On 2018-Aug-23, Dean Armada wrote: > My team is confused as we are not doing anything then we experienced this > in our staging environment. It's happening only in one of our tables. When > we try fetch in that table, the message below returns > > project=# SELECT * FROM table_table; > ERROR: Mu

Re: Will there ever be support for Row Level Security on Materialized Views?

2018-08-27 Thread Alvaro Herrera
On 2018-Aug-27, Ken Tanzer wrote: >- Is there any reason there is no RLS / MV support now? Nobody worked on it yet. >- Are there any reason fundamental reasons why PG couldn't support RLS >for MVs? Doesn't look like it. >- Is it just a matter of nobody has done it yet? Yeah.

Re: Autovacuum degrades all other operations by keeping all buffers dirty?

2018-08-31 Thread Alvaro Herrera
On 2018-Aug-31, David Pacheco wrote: > From reading the 9.6.3 source, it looks like the autovacuum process > itself is single-threaded, and it reads pages essentially linearly > from the relation (possibly skipping some). When the autovacuum > process needs to modify a page, it doesn't write it d

Re: How to get shorter SERVER_VERSION in psql-prompt?

2018-09-03 Thread Alvaro Herrera
On 2018-Sep-03, Andreas Joseph Krogh wrote: > Hi all, I'm using the Ubuntu-packages and have this in my .psqlrc: >   > \set PROMPT1 '%[%033[35m%]%n@%m:%>%[%033[0m%] %:server_version: > %[%033[32m%]%/%[%033[0m%]%R%# ' >   > This results in this verver_version: > 10.5 (Ubuntu 10.5-1.pgdg18.04+1) >

Re: Sv: Re: How to get shorter SERVER_VERSION in psql-prompt?

2018-09-03 Thread Alvaro Herrera
On 2018-Sep-03, Andreas Joseph Krogh wrote: > select setting as server_version from pg_settings where name = > 'server_version'; > ┌──┐ > │  server_version  │ > ├──┤ > │ 10.5 (Ubuntu 10.5-1.pgdg18.04+1) │ > └

Re: Behaviour when autovacuum is canceled

2018-09-14 Thread Alvaro Herrera
On 2018-Sep-13, Martín Fernández wrote: > By performing this changes we are going to start relying more heavily > on the autovacuum work and the concern of "lost work" caused by > autovacuum canceling itself when locking contention happen showed up. > I'm guessing that we might be over thinking th

Re: How to extract information from pg_ddl_command type

2019-07-12 Thread Alvaro Herrera
On 2019-Jul-11, Thomas Kellerer wrote: > The function pg_event_trigger_ddl_commands() returns several columns, one of > them being "command" that is of the type "pg_ddl_command". > > The manual[1] describes this column as: > > > A complete representation of the command, in internal format. >

Re: disable and enable trigger all when a foreign keys

2019-07-17 Thread Alvaro Herrera
On 2019-Jul-12, Tom Lane wrote: > The OP already found the best method to get out of this, which is to > drop and re-add the FK constraint. Adding the constraint will force > a full verification scan, which is what you need here since there's > no information available about which checks were mis

Re: Why no CREATE TEMP MATERIALIZED VIEW ?

2019-07-17 Thread Alvaro Herrera
On 2019-Jul-16, Ivan Voras wrote: > Hello, > > Out of curiosity, since there's CREATE TEMP VIEW, any particular reason > there's no CREATE TEMP MATERIALIZED VIEW? Because it hasn't been implemented. There is a patch, but it's not done. See this thread: https://postgr.es/m/CAKLmikNoQR4ZNg_wt=-h

Re: Corrupt index stopping autovacuum system wide

2019-07-17 Thread Alvaro Herrera
On 2019-Jul-17, Peter Geoghegan wrote: > Maybe nbtree VACUUM should do something more aggressive than give up > when there is a "failed to re-find parent key" or similar condition. > Perhaps it would make more sense to make the index inactive (for some > value of "inactive") instead of just compla

Re: Corrupt index stopping autovacuum system wide

2019-07-17 Thread Alvaro Herrera
On 2019-Jul-17, Tom Lane wrote: > Alvaro Herrera writes: > > On 2019-Jul-17, Peter Geoghegan wrote: > >> Maybe nbtree VACUUM should do something more aggressive than give up > >> when there is a "failed to re-find parent key" or similar condition. > >

Re: Hardware for writing/updating 12,000,000 rows per hour

2019-07-26 Thread Alvaro Herrera
On 2019-Jul-26, Arya F wrote: > I think I can modify my application to do a batch update. Right now the > server has an HDD and it really can't handle a lot of updates and inserts > per second. Would changing to a regular SSD be able to easily do 3000 > updates per second? That's a pretty hard qu

Re: DRY up GUI wiki pages

2019-07-26 Thread Alvaro Herrera
On 2019-Jul-10, Steve Atkins wrote: > > On Jul 10, 2019, at 7:38 PM, Bruce Momjian wrote: > >> I'd like to DRY them up so there aren't two lists which confuses > >> newcomers. Any objections? If not I'll probably make one of those > >> pages into GUI's and one into "non GUI's" or something lik

Re: Aggregate not using BRIN index on timestamp

2019-08-05 Thread Alvaro Herrera
On 2019-Aug-05, Jeremy Finzel wrote: > Thanks Tom. So, this is a very general question, but would it be possible > to develop that feature into BRIN, given what it stores? Even if it does > not have ordering information, doesn't it know which blocks would contain > the lowest values, so it could

Re: Aggregate not using BRIN index on timestamp

2019-08-05 Thread Alvaro Herrera
On 2019-Aug-05, Tom Lane wrote: > FWIW, I suspect the hard part would be dealing with cases where the > extremal ranges (according to the index) contain no live tuples > (according to the query's snapshot). The btree case handles the > invisible-tuples problem by continuing a scan started at the

Re: PMChildFlags array

2019-10-03 Thread Alvaro Herrera
On 2019-Oct-03, bhargav kamineni wrote: > bhargav kamineni writes: > > Postgres was rejecting a bunch of connections from a user who is having a > > connection limit set. that was the the FATAL error that i could see in log > > file. > > FATAL,53300,"too many connections for role ""user_app""" >

Re: Pg11 -- MultiXactId xxxx has not been created yet -- apparent wraparound

2019-10-04 Thread Alvaro Herrera
On 2019-Oct-04, Moreno Andreo wrote: > select * from heap_page_items(get_raw_page('tablename',3159)); > select * from heap_page_items(get_raw_page('tablename',3160)); > > and so on for about 5 or 6 pages. Please paste the output of that for pages 3159 and 3160, as well as the output of pg_contro

Re: Pg11 -- MultiXactId xxxx has not been created yet -- apparent wraparound

2019-10-04 Thread Alvaro Herrera
On 2019-Oct-04, Moreno Andreo wrote: > Il 04/10/19 17:30, Alvaro Herrera ha scritto: > > On 2019-Oct-04, Moreno Andreo wrote: > > > > > select * from heap_page_items(get_raw_page('tablename',3159)); > > > select * from heap_page_items(get_raw_page(&#x

Re: Pg11 -- MultiXactId xxxx has not been created yet -- apparent wraparound

2019-10-04 Thread Alvaro Herrera
On 2019-Oct-04, Moreno Andreo wrote: > Il 04/10/19 18:28, Alvaro Herrera ha scritto: > > I wonder if it would work to just clear that multixact with > > SELECT ... WHERE ctid='(3160,31)' FOR UPDATE > select ...what? :-) Sorry but it's totally beyond my kno

Re: Pg11 -- MultiXactId xxxx has not been created yet -- apparent wraparound

2019-10-09 Thread Alvaro Herrera
On 2019-Oct-07, Moreno Andreo wrote: > Unfortunately, it didn't work :( > > db0=# select * from failing_table where ctid='(3160,31)' for update; > ERROR:  MultiXactId 12800 has not been created yet -- apparent wraparound Oh well. It was a long shot anyway ... > Since the probability we are int

Re: OID out of range

2020-01-15 Thread Alvaro Herrera
On 2020-Jan-15, Konireddy Rajashekar wrote: > rangetest-# \d user_tables_sizes > Table "user_tables_sizes" >Column|Type | Collation | Nullable | Default > -+-+---+--+- > relid

Re: Unable to startup postgres: Could not read from file "pg_clog/00EC"

2020-02-05 Thread Alvaro Herrera
On 2020-Feb-05, Nick Renders wrote: > Is there anything specific I should check in our postgres installation / > database to make sure it is running ok now? Anyway to see what the > consequences were of purging that one pg_clog file? Losing pg_clog files is pretty bad, and should not happen; then

Re: How to fix 0xC0000005 exception in Postgres 9.0

2020-02-20 Thread Alvaro Herrera
On 2020-Feb-20, Andrus wrote: > > Upgrade to a version of Postgres that is not 5 years past EOL? > > Not possible at moment because requires lot of testing not to break existing > applications. > Planned in future. Applications are already broken, since they can't connect, right? Seems like a g

Re: a proposal for a new functionality: "SELECT * [EXCEPT col1 [,col2]]

2020-02-25 Thread Alvaro Herrera
On 2020-Feb-25, Stanislav Motyčka wrote: > Sometimes (for tables with many columns) it would be better and easier > to write "SELECT" statement with clause "EXCEPT": > "SELECT * [EXCEPT col1 [,col2]] FROM ..." I think an important initial question is how do other database systems implement this f

Re: Exportacion por lotes

2020-03-03 Thread Alvaro Herrera
On 2020-Mar-03, Hernan Jesus Gonzalez Carmona wrote: > Estimados antes que todo me presento, mi nombre es Hernan Gonzalez, me > acabo de inscribir en esta lista de correo y desde ya me disculpo si en > este mensaje violo alguna normativa de la lista de correo pero necesito > ayuda que me apura muc

Re: Getting a error on creating a partition table index 12.2.

2020-03-05 Thread Alvaro Herrera
On 2020-Mar-05, Adrian Klaver wrote: > On 3/5/20 10:04 AM, nikhil raj wrote: > > *CREATE INDEX t_e20so1_doi_c_doid_idx > >     ON public.t_e20so1_doi USING btree > >     (i_doid ASC NULLS LAST) > >     TABLESPACE pg_default;* > > *ERROR: cannot specify default tablespace for partitioned relat

Re: Getting a error on creating a partition table index 12.2.

2020-03-05 Thread Alvaro Herrera
On 2020-Mar-05, Adrian Klaver wrote: > The OP was wondering why it worked in 12.1 and not 12.2? > > I could not see any obvious reason for that, so: > > 1) There is a not obvious reason > > 2) It did not work in 12.1 either. (2) is correct. 55469 12.1 9913=# show server_version; server_versi

Re: postgres: archiver process failed on 000000010000020A00000073

2020-04-01 Thread Alvaro Herrera
On 2020-Apr-01, Silvio Fabi - NBS srl wrote: > WAL Archive process on my DB Postgresql 10 is not working. > the WAL Archive file 0001020A0073 was accidentally deleted > and there is no backup. > Postgresql tries to run the following command: > rsync -a pg_wal/0001020A0073 >

Re: It is possible to force periodically switch xlog?

2020-04-01 Thread Alvaro Herrera
On 2020-Apr-02, Abdul Sayeed wrote: > Hi Edson, > > You can switch by using below command below PG 10. > > Select pg_switch_xlog(); > > And there is no parameter present to switch it. IIRC archive_timeout does precisely that. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ Post

Re: It is possible to force periodically switch xlog?

2020-04-01 Thread Alvaro Herrera
On 2020-Apr-02, Edson Richter wrote: > Actually, I do have a stand by server I wish to update a bit more > frequently in low traffic servers. It is better to use streaming replication for that. Using the WAL archive for that is an archaic mechanism now. -- Álvaro Herrerahttps:/

Re: Detecting renamed columns via pgouput in logical replication ?

2020-04-30 Thread Alvaro Herrera
On 2020-Apr-27, Andreas Andreakis wrote: > Are there plans to add comprehensive schema change detection abilities via > logical replication ? either by embedding more information into pgoutput or > perhaps by embedding the schema DDLs ? There aren't any plans currently that I am aware of. There

Re: How to use pg_waldump?

2020-05-01 Thread Alvaro Herrera
On 2020-May-01, André Hänsel wrote: > Paul Förster wrote: > > > maybe try with another WAL file or files? > > > > Works for me... > > Ok, I tried it with all the files in the pg_wal directory and it > worked with one: the first one (lexicographically/hex). The other files have not yet been wri

Re: Hash partitioning, what function is used to compute the hash?

2020-05-11 Thread Alvaro Herrera
On 2020-May-11, Michael Lewis wrote: > Afaik, hash partition doesn't have real world expected use cases just yet. I don't think I agree with this assertion. While I understand that there might be things still to do in this area (as everywhere else), it should certainly have its uses already. If

Re: Firing an event trigger for ADD COLUMN?

2020-05-11 Thread Alvaro Herrera
On 2020-May-11, Michel Pelletier wrote: > Is this asymmetry a bug? I realize these event trigger functions are > typically written in C, but I'd like to keep this idea contained to a > plpgsql function and cover as many reversible changes as I can. Sadly, you cannot obtain all the necessary deta

Re: Firing an event trigger for ADD COLUMN?

2020-05-11 Thread Alvaro Herrera
On 2020-May-11, Alvaro Herrera wrote: > https://www.postgresql.org/message-id/20150409161419.gc4...@alvh.no-ip.org (Please don't expect this code to compile anymore.) -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA,

Re: pg_dump of database with numerous objects

2020-06-03 Thread Alvaro Herrera
On 2020-May-31, t...@exquisiteimages.com wrote: > I am now needing to upgrade to a new version of PostgreSQL and I am running > into problems when pg_upgrade calls pg_dump. pg_dump stalled at: "pg_dump: > saving database definition" for 24 hours before I killed the process. > > My pg_class table

Re: Oracle vs. PostgreSQL - a comment on Mysql

2020-06-03 Thread Alvaro Herrera
On 2020-Jun-03, Martin Mueller wrote: > On the topic of what other databases do better: I much prefer Postgres to > Mysql because it has better string functions and better as well as very > courteous error messages. But MySQL has one feature that sometimes makes me > want to return it: it store

Re: suggestion/question pgpass alias?

2020-06-11 Thread Alvaro Herrera
On 2020-Jun-11, Caleb Cushing wrote: > is it possible to support an alias for a pgpassfile? what I'm looking to do > is > > psql --alias company -h localhost > > and not type anything else and get a shell. if this is not possible could > this be added? I think what you want is a "service" file

Re: suggestion: psql configs in .config

2020-06-11 Thread Alvaro Herrera
On 2020-Jun-11, Tom Lane wrote: > I'm finding it hard to see a compelling reason why that would be an > improvement. It would make psql randomly different from 95% of the > other programs that have similar config files. Or, if everybody > somehow got on board with "let's put config files in ~/.c

Re: PostgreSQL 12 - ERROR: could not rename file "pg_logical/snapshots/1A-7C00D890.snap.13594.tmp" to "pg_logical/snapshots/1A-7C00D890.snap": No space left on device

2020-07-01 Thread Alvaro Herrera
On 2020-Jun-30, FOUTE K. Jaurès wrote: > Hi everyone, > > I am use a native logical replication in PostgreSQL 12 on Ubuntu 16.04 and > all is working fine until i faced this error below. > > ERROR: could not rename file > "pg_logical/snapshots/1A-7C00D890.snap.13594.tmp" to > "pg_logical/snapsh

Re: invalid non-zero objectSubId for object class

2020-07-09 Thread Alvaro Herrera
On 2020-Jul-09, Michel Pelletier wrote: > Hi Tom, thanks for getting back so quick: > > I don't seem to have either: > > dev=> select * from pg_depend where classid = 297108 or refclassid = 297108; > classid | objid | objsubid | refclassid | refobjid | refobjsubid | deptype > -+---+

Re: invalid non-zero objectSubId for object class

2020-07-10 Thread Alvaro Herrera
On 2020-Jul-09, Michel Pelletier wrote: > I restored a snapshot and I can drop the tables there, so we'll likely > proceed to swap the replicas over tomorrow. I have this corrupted > instance i can continue to debug on if necessary. There seem to be some > other issues now that we're investigat

Re: bad JIT decision

2020-07-27 Thread Alvaro Herrera
On 2020-Jul-24, Andres Freund wrote: > I think the issue is more that we need to take into accoutn that the > overhead of JITing scales ~linearly with the number of JITed > expressions. And that's not done right now. I've had a patch somewhere > that had a prototype implementation of changing the

Re: bad JIT decision

2020-07-27 Thread Alvaro Herrera
On 2020-Jul-27, Scott Ribe wrote: > > On Jul 27, 2020, at 4:00 PM, Alvaro Herrera > > wrote: > > > > I don't quite understand why is it that a table with 1000 partitions > > means that JIT compiles the thing 1000 times. Sure, it is possible that > >

Re: 12.3 replicas falling over during WAL redo

2020-08-01 Thread Alvaro Herrera
On 2020-Aug-01, Ben Chobot wrote: > We have a few hundred postgres servers in AWS EC2, all of which do streaming > replication to at least two replicas. As we've transitioned our fleet to > from 9.5 to 12.3, we've noticed an alarming increase in the frequency of a > streaming replica dying during

Re: 12.3 replicas falling over during WAL redo

2020-08-03 Thread Alvaro Herrera
On 2020-Aug-03, Ben Chobot wrote: > rmgr: Btree   len (rec/tot): 72/    72, tx:   76396065, lsn: > A0A/AC4204A0, prev A0A/AC420450, desc: INSERT_LEAF off 48, blkref #0: rel > 16605/16613/60529051 blk 6501 > > So then I did: > > /usr/lib/postgresql/12/bin/pg_waldump -p /var/lib/postgresql

Re: 12.3 replicas falling over during WAL redo

2020-08-03 Thread Alvaro Herrera
On 2020-Aug-03, Ben Chobot wrote: > Alvaro Herrera wrote on 8/3/20 12:34 PM: > > On 2020-Aug-03, Ben Chobot wrote: > > > > Yep. Looking at the ones in block 6501, > > > > > rmgr: Btree   len (rec/tot): 72/    72, tx:   76393394, lsn: > &g

Re: 12.3 replicas falling over during WAL redo

2020-08-03 Thread Alvaro Herrera
On 2020-Aug-03, Ben Chobot wrote: > Alvaro Herrera wrote on 8/3/20 2:34 PM: > > On 2020-Aug-03, Ben Chobot wrote: > > dd if=16605/16613/60529051 bs=8192 count=1 seek=6501 of=/tmp/page.6501 > > If I use skip instead of seek Argh, yes, I did correct that in my test a

Re: 12.3 replicas falling over during WAL redo

2020-08-04 Thread Alvaro Herrera
On 2020-Aug-03, Alvaro Herrera wrote: > > lsn  | checksum | flags | lower | upper | special | pagesize | > > version | prune_xid > > --+--+---+---+---+-+--+-+--- > >  A0A/99BA11F8 | -215 | 0 |

Re: Server goes to Recovery Mode when run a SQL

2020-08-14 Thread Alvaro Herrera
On 2020-Aug-14, PegoraroF10 wrote: > CREATE FUNCTION public.fntextonumero(ftext text, finteger public.i32) How is public.i32 defined? -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: Reconstructing transaction content after the fact

2020-09-02 Thread Alvaro Herrera
On 2020-Sep-02, Tom Lane wrote: > Lionel Bouton writes: > > Are these t_xmin values ever cleaned up (by VACUUM or another mechanism) > > ? If positive is there a way to configure the approximate time during > > which these values can be recovered ? > > See VACUUM FREEZE. You couldn't hide conn

Re: PKEY getting corrupted

2020-09-10 Thread Alvaro Herrera
Danny, On 2020-Sep-10, Abraham, Danny wrote: > We have seen several times a situation where a PKEY is compromised and > duplicate values are created within a table. Yeah, this is not unheard of. > This has happened so far on PG 928 on Linux and Windows, and also on > PG955 on AIX. You do reali

Re: Writing WAL files

2020-10-04 Thread Alvaro Herrera
Hello Robert On 2020-Oct-04, Robert Inder wrote: > One of the things I like about the old PGSQL 9 setup is that it generates > and ships a WAL file every few minutes, even if nothing has happened in the > database. > I find it re-assuring to be able to see WAL files arriving and being > processed

Re: UUID with variable length

2020-10-16 Thread Alvaro Herrera
On 2020-Oct-15, Dirk Krautschick wrote: > Hi, > > I have here a situation with the usage of UUID. Here the database user > allows UUIDs with less then 16 byte lengths (please don't ask :-) ). > > Of course there are some technical ways to do the filling of the not > used bytes but I hope there i

Re: Reference-Partitioned Tables

2020-11-07 Thread Alvaro Herrera
On 2020-Nov-06, Сергей _ wrote: > https://docs.oracle.com/database/121/VLDBG/GUID-00923EB3-05F6-41F7-8437-E42FC9BD9571.htm#VLDBG1093 > > There is a widespread model when data related to properties of a superclass > is stored in a base table, and data related to subclasses in a detail table. > Or

Re: New "function tables" in V13 documentation

2020-11-09 Thread Alvaro Herrera
On 2020-Nov-08, Adrian Klaver wrote: > On 11/8/20 1:57 PM, Thomas Kellerer wrote: > > In case someone is interested: there is a little discussion going on on > > Reddit whether the new format of presenting functions in V13 is a step > > backwards: > > > > > > https://www.reddit.com/r/Postgre

Re: New "function tables" in V13 documentation

2020-11-09 Thread Alvaro Herrera
On 2020-Nov-09, Adrian Klaver wrote: > > If you have suggestion on how to improve the new format, I'm sure we can > > discuss that. It seems pretty clear to me that we're not going back to > > the old format. > > Improve it by going back to old format. Not sure why that is not open to > discussi

Re: psql backward compatibility

2020-11-18 Thread Alvaro Herrera
On 2020-Nov-18, Stephen Haddock wrote: > Hello, > > When upgrading an older version of postgres, version 8.4 for example, to a > newer version such as 9.6, does the data have to be migrated immediately? As others have said: yes. > It looks like the recommended method is to dump the data, upgrad

Re: Potential BRIN Index Corruption

2020-11-25 Thread Alvaro Herrera
On 2020-Nov-26, Huan Ruan wrote: > Hi All > > We cannot work out a reproducible case but we have a copy of the offending > database. I was hoping to know I think the way to debug this would be to see what WAL records have been emitted for the index, using pageinspect to find the problem index tu

Re: Deleting takes days, should I add some index?

2020-11-27 Thread Alvaro Herrera
On 2020-Nov-27, Alexander Farber wrote: > Referenced by: > TABLE "words_chat" CONSTRAINT "words_chat_gid_fkey" FOREIGN KEY (gid) > REFERENCES words_games(gid) ON DELETE CASCADE > TABLE "words_moves" CONSTRAINT "words_moves_gid_fkey" FOREIGN KEY (gid) > REFERENCES words_games(gid) ON DELETE

Re: Do we need a way to moderate mailing lists?

2021-01-16 Thread Alvaro Herrera
On 2021-Jan-16, Hemil Ruparel wrote: > Okay. I will not reply to them. Enough mental cycles wasted One way you could help, is by learning what top-posting is, learning not to do it, and teaching others the same. Same with not quoting entire messages on reply. -- Álvaro Herrera Valdivia,

  1   2   3   4   >