Question about AWS Calculator

2018-03-29 Thread Ravi Krishna
I am using http://calculator.s3.amazonaws.com/index.html to calculate the cost of RDS vs EC2. Assuming that I am going for only a 2 node setup (master and slave), few questions: 1. In EC2 how do I indicate that I need two nodes so that I can set up streaming replication between them for HA. Do

FDW with DB2

2018-04-06 Thread Ravi Krishna
Has anyone used PG with DB2(Linux) ?

Re: FDW with DB2

2018-04-06 Thread Ravi Krishna
On Fri, Apr 6, 2018 at 4:09 PM, Joshua D. Drake wrote: > On 04/06/2018 01:01 PM, Ravi Krishna wrote: > > Has anyone used PG with DB2(Linux) ? > > > Looks like the way you go about it is with the ODBC FDW. > ​https://wiki.postgresql.org/wiki/Foreign_data_wrappers There are

Re: FDW with DB2

2018-04-06 Thread Ravi Krishna
> > > > the CartoDB ODBC driver works quite well. I've used it to move a large > amount of data from DB2 and Netezza databases. > ​Hello Steven Will it be OK if I or my team reach out to you for any guidance/help. ​

Re: FDW with DB2

2018-04-06 Thread Ravi Krishna
Yes of course I respect your time. regards. Please do not contact me personally, as I'm too busy to provide technical > support on a private basis. Thanks for your understanding! >

Re: Rationale for aversion to the central database?

2018-04-08 Thread Ravi Krishna
1. With a micro service based architecture these days, it is difficult to justify putting all logic in a central database as you can only scale up in a database. Business logic in things like Spark can make a claim for scale out solution. 2. All RDBMS have a non portable stored proc language, maki

Re: Rationale for aversion to the central database?

2018-04-08 Thread Ravi Krishna
> I am however very comfortable with using psql and PL/pgSQL and I am very opinionated. Nothing wrong with this approach and it may very well work 90% of the time. Until ... a day comes when you need to migrate out of PG to another RDBMS. Good luck at that time.

Two things bit baffling in RDS PG

2018-05-03 Thread Ravi Krishna
I am playing around with RDS PG and I am not able to understand the following: 1. The database name I created via RDS console is in upper case with no quotes. From the remote machine via psql, if I try to use lower case db name with the -d option it errors out "database not found". Works

Re: Semantics around INSERT INTO with SELECT and ORDER BY.

2018-06-12 Thread Ravi Krishna
Why is it even important? Once you use ORDER BY clause, you are guaranteed to get the rows in the order. Why do you need how it was inserted in the first place.

Re: Semantics around INSERT INTO with SELECT and ORDER BY.

2018-06-12 Thread Ravi Krishna
>Or to put it another way, I want to select values from one table ordered by >complex criteria and insert them into another table. I want to be able to >retrieve the rows from the target table in the same order they were inserted, >but I don't care about the specific ordering criteria. I only care

PG on AWS RDS and IAM authentication

2018-06-12 Thread Ravi Krishna
As per https://forums.aws.amazon.com/thread.jspa?threadID=258822&tstart=0 there was no IAM authentication for PG on AWS RDS. (It is there for MySQL). However the link is a year old. Has it changed since then? Can we use IAM authentication for PG. Thanks

Re: PostgreSQL Volume Question

2018-06-14 Thread Ravi Krishna
> > Hi, I'm new to the community. > > Recently, I've been involved in a project that develops a social network data > analysis service (and my client's DBMS is based on PostgreSQL). > I need to gather huge volume of unstructured raw data for this project, and > the problem is that with Postgre

Load data from a csv file without using COPY

2018-06-19 Thread Ravi Krishna
In order to test a real life scenario (and use it for benchmarking) I want to load large number of data from csv files. The requirement is that the load should happen like an application writing to the database ( that is, no COPY command). Is there a tool which can do the job. Basically parse

Re: Load data from a csv file without using COPY

2018-06-19 Thread Ravi Krishna
> > If performance is relevant then your app should probably be using COPY > protocol, not line by line inserts. It's > supported by most postgresql access libraries. If your app does that then > using "\copy" from psql would be > an appropriate benchmark. Actually the reluctance to not use COP

Re: Load data from a csv file without using COPY

2018-06-19 Thread Ravi Krishna
> > I think an easy approach would be to COPY the CSV files into a separate > database using psql's \copy command and then pg_dump that as separate insert > statements with pg_dump —inserts. > This was my first thought too. However, as I understand, pg_dump --insert basically runs INSERT INT

Re: Load data from a csv file without using COPY

2018-06-19 Thread Ravi Krishna
Thanks all for replying. I see that I did not explain my requirement in detail. So let me explain it in detail. 1. Currently we have a legacy app running in DB2/LUW. Application writes to it either via Java program or uses a custom ETL scripts using a vendor product. 2. We want to migrat

Re: using pg_basebackup for point in time recovery

2018-06-21 Thread Ravi Krishna
> > > >You should avoid top-posting on the Postgres lists, this is not the > >usual style used by people around :) > > Will do, but Yahoo Mail! does not seem to like that, so I am typing the > > myself > Same here even though I use Mac mail. But it is not yahoo alone. Most of the web email c

Re: Convert Existing Table to a Partition Table in PG10

2018-06-23 Thread Ravi Krishna
Does this help: http://ashutoshpg.blogspot.com/2018/06/upgrade-your-partitioning-from.html

Disabling/Enabling index before bulk loading

2018-07-10 Thread Ravi Krishna
We recently did a test on COPY and found that on large tables (47 million rows , 20GB of raw data) the difference in COPY with 16 indexes and COPY without any index is 1:14. That is, COPY is 14 times slower when data is ingested with all indexes as opposed to COPY first without index and the

Re: Disabling/Enabling index before bulk loading

2018-07-10 Thread Ravi Krishna
> > 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 then loading and finally creating 16 indexes: 1 hr 40 min Frankly

Re: Disabling/Enabling index before bulk loading

2018-07-10 Thread Ravi Krishna
> > > https://fle.github.io/temporarily-disable-all-indexes-of-a-postgresql-table.html > > > This does not work in RDS. In order to update system catalog tables (pg_index), one needs privileges which is den

Re: Disabling/Enabling index before bulk loading

2018-07-10 Thread Ravi Krishna
> > I am very suspicious of why you need 16 indexes. Are you sure all those > indexes are actually being utilized? > Try executing the attached query, You may find find some are really not > needed. This is a DATAMART application and the indexes are to satisfy a large number of queries possibl

Re: Extremely slow autovacuum:vacuum to prevent wraparound

2018-07-11 Thread Ravi Krishna
> Setting it that high and disabling autovacuum isn’t just silly - it borders > on sabotage! LOL. My thoughts too. Perhaps some disgruntled employee's parting shot before quitting :-)

Re: Using CTE vs temporary tables

2018-07-11 Thread Ravi Krishna
​Does temp tables also suffer from optimization fence we see in CTE.​ >

Re: Open Source tool to deploy/promote PostgreSQL DDL

2018-07-11 Thread Ravi Krishna
> > Where I work, the requirement to have rollback scripts is part of the ITIL > requirement for Changes to have a backout procedure. > Liquibase provides that ability, but IMO rollback for RDBMS is always bit tricky. Certain DDL operations can take long time if it involves a table rewrite.

Re: Do we need yet another IDE (SQL development assistant) for PostgreSQL?

2018-07-15 Thread Ravi Krishna
What would this new IDE offer which a product like dbeaver does not have. --Sent from phone.

Re: Do we need yet another IDE (SQL development assistant) for PostgreSQL?

2018-07-15 Thread Ravi Krishna
shop and we love it. On Sun, Jul 15, 2018 at 4:22 PM, Dmitry Igrishin wrote: > > > вс, 15 июл. 2018 г. в 23:05, Ravi Krishna : > >> What would this new IDE offer which a product like dbeaver does not have. >> > AFAIK, DBeaver: > - covers many DBMS (I want to fo

PG backup check

2018-07-16 Thread Ravi Krishna
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-postgres-backup-integrity?utm_medium=email&utm_campaign=EWK_NL_EP_201807

Re: PANIC: could not open critical system index 2662

2018-08-06 Thread Ravi Krishna
Just curious, why can't you restore the db from the backup ?

What is the use case for UNLOGGED tables

2018-08-14 Thread Ravi Krishna
I am trying to understand the use case for UNLOGGED tables in PG. I am specifically talking about normal tables which need to be turned into UNLOGGED for a specific purpose like bulk loading because generating WAL logs during the load makes no sense, even when we take into consideration that

Re: What is the use case for UNLOGGED tables

2018-08-14 Thread Ravi Krishna
> > I use them for "ELT" oriented processing where the final results get stored > on permanently logged tables but I want to manipulate tables while > transforming from the original input. Yeah I see the use case. Basically raw data -> rolled up data -> to final results in normal tables. Howe

Re: CTE with JOIN of two tables is much faster than a regular query

2018-08-18 Thread Ravi Krishna
> What can I do to improve the performance of the regular query without using a > CTE? Why do you care ? When I find that I can write a SQL 3 different ways, I will go for the most efficient one. So why not accept the CTE version of this SQL. Just curious.

[no subject]

2018-08-20 Thread Ravi Krishna
Can I split a large file into multiple files and then run copy using each file.  The table does not contain any serial or sequence column which may need serialization. Let us say I split a large file to 4 files.  Will theperformance boost by close to 4x??

Multiple COPY on the same table

2018-08-20 Thread Ravi Krishna
Can I split a large file into multiple files and then run copy using each file.  The table does not contain any serial or sequence column which may need serialization. Let us say I split a large file to 4 files.  Will theperformance boost by close to 4x?? ps: Pls ignore my previous post which wa

Re: [External] Multiple COPY on the same table

2018-08-20 Thread Ravi Krishna
> What is the goal you are trying to achieve here. > To make pgdump/restore faster? > To make replication faster? > To make backup faster ? None of the above.  We got csv files from external vendor which are 880GB in total size, in 44 files.  Some of the large tables had COPY running for severa

Re: [External] Multiple COPY on the same table

2018-08-20 Thread Ravi Krishna
1. The tables has no indexes at the time of load.2.  The create table and copy are in the same transaction. So I guess that's pretty much it.  I understand the long time it takes as some of the tables have 400+ million rows.Also the env is a container and since this is currently a POC system , n

COPY FROM - to avoid WAL generation

2018-08-21 Thread Ravi Krishna
In a recent thread of mine I learned something very interesting.  If a table is created and data is loaded via COPY FROM within the same transaction, then PG will be smart enough to not generate WAL logs because all it needs to do is to track the status of the transaction and let the data load g

Re: COPY FROM - to avoid WAL generation

2018-08-21 Thread Ravi Krishna
>Please note this is only the case if wal_level = minimal. If replication >(or PITR) is supported, that mode can't be used, because the data has to >go into the WAL. >Were you using wal_level = minimal? Aha. No it was not minimal. For a second I thought PG is super smart. Oh well.  Thanks.  

Re: Can Pg somehow recognize/honor linux groups to control user access ?

2018-08-22 Thread Ravi Krishna
AFAIK PG does not support it , as yet. IMO this should be implemented as a priority.

Re: Can Pg somehow recognize/honor linux groups to control user access ?

2018-08-22 Thread Ravi Krishna
> On Aug 22, 2018, at 12:08 , David G. Johnston > wrote: > > On Wed, Aug 22, 2018 at 8:58 AM, Ravi Krishna <mailto:sravikris...@aol.com>> wrote: > AFAIK PG does not support it , as yet. IMO this should be implemented as a > priority. > > It does not suppo

Re: pg_sample

2018-08-24 Thread Ravi Krishna
> > sir have taken pg_sample > Now i want to run pg_sample with credential but i'm getting this error > > Can't locate DBI.pm in @INC (@INC contains: /usr/local/lib64/perl5 > /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl > /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .)

WARNING: could not flush dirty data: Function not implemented

2018-09-02 Thread Ravi Krishna
Ubuntu 18.04 as Windows bash Distributor ID: Ubuntu Description:Ubuntu 18.04.1 LTS Release:18.04 Codename: bionic PG 10.5.1 postgres@ravi-lenovo:~$ psql -d postgres psql (10.5 (Ubuntu 10.5-1.pgdg16.04+1)) A CREATE DATABASE statement spewed out WARNING: could not flush dirt

Re: WARNING: could not flush dirty data: Function not implemented

2018-09-02 Thread Ravi Krishna
> > If this is on Ubuntu, I don't understand why you're talking > about Windows. Because I am using Ubuntu Bash on Windows, which requires WLS (Windows Linux Subsystem). I also have necessary build version of Windows which supports Ubuntu Bash.

Re: WARNING: could not flush dirty data: Function not implemented

2018-09-03 Thread Ravi Krishna
>That means that the linux emulation by microsoft isn't good enough. You >can work around it by setting checkpoint_flush_after=0 and >wal_writer_flush_after=0. bgwriter_flush_after = 0# measured in pages, 0 disables backend_flush_after = 0# measured in pages, 0 di

Re: WARNING: could not flush dirty data: Function not implemented

2018-09-03 Thread Ravi Krishna
> > Whee ... so you get to cope with all the bugs/idiosyncrasies of three > operating system layers, not just one. I concur that running Postgres > in the underlying Windows O/S is probably a much better idea. Me too, but this is purely for learning and I am much more use to Linux stack then ..

Re: *Regarding brin_index on required column of the table

2018-09-21 Thread Ravi Krishna
> i can see a lot of max(string-field) (for instance, LastName, > MiddleName, FirstName). > wild guess: completely broken design, but i don't know your application > and use-case for that. > again, as i said already, i think this is a case for an in-deep > consultation. My thoughts exactly.

New behavior with JDBC 42.2.5

2018-09-21 Thread Ravi Krishna
We recently upgraded our JDBC driver to 42.2.5 after seeing this https://www.postgresql.org/about/news/1883/ All of our PG databases mandates SSL connections. So the first line in pg_hba.conf is hostnossl all all all reject We use dbeaver and while setting up connection we check box SSL (requi

Re: New behavior with JDBC 42.2.5

2018-09-21 Thread Ravi Krishna
Just to clarify: With JDBC 42.1.4 attempt to connect from dbeaver without SSL results in the following error: "pg_hba.conf rejected the connection: SSL off" This is what we expect. With 42.2.5, the connection succeeds without SSL.

Re: New behavior with JDBC 42.2.5

2018-09-21 Thread Ravi Krishna
> First are doing a socket connection or a host connection? Socket > connections ignore sslmode. The URL template of JDBC used by dbeaver is jdbc:postgresql://{host}[:{port}]/[{database}] >From the manual "The host component is interpreted as described for the parameter host. In particular, a

PG security alerts

2018-09-27 Thread Ravi Krishna
Hi Is there a place to get all PG related security alerts?  I saw this in IBM site: https://www-01.ibm.com/support/docview.wss?uid=ibm10730491 which points to this: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-10915 >From the looks of it, it seems to be a generic libpq

Re: Why my query not using index to sort?

2018-09-28 Thread Ravi Krishna
> Is there anyway, I can improve the sorting so that it can use the index ? Are you telling that why PG is not simply reading the data from the index (which is already in sorted order)?

COPY from a remote machine in Datastage

2018-10-05 Thread Ravi Krishna
We are doing a POC of using Datastage with PG using ODBC. Problem to solve: How to load a large CSV file using COPY command. The file is on the client machine. A typical SQL syntax of a copy coming from a remote machine COPY TABLE FROM STDIN WITH CSV HEADER Question is, how to make the

Re: COPY from a remote machine in Datastage

2018-10-05 Thread Ravi Krishna
> > Hello, if you need to use COPY command from remote machine and you use some > libpq bindings (aka ruby pg gem for example), you can use functions > associated with COPY command > (https://www.postgresql.org/docs/10/static/libpq-copy.html >

Re: COPY from a remote machine in Datastage

2018-10-05 Thread Ravi Krishna
> > Can you install the postgres client software (psql) on the client machine and > then have Datastage spawn "psql -c 'COPY ...'"? That is already an option for us :-)

Re: COPY threads

2018-10-10 Thread Ravi Krishna
> > You obviously can just copy the data into postgres over multiple > connections if you need to speed COPY up. But that requires splitting up > the data on the clientside. > You obviously are referring to multiple connections running COPY on different tables, right? Like what pg_restore does

Re: COPY threads

2018-10-10 Thread Ravi Krishna
> > No, why would that seem to be the case? If it did so, then you could > not run pg_dump to dump data while regular activity was going on. Not sure. In fact I am now confused. I am talking about pg_restore which is COPY FROM, which takes exclusive lock on the table while the data is loaded i

Re: COPY threads

2018-10-10 Thread Ravi Krishna
> > pg_restore doesn't take locks on the table for the COPY, it does so > because creating the table takes an exclusive lock. Interesting. I seem to recollect reading here that I can't have concurrent COPY on the same table because of the lock. To give an example: If I have a large file with

Re: COPY threads

2018-10-10 Thread Ravi Krishna
Thank you. Let me test it and see the benefit. We have a use case for this. > On Oct 10, 2018, at 17:18 , Andres Freund wrote: > > > > On October 10, 2018 2:15:19 PM PDT, Ravi Krishna wrote: >>> >>> pg_restore doesn't take locks on the table for the

Re: COPY threads

2018-10-11 Thread Ravi Krishna
>>> >> Thank you. Let me test it and see the benefit. We have a use case for this. > Well the result is not what I expected. this is the sql I used copy TEST.TABLE1 from '/var/lib/postgresql/data/rkrishna/copytesting/xaa' with delimiter '|' NULL as '' CSV HEADER; From another session copy

Re: COPY threads

2018-10-11 Thread Ravi Krishna
> > Well the result is not what I expected. > > this is the sql I used > > copy TEST.TABLE1 from '/var/lib/postgresql/data/rkrishna/copytesting/xaa' > with delimiter '|' NULL as '' CSV HEADER; > > From another session > > copy TEST.TABLE1 from '/var/lib/postgresql/data/rkrishna/copytesting/xa

Re: Slot issues

2018-10-14 Thread Ravi Krishna
When I read all such posts related to replication I realize how backward is PG's replication architecture specially when compared to DB2. This is how it is done in Db2 to set up replication. 1. take a full backup on the primary. 2. restore the backup on the other machine (aka standby) 3. sta

Re: Slot issues

2018-10-14 Thread Ravi Krishna
The best part in Db2 HADR is that when the standby is catching up with the master after a long time, it will start from the last LSN and fetch it from the primary WAL directory (active logs ). If not found, it will look for it in the archived logs and start applying from there until the current p

Re: Slot issues

2018-10-14 Thread Ravi Krishna
> > You're not forced to use slots. Their purpose is to allow to force the > primary to keep necessary resources around. Which also allows to get rid > of the archive in some setups. Thanks. Disclaimer: We don't use replication as we piggy back on AWS HA. The reason why I posted this is becau

postgres server process crashes when using odbc_fdw

2018-10-16 Thread Ravi Krishna
Version 10.5 AWS Linux Foreign server: Db2 on Linux 10.5.9 carto_odbc unix_odbc I am able to build odbc_fdw extension, register the extension and also create foreign server. I also created foreign table. When I run a sql 'select * from odbctest' postgres crashes, generate a core file. 2018-10

Re: postgres server process crashes when using odbc_fdw

2018-10-16 Thread Ravi Krishna
I enabled ODBC trace . Attached trace log. Had to edit connection details and snipped few repetitive lines as I ran the same sql multiple times Connection Out [DSN=BLUE;UID=*;PWD=***;DATABASE=***;HOST...] [ODBC][4248][1539734369.611042][SQLGetInfo.c][554] Entry:

GIN Index for low cardinality

2018-10-17 Thread Ravi Krishna
In https://www.cybertec-postgresql.com/en/ideas-for-scaling-postgresql-to-multi-terabyte-and-beyond/ it is mentioned: "GIN, the most know non-default index type perhaps, has been actually around for ages (full-text search) and in short is perfect for indexing columns where there are lot of re

Re: postgres server process crashes when using odbc_fdw

2018-10-17 Thread Ravi Krishna
It turned out that enabling ODBC trace was causing PG to crash. Once disabled it started working, but found another issue. All object names in DB2 is assumed to be upper case. odbc_fdw sends queries like this select "fld1","fld2" from "schema_name"."table_name". So the foreign table in PG ha

Re: postgres server process crashes when using odbc_fdw

2018-10-17 Thread Ravi Krishna
> > Please note that odbc_fdw is not maintained by the postgresql developers, but > a separate project. Translation: You are on your own. We are hoping this will make our migration out of DB2 quicker. Oh well.

Re: postgres server process crashes when using odbc_fdw

2018-10-17 Thread Ravi Krishna
> > Come on. We can't realistically support & debug random postgres extending > projects, nor do we have control over them. And you're not necessarily on > your own, you could report the issue to odbcfdw's authors/github tracker. Or > pay a company for support. > On a related note is fdw for

Re: Urgent :: Postgresql streaming replication issue - sync mode

2019-10-02 Thread Ravi Krishna
> > As the failed primary is having more data, How is it possible that primary is > committing transaction before they were applied on standby with > synchronous_commit=remote_apply? If I am not mistaken remote_apply is only from ver 11.

PG 12 not yet for mac

2019-10-07 Thread Ravi Krishna
https://postgresapp.com/downloads.html The link which says PG 12 is actually PG 11.

Re: date function bug

2019-10-23 Thread Ravi Krishna
> ctrlmdb=> select to_date('2018100X','MMDD'); > to_date >2018-10-01 >(1 row) I am able to reproduce this in 11.5 It seems PG can take a single digit for Day too. select to_date('2018109','MMDD') produces 2018-10-09.

Re: date function bug

2019-10-23 Thread Ravi Krishna
> postgres=# select to_date('2018150X','MMDD');   > to_date > 2019-03-03 > postgres=# select to_date('20181501','MMDD'); >  to_date >   > 2019-03-03 is this a cut-n-paste mistake?

Re: date function bug

2019-10-23 Thread Ravi Krishna
> > > > Surprisingly (to me), no…. > > db=# select to_date('20181501','MMDD'); > to_date > > 2019-03-03 The above fails in 11.5 SQL Error [22008]: ERROR: date/time field value out of range: "20181501"

Is this a bug ?

2019-10-23 Thread Ravi Krishna
We noticed this bug in Redshift. It then occurred to me that this may very well be a PG bug since Redshift is based on PG. Reproduced it in Version 11.5 create table bugtest (fld1 char(1)) ; insert into bugtest values('a'); insert into bugtest values('b'); insert into bugtest values('c'); ins

Re: Is this a bug ?

2019-10-23 Thread Ravi Krishna
> > Simplify: > > select 'a' > db-# 'b'; > ?column? > -- > ab > (1 row) > > This is not a bug. > > https://www.postgresql.org/docs/9.2/sql-syntax-lexical.html > > Two string constants that are only separated by whitespace with at > least one newline are concatenated and effectively tre

Re: Is this a bug ?

2019-10-23 Thread Ravi Krishna
So reading responses from all, here is a SQL test I did on few RDBMS: select 'John' 'Doe' as rrr from information_schema.tables limit 1; PG output rrr --- JohnDoe Oracle and mysql gave same output as PG with no error SQLServer: Syntax error near 'as'. DB2 gave same error as SQLServ

Re: Index

2019-10-25 Thread Ravi Krishna
> > I have created indexes with certain set of columns. Now I want to remove one > of the column and add new column. Can this done without dropping the index? > If you intent is to avoid taking that table offline while the index is being built, you can do this: 1. create index concurrently on

Re: explain plan difference

2019-11-04 Thread Ravi Krishna
> On Nov 3, 2019, at 11:03 PM, Steve Baldwin wrote: > > Thanks very much for the explanation Tom !! You are correct - there are > dropped columns in the original. Just to confirm, we are talking about tables from where some cols were deleted in the past, but VACUUM FULL not run on that ta

Re: explain plan difference

2019-11-04 Thread Ravi Krishna
>> Just to confirm, we are talking about tables from where some cols were >> deleted in the past, but >> VACUUM FULL not run on that table, right ? > > VACUUM would not change the state of the dropped columns. > When does it change?

Re: explain plan difference

2019-11-04 Thread Ravi Krishna
> > Never, unless you drop and recreate the table. Removing a dropped > column would change the attnums of following columns, which we > can't support because the tableoid+attnum is the only persistent > identifier of a column. > > (From memory, operations like VACUUM FULL and CLUSTER will rewri

Re: Upgrade PGSQL main version without backup/restore all databases?

2019-11-06 Thread Ravi Krishna
-k option is kept precisely for this.  The upgrades are pretty fast, but still with some downtime. may be 30-45 min tops.

Re: Partitioning large table (140GB)

2019-11-20 Thread Ravi Krishna
>In our production, we use postgres 9.5 with streaming replication >using repmgr, there is a large table of 140GB size which receives >lots of inserts, >Is it possible to partition this table in this version of postgres? >and if so, please, can someone let me know the best way to accomplish >thi

Re: Conditional return of aggregated data

2019-12-02 Thread Ravi Krishna
> My initial idea was something along the lines of : > select (select sum(statcount) from stats_residence) as > aggstat,statcount,short_name_en from stats_residence where > aggstat>some_number; Am I missing something basic. The above can be done using GROUP BY and HAVING clause.

Re: Conditional return of aggregated data

2019-12-02 Thread Ravi Krishna
> > > My initial idea was something along the lines of : > > select (select sum(statcount) from stats_residence) as > > aggstat,statcount,short_name_en from stats_residence where > > aggstat>some_number; > > Am I missing something basic. The above can be done using > GROUP BY and HAVING claus

Re: Partitions child tables and analyze

2020-01-09 Thread Ravi Krishna
> > If rows are added, deleted etc from specific child tables of a partition is > it necessary when performing an analyze to analyze the entire partition or > just the children that experienced the row changes? Under the hood each partition is a separate table, so why is analyzing entire paren

Re: performance of loading CSV data with COPY is 50 times faster than Perl::DBI

2020-02-03 Thread Ravi Krishna
> > Depending on who wrote the code, they may have extracted the rows > as hashrefs rather than arrays; that can be a 10x slowdown right > there. [I have no idea why so many people are so addicted to storing > rows in hashes, but it is always a significant slowdown; and > array slices are no more

Re: Restrict connection from pgadmin.

2020-02-03 Thread Ravi Krishna
> > Not that I know of. pgAdmin is just another client so you just have the > methods available here: > > https://www.postgresql.org/docs/12/auth-pg-hba-conf.html > will the col application_name from pg_stat_activity list pgadmin as pgadmin. if yes, then the closest one can achieve is to have

Re: performance of loading CSV data with COPY is 50 times faster than Perl::DBI

2020-02-03 Thread Ravi Krishna
> > "already suffering from a complex of coding in an unreadable language" > > hearsay and conjecture > I was somewhat facetious. But what finished perl was the reputation it earned that it is a write only language. I don't think that reputation it earned is without merit. IMO the early adop

Re: Need to find the no. of connections for a database

2020-02-27 Thread Ravi Krishna
> > Before taking a few reports, we need to ensure that only one connection is > made to the database and all other computers need to close the connection to > that database. This is to prevent any additional entry(ies) that could be > made during the course of the report taking. This single

Re: Need to find the no. of connections for a database

2020-02-27 Thread Ravi Krishna
"If they enter any data, those data also need to be taken into account in this report. " Pls read on PG's MVCC architecture. In SQLServer, unless you enabled its bad implementation of Snapshot isolation, you can't achieve the same. So it makes sense there. In PG it is easy to ensure that you

Re: Determining the type of an obkect in plperl

2020-03-04 Thread Ravi Krishna
how can I determine what the data type of the value element is? perl has a ref function which can tell what type of object. https://perldoc.perl.org/functions/ref.html -- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

Re: Real application clustering in postgres.

2020-03-06 Thread Ravi Krishna
> > If you have mirrored disks, and you write junk (e.g, because of > a flaw in a fibre channel cable, something I have witnessed), > then you have two perfectly fine copies of the junk. > Few years ago didn't this happen to Salesforce where a firmware bug corrupted the Disk, resulting in corru

How to get RAISE INFO in JDBC

2020-03-20 Thread Ravi Krishna
How do we get the notification mentioned in RAISE INFO of PL/PGSQL in JDBC. I can get it in psql, but not in JDBC. I am talking about redshift which has the same procedural language like postgres. thanks

Re: Postgres cluster setup

2020-03-23 Thread Ravi Krishna
> > Do you have similar setup like Oracle RAC in postgres core . I found in edb > but didn't find anything in postgres core. We are looking for setting up > replication with no outage and other node will be up , if the primary is > down. Any help would be great 😊 Oracle RAC is based on shared

Re: dbeaver

2020-04-01 Thread Ravi Krishna
> - does dbeaver is a good frontend for pg administration? It is an excellent sql client tool and I use it heavily for Redshift, SQLServer, Snowflake and PG. However it is a not dba tool in the sense that it can DBA specific details and graphs as shown in pgadmin.

Re: Abnormal Growth of Index Size - Index Size 3x large than table size.

2020-05-06 Thread Ravi Krishna
> On May 6, 2020, at 5:48 AM, Ram Pratap Maurya > wrote: > > Hi Team, > > We are facing a problem in our PostgreSQL production database related to > abnormal growth of index size. Some of the indexes are having abnormal growth > and index size is larger than table data size. > One table is

Re: Abnormal Growth of Index Size - Index Size 3x large than table size.

2020-05-06 Thread Ravi Krishna
> > Hello Ravi, > > Total number of index is 10 and 65GB is the sum total of index size of all > indexes for table “tstock_movement” > I am attaching the screen shot for your reference. > In that case 65GB is not surprising.

Re: Abnormal Growth of Index Size - Index Size 3x large than table size.

2020-05-06 Thread Ravi Krishna
> On May 6, 2020, at 10:52 AM, Ashish Chugh > wrote: > > Hello Ravi, > > > Total number of indexes are 10 and size is 65 GB. Shall we consider this as a > normal scenario or we need to look into the growth of the indexes as this is > increasing day by day and table data is not increasing

Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction

2020-05-13 Thread Ravi Krishna
the pgm does an INSERT, after this the row is there and can be seen with SELECT; than I CLOSE a non existing cursor, which rolls back the INSERTed data: I have not done coding in ESQL/C in a long time, but shouldn't that be expected as any error should trigger a rollback.

  1   2   3   >