Re: [GENERAL] error on CREATE INDEX when restoring from dump file: could not read block 0

2015-09-27 Thread Jim Nasby
On 9/27/15 5:32 PM, Tom Lane wrote: I would be more excited about fixing this if the cases that had come up didn't involve index definitions that were broken on their face. In this example the index entries would depend on entries in not just one but *three* tables, for none of which could the

Re: [GENERAL] error on CREATE INDEX when restoring from dump file: could not read block 0

2015-09-27 Thread Tom Lane
Jim Nasby writes: >> I can create the index in psql with : >> CREATE INDEX tbldossier_id_contrat_idx ON tbldossier USING btree >> (dossier_contrat(id_dossier)); >> but subsequent dumps/restores will always fail on it (only in 9.4, it works >> fine in 9.1). >> What should I be looking for to find

Re: [GENERAL] error on CREATE INDEX when restoring from dump file: could not read block 0

2015-09-27 Thread Adrian Klaver
On 09/27/2015 10:16 AM, Vincent Veyron wrote: Hi, I'm getting the following error when restoring my database from a dump file in postgresql 9.4 -- psql:tmp/mydb.out:159861: ERREUR: n'a pas pu lire le bloc 0 du fichier « base/28903/29447 » : a lu seulement 0 octets sur 8192 CONTEX

Re: [GENERAL] Server-side hooks for user session start and session end

2015-09-27 Thread Nikolai Zhubr
Hi, 27.09.2015 23:22, Pavel Stehule wrote: [...] updated patch - fixed error reporting Wow! I'll definitely borrow it :) Thank you, Nikolai Regards Pavel -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org ) To make c

Re: [GENERAL] Server-side hooks for user session start and session end

2015-09-27 Thread Pavel Stehule
2015-09-27 22:51 GMT+02:00 Nikolai Zhubr : > Hi, > 27.09.2015 22:59, Pavel Stehule: > >> >> 2015-09-27 21:40 GMT+02:00 Jim Nasby > >: >> >> _PG_fini >> >> >> It should not work - see a doc >> > > I'd rather consider registering with on_shmem_exit -- as per the

Re: [GENERAL] Server-side hooks for user session start and session end

2015-09-27 Thread Pavel Stehule
Hi I stored this extension to github https://github.com/okbob/session_exec Regards Pavel

Re: [GENERAL] Server-side hooks for user session start and session end

2015-09-27 Thread Nikolai Zhubr
Hi, 27.09.2015 22:59, Pavel Stehule: 2015-09-27 21:40 GMT+02:00 Jim Nasby mailto:jim.na...@bluetreble.com>>: _PG_fini It should not work - see a doc I'd rather consider registering with on_shmem_exit -- as per the insightfull note placed in postgresql.c:4290. (Haven't tried - just thi

Re: [GENERAL] Server-side hooks for user session start and session end

2015-09-27 Thread Pavel Stehule
2015-09-27 13:33 GMT+02:00 Nikolai Zhubr : > Hi, > 27.09.2015 8:29, Pavel Stehule: > >> I'll check it. >> >> >> It is working. Patch attached >> > > Oh, brilliant! This is a _huge_ help actually! > > If I understand it correctly, any unhandled SQL-level exceptions will > essentially be ignored

Re: [GENERAL] Server-side hooks for user session start and session end

2015-09-27 Thread Pavel Stehule
2015-09-27 21:40 GMT+02:00 Jim Nasby : > _PG_fini It should not work - see a doc If the file includes a function named _PG_fini, that function will be called immediately before unloading the file. Likewise, the function receives no parameters and should return void. Note that _PG_fini will only

Re: [GENERAL] Server-side hooks for user session start and session end

2015-09-27 Thread Jim Nasby
On 9/26/15 7:12 PM, Nikolai Zhubr wrote: 26.09.2015 20:59, Tom Lane wrote: [...] A session-end hook seems pretty problematic to me: you simply cannot guarantee that it will run at all. (Consider process crash or server abort cases.) So anything built on the assumption that it gets to run at se

Re: [GENERAL] error on CREATE INDEX when restoring from dump file: could not read block 0

2015-09-27 Thread Jim Nasby
On 9/27/15 12:16 PM, Vincent Veyron wrote: In English : ERROR: could not read block 0 from file « base/28903/29447 » : 0 bytes read out of 8192 What relation is that? (SELECT oid::regclass FROM pg_class WHERE relfilenode=29447 in the appropriate database) "dossier_contrat" is a simple sql

[GENERAL] error on CREATE INDEX when restoring from dump file: could not read block 0

2015-09-27 Thread Vincent Veyron
Hi, I'm getting the following error when restoring my database from a dump file in postgresql 9.4 -- psql:tmp/mydb.out:159861: ERREUR: n'a pas pu lire le bloc 0 du fichier « base/28903/29447 » : a lu seulement 0 octets sur 8192 CONTEXTE : fonction SQL « dossier_contrat » lors du la

Re: [GENERAL] Server-side hooks for user session start and session end

2015-09-27 Thread Pavel Stehule
2015-09-27 13:33 GMT+02:00 Nikolai Zhubr : > Hi, > 27.09.2015 8:29, Pavel Stehule: > >> I'll check it. >> >> >> It is working. Patch attached >> > > Oh, brilliant! This is a _huge_ help actually! > > If I understand it correctly, any unhandled SQL-level exceptions will > essentially be ignored

Re: [GENERAL] Server-side hooks for user session start and session end

2015-09-27 Thread Nikolai Zhubr
Hi, 27.09.2015 8:29, Pavel Stehule: I'll check it. It is working. Patch attached Oh, brilliant! This is a _huge_ help actually! If I understand it correctly, any unhandled SQL-level exceptions will essentially be ignored there, so that the session will continue regardless? And maybe i