Re: Shared buffers increased but cache hit ratio is still 85%

2018-07-19 Thread Adrien NAYRAT
On 07/18/2018 10:26 AM, Hans Schou wrote: Am I doing something wrong or should some history be cleared? Hi, FIY, check_pgactivity save the diff between each call to compute the real hit ratio : https://github.com/OPMDG/check_pgactivity Regards,

Incorrect description of the WITH CHECK in the row security can lead to the security issue

2018-07-19 Thread Олег Самойлов
Hi all. This is a documentation issue, I already sent to pgsql-docs, but there is not reply. https://www.postgresql.org/message-id/152637961531.27212.188002690528452...@wrigleys.postgresql.org I'll try here. PostgreSQL 10 (in 11 the same https://www.postgresql.org/docs/10/static/ddl-rowsecurit

functions with side effect

2018-07-19 Thread Torsten Förtsch
Hi, assuming SELECT nextval('s'), currval('s'); or SELECT * FROM (VALUES (nextval('s'), currval('s'))) t; is there any guarantee that the 2 output values are the same? Thanks, Torsten

Re: functions with side effect

2018-07-19 Thread Laurenz Albe
Torsten Förtsch wrote: > assuming > > SELECT nextval('s'), currval('s'); > > or > > SELECT * FROM (VALUES (nextval('s'), currval('s'))) t; > > is there any guarantee that the 2 output values are the same? You can use at EXPLAIN (VERBOSE) output to see if it will work in this special case, but

Re: cache lookup failed for attribute 1 of relation XXXXXX

2018-07-19 Thread Tom Lane
Alessandro Aste writes: > pg_dump: [archiver (db)] query failed: ERROR: cache lookup failed for > attribute 1 of relation 2223152859 > pg_dump: [archiver (db)] query was: SELECT t.tableoid, t.oid, t.relname > AS indexname, pg_catalog.pg_get_indexdef(i.indexrelid) AS indexdef, > t.relnatts AS

Re: cache lookup failed for attribute 1 of relation XXXXXX

2018-07-19 Thread Tom Lane
[ please keep the list cc'd for the archives' sake ] Alessandro Aste writes: > Hello Tom, thanks for your reply: > SELECT * FROM pg_class WHERE OID = 2223152859 ; > (0 rows) > I'm not aware of any DDL at that time. Hm. Well, that OID was definitely there when pg_dump looked, and it's not ther

Re: cache lookup failed for attribute 1 of relation XXXXXX

2018-07-19 Thread Alessandro Aste
Thanks much, I'll keep my eyes open today night hoping it will not happen again. On Thu, Jul 19, 2018 at 5:39 PM, Tom Lane wrote: > [ please keep the list cc'd for the archives' sake ] > > Alessandro Aste writes: > > Hello Tom, thanks for your reply: > > SELECT * FROM pg_class WHERE OID = 222

Re: functions with side effect

2018-07-19 Thread Adrian Klaver
On 07/19/2018 07:15 AM, Torsten Förtsch wrote: Hi, assuming SELECT nextval('s'), currval('s'); or SELECT * FROM (VALUES (nextval('s'), currval('s'))) t; is there any guarantee that the 2 output values are the same? Assuming you are only working in single session: https://www.postgresql.or

Re: functions with side effect

2018-07-19 Thread Torsten Förtsch
On Thu, Jul 19, 2018 at 6:35 PM Adrian Klaver wrote: > On 07/19/2018 07:15 AM, Torsten Förtsch wrote: > > Hi, > > > > assuming > > > > SELECT nextval('s'), currval('s'); > > > > or > > > > SELECT * FROM (VALUES (nextval('s'), currval('s'))) t; > > > > is there any guarantee that the 2 output valu

Re: User documentation vs Official Docs

2018-07-19 Thread Peter J. Holzer
On 2018-07-18 08:09:35 +1000, Tim Cross wrote: > If using web widgets to author content on the wiki is the main > impediment for contributing content, maybe we should see if the wiki > provides alternative access methods. I've used wikis in the past which > allowed users to upload content via xmlrp

Re: functions with side effect

2018-07-19 Thread Adrian Klaver
On 07/19/2018 09:43 AM, Torsten Förtsch wrote: On Thu, Jul 19, 2018 at 6:35 PM Adrian Klaver > wrote: On 07/19/2018 07:15 AM, Torsten Förtsch wrote: > Hi, > > assuming > > SELECT nextval('s'), currval('s'); > > or >

Re: functions with side effect

2018-07-19 Thread Pavel Luzanov
Very interesting question. postgres=# create sequence s; CREATE SEQUENCE postgres=# select currval('s'), nextval('s'); ERROR:  currval of sequence "s" is not yet defined in this session postgres=# select nextval('s'), currval('s');  nextval | currval -+-    1 |   1 We see

Re: functions with side effect

2018-07-19 Thread Adrian Klaver
On 07/19/2018 09:43 AM, Torsten Förtsch wrote: On Thu, Jul 19, 2018 at 6:35 PM Adrian Klaver > wrote: On 07/19/2018 07:15 AM, Torsten Förtsch wrote: > Hi, > > assuming > > SELECT nextval('s'), currval('s'); > > or >

Re: User documentation vs Official Docs

2018-07-19 Thread Rob Sargent
On 07/19/2018 11:04 AM, Peter J. Holzer wrote: On 2018-07-18 08:09:35 +1000, Tim Cross wrote: If using web widgets to author content on the wiki is the main impediment for contributing content, maybe we should see if the wiki provides alternative access methods. I've used wikis in the past wh

Re: User documentation vs Official Docs

2018-07-19 Thread Peter J. Holzer
On 2018-07-19 11:43:18 -0600, Rob Sargent wrote: > On 07/19/2018 11:04 AM, Peter J. Holzer wrote: > > On 2018-07-18 08:09:35 +1000, Tim Cross wrote: > > > If using web widgets to author content on the wiki is the main > > > impediment for contributing content, maybe we should see if the wiki > > >

Re: functions with side effect

2018-07-19 Thread Tom Lane
=?UTF-8?Q?Torsten_F=C3=B6rtsch?= writes: > I know that. My question was about the execution order of f1 and f2 in > "SELECT f1(), f2()". In theory they can be executed in any order. But since > the side effect in nextval determines the result of currval, I am asking if > that order is well-defined

Re: User documentation vs Official Docs

2018-07-19 Thread Melvin Davidson
>> Politely tell them to buy some of the many well written books that are available on these very topics... >Fair enough but what about those that cant afford it? I think us in the Western World tend to forget that by >far the majority of users cant afford a latte from Starbucks let alone a 60.00 U

Re: functions with side effect

2018-07-19 Thread Torsten Förtsch
On Thu, Jul 19, 2018 at 8:10 PM Tom Lane wrote: > =?UTF-8?Q?Torsten_F=C3=B6rtsch?= writes: > > I know that. My question was about the execution order of f1 and f2 in > > "SELECT f1(), f2()". In theory they can be executed in any order. But > since > > the side effect in nextval determines the re

[no subject]

2018-07-19 Thread Torsten Förtsch
Hi, is there a way to find if a certain page in a data file is referenced by a btree index? I found a few completely empty pages in one of my tables. I am not sure if that's corruption or just bloat. Now I am thinking I could use an index, the PK for instance, and see if it references these pages

Re:

2018-07-19 Thread Peter Geoghegan
On Thu, Jul 19, 2018 at 11:43 AM, Torsten Förtsch wrote: > is there a way to find if a certain page in a data file is referenced by a > btree index? > > I found a few completely empty pages in one of my tables. I am not sure if > that's corruption or just bloat. Now I am thinking I could use an in

Re: User documentation vs Official Docs

2018-07-19 Thread Tim Cross
Peter J. Holzer writes: > On 2018-07-18 08:09:35 +1000, Tim Cross wrote: >> If using web widgets to author content on the wiki is the main >> impediment for contributing content, maybe we should see if the wiki >> provides alternative access methods. I've used wikis in the past which >> allowed

Re: User documentation vs Official Docs

2018-07-19 Thread Ken Tanzer
On Thu, Jul 19, 2018 at 11:35 AM Melvin Davidson wrote: > >> Politely tell them to buy some of the many well written books that are > available on these very topics... > >Fair enough but what about those that cant afford it? I think us in the > Western World tend to forget that by >far the majori

Re: User documentation vs Official Docs

2018-07-19 Thread Melvin Davidson
On Thu, Jul 19, 2018 at 8:09 PM, Ken Tanzer wrote: > On Thu, Jul 19, 2018 at 11:35 AM Melvin Davidson > wrote: > >> >> Politely tell them to buy some of the many well written books that are >> available on these very topics... >> >Fair enough but what about those that cant afford it? I think us

Re: User documentation vs Official Docs

2018-07-19 Thread Adrian Klaver
On 07/19/2018 05:43 PM, Melvin Davidson wrote: > Then again people might use shared, university or library computers Would you please be so kind as to inform us which university or library allows users to install software on a _shared_ computer. Pretty sure Ken was referring to looking

Re: User documentation vs Official Docs

2018-07-19 Thread Adrian Klaver
On 07/19/2018 05:54 PM, Adrian Klaver wrote: On 07/19/2018 05:43 PM, Melvin Davidson wrote:  > Then again people might use shared, university or library computers Would you please be so kind as to inform us which university or library allows users to install software on a _shared_ comput

Re: User documentation vs Official Docs

2018-07-19 Thread Melvin Davidson
On Thu, Jul 19, 2018 at 8:54 PM, Adrian Klaver wrote: > On 07/19/2018 05:43 PM, Melvin Davidson wrote: > >> >> >> > >> >> > Then again people might use shared, university or library computers >> Would you please be so kind as to inform us which university or library >> allows users to install so

Re: User documentation vs Official Docs

2018-07-19 Thread Ken Tanzer
On Thu, Jul 19, 2018 at 5:43 PM Melvin Davidson wrote: > > > Then again people might use shared, university or library computers > Would you please be so kind as to inform us which university or library > allows users to install software on a _shared_ computer. > > Well, just sticking to a quick

Re: User documentation vs Official Docs

2018-07-19 Thread Rob Sargent
On 07/19/2018 06:58 PM, Adrian Klaver wrote: On 07/19/2018 05:54 PM, Adrian Klaver wrote: On 07/19/2018 05:43 PM, Melvin Davidson wrote:  > Then again people might use shared, university or library computers Would you please be so kind as to inform us which university or library allo

Re: User documentation vs Official Docs

2018-07-19 Thread Tim Cross
Our University provides access to a Linux server for any student (not just those in data science etc) or staff member and that computer has Postgres available for anyone who want to use it. The server is also accessible remotely (80% of our student base is remote/on-line). You also get a shell acc