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

2024-02-23 Thread Vick Khera
On Thu, Feb 22, 2024 at 5:06 PM Erik Wienhold wrote: > On 2024-02-22 22:14 +0100, Vick Khera wrote: > > On Wed, Feb 21, 2024 at 4:27 PM Tom Lane wrote: > > > > > For the moment, I think the only feasible solution is for your trigger > > > function to set the

Re: Performance issue debugging

2024-02-22 Thread Vick Khera
On Thu, Feb 22, 2024 at 4:03 PM veem v wrote: > Hi All, > As i understand we have pg_stats_activity which shows the real time > activity of sessions currently running in the database. And the > pg_stats_statement provides the aggregated information of the historical > execution of all the queries

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

2024-02-22 Thread Vick Khera
On Wed, Feb 21, 2024 at 4:27 PM Tom Lane wrote: > 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. The error is not in the function, it is the WHE

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

2024-02-21 Thread Vick Khera
I've created a database which my vendor (Supabase) cannot dump/restore/upgrade. Ultimately, it comes down to this trigger statement, and the fact that the underlying operations needed to perform the `IS DISTINCT FROM` comparison in the WHEN clause need to be found in the `public` schema. During the

Re: Vacuum process waiting on BufferPin

2018-08-14 Thread Vick Khera
On Tue, Aug 14, 2018 at 9:21 AM, Don Seiler wrote: > On Mon, Aug 13, 2018 at 5:55 PM, Vick Khera wrote: > >> On Mon, Aug 13, 2018 at 5:19 PM, Don Seiler wrote: >> >>> >>> I don't quite follow this. What circumstances would lead to this >>>

Re: Vacuum process waiting on BufferPin

2018-08-13 Thread Vick Khera
On Mon, Aug 13, 2018 at 5:19 PM, Don Seiler wrote: > On Mon, Aug 13, 2018 at 4:15 PM, Alvaro Herrera > wrote: > >> >> Maybe you had a cursor that was not fully scanned before the session was >> left idle -- as I recall, those can leave buffers pinned. >> > > I don't quite follow this. What circu

Re: Settings for fast restores

2018-08-01 Thread Vick Khera
On Wed, Aug 1, 2018 at 2:03 AM, Ron wrote: > Hi, > > http://www.databasesoup.com/2014/09/settings-for-fast-pgrestore.html > > shared_buffers = 1/2 of what you'd usually set > maintenance_work_mem = 1GB-2GB > wal_level = minimal > full_page_writes = off > wal_buffers = 64MB > checkpoint_segments =

Re: Order in which tables are dumped

2018-07-25 Thread Vick Khera
On Wed, Jul 25, 2018 at 11:15 AM, Ron wrote: > Hi, > > v8.4 if it matters. > > It looked like the tables were being backed up in alphanumeric order, but > now I see that table "docformat" is being dumped *after* "doc_image". > > Are there some other rules besides alphabetical sorting? > Is there

Re: PG backup check

2018-07-16 Thread Vick Khera
On Mon, Jul 16, 2018 at 8:35 PM, Ravi Krishna wrote: > Not sure I am following this. Did Google release this because PG backups > are not 100% reliable or the data corruption can occur due to hardware > failure. > > http://www.eweek.com/cloud/google-releases-open-source- > tool-that-checks-postg

Re: User documentation vs Official Docs

2018-07-16 Thread Vick Khera
On Mon, Jul 16, 2018 at 5:44 PM, Joshua D. Drake wrote: > On 07/16/2018 02:22 PM, Joshua D. Drake wrote: > >> On 07/16/2018 01:59 PM, Stephen Frost wrote: >> >>> >>> We have a place for this to go, in the official docs, already split out >>> by version, and it starts here: >>> >>> https://www.pos

Re: Disabling/Enabling index before bulk loading

2018-07-10 Thread Vick Khera
On Tue, Jul 10, 2018 at 1:13 PM, Ravi Krishna wrote: > > > > Did you include the time to CREATE INDEX after the COPY or is the 1:14 > only for the COPY stage? > > Yes. > > Time taken to load 47 mil rows with all 16 indexes intact: 14+ hrs > Time taken to load the same after dropping index and th

Re: dumping only table definitions

2018-06-30 Thread Vick Khera
On Fri, Jun 29, 2018 at 6:39 PM, Alvaro Herrera wrote: > 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

Re: Database name with semicolon

2018-06-27 Thread Vick Khera
On Wed, Jun 27, 2018 at 10:25 AM, Pavel Stehule wrote: > Hi > > > modern Postgresql has not any problems with special chars > > I think the issue is that he cannot create a proper connection string to pass to the ODBC driver, since semi-colon is used as a delimiter for the fields.

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

2018-06-22 Thread Vick Khera
On Wed, Jun 20, 2018 at 1:35 PM, Jerry Jelinek wrote: > As Dave described in his original email on this topic, we'd like to avoid > recycling WAL files since that can cause performance issues when we have a > read-modify-write on a file that has dropped out of the cache. > > I have implemented a

Re: Append only replication over intermittent links (with local only delete?)

2018-06-15 Thread Vick Khera
On Thu, Jun 14, 2018 at 8:04 AM, Uri Braun wrote: > To be clear, the car device will surely add data -- append rows -- and may > very occasionally add a new table. I would expect the only case where a > delete may occur -- other than culling old data -- is during recovery of a > partial write or

Re: Multiple PostgreSQL instances on one machine

2018-06-08 Thread Vick Khera
If they are just test environments, why a whole dedicated cluster per instance? Just give each a unique name for the database and run it all on one cluster. I'd also go back and reconsider why these are separate machines in the first place and make sure you're not violating any assumptions that we

Re: When use triggers?

2018-05-18 Thread Vick Khera
On Wed, May 16, 2018 at 6:19 PM, hmidi slim wrote: > HI, > > I'm working on a microservice application and I avoid using triggers > because they will not be easy to maintain and need an experimented person > in database administration to manage them. So I prefer to manage the work > in the applic

Re: Domain based on TIMEZONE WITH TIME ZONE

2018-05-10 Thread Vick Khera
On Thu, May 10, 2018 at 7:31 AM, Ben Hood wrote: > Or are we saying that domains are one way of achieving the timestamp > hygiene, but equally, you can get the same result as described above? > The *only* way to have timestamp hygiene is to require them to have time zones at all times, even if t

Re: Known Bugs on Postgres 9.5

2018-05-06 Thread Vick Khera
On Sat, May 5, 2018 at 7:49 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > If you want an opinion, opting for more than one release behind current on > fear grounds is an ultra-conservative position - you might as well minimize > the pain and go recent and keep it longer. At this po

Re: Known Bugs on Postgres 9.5

2018-05-05 Thread Vick Khera
If you're using Postgres for Jira and Confluence, you should upgrade to 9.6. It is the newest version that is known to work. Version 9.5 will also work but you will get better performance and longer life out of the 9.6 version.

Re: Backup Strategy Advise

2018-04-24 Thread Vick Khera
On Tue, Apr 24, 2018 at 10:50 AM, David Gauthier wrote: > Typically, I would think doing a weekly full backup, daily incremental > backups and turn on journaling to capture what goes on since the last > backup. > This is almost the whole concept of the streaming replication built into postgres,

Re: Postgresql database encryption

2018-04-20 Thread Vick Khera
On Fri, Apr 20, 2018 at 11:24 AM, Vikas Sharma wrote: > Hello Guys, > > Could someone throw light on the postgresql instance wide or database wide > encryption please? Is this possible in postgresql and been in use in > production?. > For anyone to offer a proper solution, you need to say what p

Re: A couple of pg_dump questions

2018-04-20 Thread Vick Khera
On Thu, Apr 19, 2018 at 6:39 PM, Ron wrote: > > $ pg_dump --host=farawaysrvr -Fc $REMOTEDB > /local/disk/backups/$REMOTEDB. > dump > > Is the data compressed on the remote server (thus minimizing traffic on > the wire), or locally? (I'd test this myself, but the company has really > strict firew

Re: Doubts about replication..

2018-04-19 Thread Vick Khera
You want the replication for backup purposes. What is the use case for your backups: Is it disaster recovery? Is it archiving historical data? Is it failover? Is it off-site backup? If you outline your needs then the proper solution can be offered. There are other methods than just using the built

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

2018-04-18 Thread Vick Khera
On Wed, Apr 18, 2018 at 12:35 AM, Michael Paquier wrote: > > That looks like a rather difficult problem to solve in PostgreSQL > itself, as the operator running the cluster is in charge of setting up > the FS options which would control the COW behavior, so it seems to me > You cannot turn off C

Re: client_encoding issue with SQL_ASCII on 8.3 to 10 upgrade

2018-04-16 Thread Vick Khera
Hi Keith, Not sure if this will help but a couple of years ago I migrated from an SQL_ASCII encoding to UTF8. The data was primarily ASCII with some windows garbage, and a little bit of UTF8 from customers filling out forms that were not specifically encoded anything. I wrote a utility that in-pl

Re: Jira database won't start after disk filled up

2018-03-04 Thread Vick Khera
On Fri, Mar 2, 2018 at 5:13 PM, Paul Costello wrote: > My hope is that I can get the db back to 1/10 and maybe we can, with > Atlassian's help, somehow sync the lucene files back to the db. I don't > think I will have any postgres data to work with beyond 1/10. > > Does this still sound do-able

Re: Jira database won't start after disk filled up

2018-03-02 Thread Vick Khera
On Fri, Mar 2, 2018 at 4:32 PM, Paul Costello wrote: > I have a database that wouldn't start due to the disk filling up back on > 1/10, unbeknownst to us until 2/27. This is jira, so it's critical data. > It appears jira was running in memory that entire time. > Those first two sentences seem

Re: Is there a continuous backup for pg ?

2018-03-02 Thread Vick Khera
On Fri, Mar 2, 2018 at 2:34 PM, Gary M wrote: > Thanks Josh, > > PITR is the option I was recommending. Project management diligence > dictates I need at least one other option from a different recommending > source, two other options optimally. > File system snapshot on a robust system like ZFS

Re: Version upgrade: is restoring the postgres database needed?

2018-03-01 Thread Vick Khera
On Thu, Mar 1, 2018 at 11:51 AM, Ron Johnson wrote: > Good. What, then, have I forgotten to restore such that the "Access > privileges" are showing on my current 9.2 servers, but not on the > newly-restored 9.6.6 server? > > *Current* > postgres=# \l >List of

Re: Version upgrade: is restoring the postgres database needed?

2018-03-01 Thread Vick Khera
On Thu, Mar 1, 2018 at 11:15 AM, Ron Johnson wrote: > No, I do: > > $ pg_dump -Fc PROD > PROD.pgdump > $ pg_dump --globals-only postgres > globals.sql > $ pg_dump -Fc postgres > postgres.pgdump > > That's how I back them up as well. You are correct that all you need to do is restore the globals.s

Re: shared_buffers 8GB maximum

2018-02-18 Thread Vick Khera
On Sun, Feb 18, 2018 at 7:41 AM, Vitaliy Garnashevich < vgarnashev...@gmail.com> wrote: > > In the case when shared_buffers cover most of RAM, most of writes should > happen by checkpointer, and cache hit ratio should be high. So a > hypothetical question: Could shared_buffers=200GB on a 250 GB RA

Re: why SSD is slower than HDD SAS 15K ?

2018-01-15 Thread Vick Khera
Try random page cost 1.1. Way back when I started using SSD we had a discussion here and came to the conclusion that it should be ever so slightly higher than sequential page cost. It is very hard to read your query plans (maybe gmail is wrapping them funny or you need to use a fixed font on them

Re: psql format result as markdown tables

2018-01-14 Thread Vick Khera
How does this work for you? I use this to get tables to insert into my wiki, which are basically the format you want. I just delete the extra lines I don't want at the end. vk=> SELECT * FROM (values(1,2),(3,4)) as t; column1 | column2 -+- 1 | 2 3 | 4 (2

Re: a back up question

2017-12-06 Thread Vick Khera
On Wed, Dec 6, 2017 at 7:52 AM, Martin Mueller < martinmuel...@northwestern.edu> wrote: > > The objective is to create a backup from which I can restore any or all > tables in the event of a crash. In my case, I use Postgres for my own > scholarly purposes. Publications of whatever kind are not

Re: migrations (was Re: To all who wish to unsubscribe)

2017-11-22 Thread Vick Khera
On Wed, Nov 22, 2017 at 9:07 AM, Stephen Frost wrote: > Greetings everyone, > > * Mike Sofen (mso...@runbox.com) wrote: > > Confirmed, I did not get a reset email either. Also, I had subscribed > to the digest version and now I get individual emails - which is why I > needed to login, but my pas

Re: To all who wish to unsubscribe

2017-11-20 Thread Vick Khera
On Mon, Nov 20, 2017 at 2:11 PM, Tom Lane wrote: > Vick Khera writes: > > Did the list software change? All my messages from here are not being > properly auto-files by the filter I have set up. > > Yes - did you not see either of the "migration to pglister" messages

Re: To all who wish to unsubscribe

2017-11-20 Thread Vick Khera
Did the list software change? All my messages from here are not being properly auto-files by the filter I have set up. > On Nov 20, 2017, at 13:48, Martin Fernau wrote: > > PLS unsubscribe via https://lists.postgresql.org/manage/ > > Today I received dozens of unsubscribe mails, spamming my m