Re: Unexpected block ID found when reading data

2021-08-02 Thread Gilar Ginanjar
Hi, Adrian Thanks in advance. pdgump command: pg_dump -U myuser -Fc -Z3 -d mydb > dbdump.backup I'm not sure which pg_dump version did i use before, but I used psql 12.5 to dump and the db version is postgresql 9.6. pgrestore command: pg_restore -U myuser -j8 -d mydb dbdump.backup I’ve tried

Re: Unexpected block ID found when reading data

2021-08-02 Thread Gilar Ginanjar
Hi, Adrian Thanks in advance. pdgump command: pg_dump -U myuser -Fc -Z3 -d mydb > dbdump.backup I'm not sure which pg_dump version did i use before, but I used psql 12.5 to dump and the db version is postgresql 9.6. pgrestore command: pg_restore -U myuser -j8 -d mydb dbdump.backup I’ve tried

Re: Unexpected block ID found when reading data

2021-08-02 Thread Adrian Klaver
On 8/2/21 6:42 PM, Gilar Ginanjar wrote: Hi, I have a db dump (.backup) that i want to restore. But it comes up with error: "found unexpected block ID when reading data" Is there any chance i can save my backup? The problem is I don't have the database anymore. I used psql 12.5 when dumping

Unexpected block ID found when reading data

2021-08-02 Thread Gilar Ginanjar
Hi, I have a db dump (.backup) that i want to restore. But it comes up with error: "found unexpected block ID when reading data" Is there any chance i can save my backup? The problem is I don't have the database anymore. I used psql 12.5 when dumping the database approx a year ago.

Re: Lazy View's Column Computing

2021-08-02 Thread Tom Lane
Mladen Gogala writes: > The query from the view would probably merge view  with the original and > optimize everything as a single query. Unfortunately, there is no way to > tell: > mgogala=# explain select ename,job,sal from acct_view; > QUERY PLAN >

Re: Lazy View's Column Computing

2021-08-02 Thread Mladen Gogala
For all that we know, it may already be happening. That looks like a pretty reasonable optimization which may already be in place. If we create a view: mgogala=# select * from dept;  deptno |   dname    |   loc ++-- 10 | ACCOUNTING | NEW YORK 20 | RESEARCH 

Re: pgcrypto - real life examples to encrypt / decrypt

2021-08-02 Thread Adrian Klaver
On 8/2/21 2:14 PM, Vikas Sharma wrote: Dear Experts, Could you please share some real life examples of using pgcrypto in production? I am planning to use it in our environment and wondering what could be the best practice for its use. I would start by doing a search on 'using pgcrypto',

Re: single-row deadlock

2021-08-02 Thread guntiso
After upgrading from PostgreSQL 9.6 to 13 we started to experience locking issues once per week or two. This turned out to be a performance problem and reused pid-s. No deadlock.

pgcrypto - real life examples to encrypt / decrypt

2021-08-02 Thread Vikas Sharma
Dear Experts, Could you please share some real life examples of using pgcrypto in production? I am planning to use it in our environment and wondering what could be the best practice for its use. Thank you. Regards Vikas S

Re: Postgres 9.6 to 12.7 pg_upgrade error - terminating connection due to administrator command

2021-08-02 Thread David G. Johnston
On Mon, Aug 2, 2021 at 12:20 PM Dhanush D wrote: > It doesn't show up twice based on these checks (Is there any other way I > can check if the seq is showing up twice?). > > SELECT * FROM pg_class WHERE relkind = 'S' AND relname ~ 'permission'; I made the "relname" a bit broad, you should see

Re: Postgres 9.6 to 12.7 pg_upgrade error - terminating connection due to administrator command

2021-08-02 Thread David G. Johnston
On Mon, Aug 2, 2021 at 11:42 AM Dhanush D wrote: > Multiple "Create sequence" and "Drop sequence". However the drop sequence > doesn't seem to drop the sequence cleanly hence failing the restore process. > It shouldn't be dropping at all - it assumes it is starting from an empty slate. Same

Re: ERROR: ImportError: No module named 'psutil'

2021-08-02 Thread Ganesh Korde
Ok, thanks guys. Let me check that. On Sun, Aug 1, 2021 at 10:05 PM Tom Lane wrote: > Adrian Klaver writes: > > In that vein the OP could run: > > > DO $$ > > import sys > > plpy.notice(sys.version) > > $$ LANGUAGE plpython3u; > > > in the database to see what plpython3u is actually

Re: Lazy View's Column Computing

2021-08-02 Thread Vijaykumar Jain
On Mon, 2 Aug 2021 at 19:53, Tom Lane wrote: > Avi Weinberg writes: > > Is there a way to compute a column in a view only if it is referenced in > the query? I have a view's column that its value is computed by a > function. If in the query that column is not used at all, can Postgres >

Re: Lazy View's Column Computing

2021-08-02 Thread Tom Lane
Avi Weinberg writes: > Is there a way to compute a column in a view only if it is referenced in the > query? I have a view's column that its value is computed by a function. If > in the query that column is not used at all, can Postgres "skip" computing it? If the function is not volatile,

Lazy View's Column Computing

2021-08-02 Thread Avi Weinberg
Hi, Is there a way to compute a column in a view only if it is referenced in the query? I have a view's column that its value is computed by a function. If in the query that column is not used at all, can Postgres "skip" computing it? Thanks! IMPORTANT - This email and any attachments is

Re: Automatic backup in windows

2021-08-02 Thread David G. Johnston
On Sunday, August 1, 2021, obi reddy wrote: > Hello everyone, I want to schedule the automatic backup in windows > postgresql platform. > > I have attached the script, if any changes is required please correct and > send back. This is my humble request. > Actually I don't know to write the

Automatic backup in windows

2021-08-02 Thread obi reddy
Hello everyone, I want to schedule the automatic backup in windows postgresql platform. I have attached the script, if any changes is required please correct and send back. This is my humble request. Actually I don't know to write the windows script. Otherwise if incase any have the script