Re: [GENERAL] Delete from table conditionally

2016-12-16 Thread Charles Clavadetscher
Hello > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Arup Rakshit > Sent: Samstag, 17. Dezember 2016 08:39 > To: Pgsql-general > Subject: [GENERAL] Delete from table conditionally >

[GENERAL] Delete from table conditionally

2016-12-16 Thread Arup Rakshit
Hi, I am using Postgresql 9.5. Below is the sample data taken from the mail table with only required columns: id | question_id | answer_id | content +-+---+-- 2 | 25 | 270 | Arup 3 | 26 | 276 | Kajal 4 | 26 | 276 |

[GENERAL] Re: [GENERAL] Love Your Database project — Thoughts on effectively handling constraints?

2016-12-16 Thread Guyren Howe
On Dec 16, 2016, at 16:52 , Tom Lane wrote: > >> So I’ve started a project to fix this. I’m initially going to write a series >> of blog posts demonstrating in principle how a developer can put much/all of >> their model logic in their database. > > Cool. This sounds well

Re: [GENERAL] Love Your Database project — Thoughts on effectively handling constraints?

2016-12-16 Thread Tom Lane
Guyren Howe writes: > I believe a lot of application programmers, particularly but by no means > limited to web application developers, have a tragic prejudice against > treating their database as anything but a dumb data bucket. > They also often lack awareness of even

[GENERAL] Love Your Database project — Thoughts on effectively handling constraints?

2016-12-16 Thread Guyren Howe
I believe a lot of application programmers, particularly but by no means limited to web application developers, have a tragic prejudice against treating their database as anything but a dumb data bucket. They also often lack awareness of even simple-to-use SQL/Postgres features that would make

Re: [GENERAL] tuple data size and compression

2016-12-16 Thread Tom DalPozzo
> Two questions: > > 1) Do you know what your data in the future is going to be? > > 2) Is a 100 byte bytea a realistic approximation of that data? > > wal_compression=off. >> >> -- > Adrian Klaver > adrian.kla...@aklaver.com Hi, 1) not precisely, but 10/100 million insertions per day. I can't

Re: [GENERAL] Allow login on slave only

2016-12-16 Thread Tom Lane
"Andomar" writes: > We run a master server and a hot standby server. Reporting users login to > the standby server to run long queries. However, their login is also valid > on the master server. Is it possible to prevent a user from logging in to > the master server? You could

Re: [GENERAL] Allow login on slave only

2016-12-16 Thread Sherrylyn Branchaw
> > We run a master server and a hot standby server. Reporting users login to > the standby server to run long queries. However, their login is also valid > on the master server. Is it possible to prevent a user from logging in to > the master server? > What I do is use roles as groups, and

Re: [GENERAL] Allow login on slave only

2016-12-16 Thread David G. Johnston
On Fri, Dec 16, 2016 at 9:17 AM, Andomar wrote: > We run a master server and a hot standby server. Reporting users login to > the standby server to run long queries. However, their login is also valid > on the master server. Is it possible to prevent a user from logging in to >

[GENERAL] Allow login on slave only

2016-12-16 Thread Andomar
We run a master server and a hot standby server. Reporting users login to the standby server to run long queries. However, their login is also valid on the master server. Is it possible to prevent a user from logging in to the master server? A statement like: alter role

Re: [GENERAL] pgbench initialize

2016-12-16 Thread Vladimir Rusinov
Depends on goals of your benchmarking. What are you trying to achieve? Initialization and vacuuming each time will help achieve more consistent best-case numbers (to reduce variance, I'd also destroy cluster completely and clean up hardware, e.g. run fstrim in case of SSD, etc). If you are

Re: [GENERAL] tuple data size and compression

2016-12-16 Thread Adrian Klaver
On 12/16/2016 12:23 AM, Tom DalPozzo wrote: I see. But in my case rows don't reach that thresold (I didn't check if 2K but I didn't change anything). So I'm wondering if there is any other chance except the TOAST to get the rows compressed or not.

[GENERAL] Postgres runs under other user/group, update crashs installation

2016-12-16 Thread pillul
  Hey Folks, we use postgres from the actual RHEL 7 repo.I installed it some weeks ago and changed the user/group under which the service runs via systemd:userdel postgresgroupdel postgreschown newuser.newgroup /var/run/postgresql -Rchown newuser.newgroup /var/lib/pgsql -R systemctl edit

Re: [GENERAL] Recursive row level security policy

2016-12-16 Thread Joe Conway
On 12/16/2016 01:02 AM, Simon Charette wrote: > Unfortunately this will only return accounts matching the current_user's name. > > I would expect "SET ROLE foo; SELECT name FROM accounts" to return "foo" and > "bar" and not only "foo" like your proposed solution would do. Perhaps:

Re: [GENERAL] pg_repack and Postgres versions > 9.4

2016-12-16 Thread Kenneth Marshall
On Fri, Dec 16, 2016 at 09:15:51AM -0500, Bill Moran wrote: > > Does anyone have experience using pg_repack on Postgres versions > 9.4? > Specifically 9.5, but probably 9.6 at some point. > > The documentation claims it supports up to 9.4. I haven't looked at it > closely enough to guess whether

[GENERAL] pg_repack and Postgres versions > 9.4

2016-12-16 Thread Bill Moran
Does anyone have experience using pg_repack on Postgres versions > 9.4? Specifically 9.5, but probably 9.6 at some point. The documentation claims it supports up to 9.4. I haven't looked at it closely enough to guess whether there might be changes in 9.5/9.6 to cause it not to work any more.

Re: [GENERAL] PostgreSQL mirroring from RPM install to Source install

2016-12-16 Thread Vincent Veyron
[re-post, originally sent with wrong username] On Thu, 15 Dec 2016 16:42:13 + (GMT) Richard Brosnahan wrote: > > I get a checksum error, from pg_ctl. > 2016-12-15 08:27:14.520 PST >FATAL: incorrect checksum in control file > Hi Richard, Not sure if it applies, but just in

[GENERAL] Checking data checksums...

2016-12-16 Thread marin
Hi, I enabled data checksums (initdb --data-checksums) on a new instance and was wandering is there a command in the psql console, or from the linux console, to force a checksum check on the entire cluster and get error reports if it finds some corrupted pages. Regards, Mladen Marinović

Re: [GENERAL] tuple data size and compression

2016-12-16 Thread Tom DalPozzo
> > I see. But in my case rows don't reach that thresold (I didn't check if >> 2K but I didn't change anything). So I'm wondering if there is any other >> chance except the TOAST to get the rows compressed or not. >> > > Are you really sure you want that? For small files the overhead of >