Re: Dynamic procedure execution

2020-12-13 Thread Muthukumar.GK
Hi David, As I am not bit Clea, let me know what I have to do. If possible, please re- write my program. Regards Muthu On Mon, Dec 14, 2020, 11:43 AM David G. Johnston wrote: > On Sunday, December 13, 2020, Muthukumar.GK wrote: > >> >> v_query := ' OPEN C1 FOR SELECT * FROM

Re: Dynamic procedure execution

2020-12-13 Thread David G. Johnston
On Sunday, December 13, 2020, Muthukumar.GK wrote: > > v_query := ' OPEN C1 FOR SELECT * FROM public."Bankdetails"'; > > > > EXECUTE (v_query); > > > You put the pl/pgsql OPEN command into a string and sent it to the SQL engine via EXECUTE and the SQL engine is complaining that it has no idea

Dynamic procedure execution

2020-12-13 Thread Muthukumar.GK
Hi team, When I am trying to implement belwo dynamic concept in postgreSql, getting some error. Kindly find the below attached program and error. Please advise me what is wrong here.. CREATE OR REPLACE PROCEDURE DynamicProc() AS $$ DECLARE v_query TEXT; C1 refcursor := 'result1'; begin

Re: Potential BRIN Index Corruption

2020-12-13 Thread Huan Ruan
Hi Tomas The records have a timestamp column so we do know the time they were written. We didn't find any I/O issues that match that time but unfortunately as it's been a while we are not confident with that finding. > Are there any other corrupted indexes on the table? That was one of my

Re: Is there a way to dump schema to files on disk and keep them in sync

2020-12-13 Thread Benedict Holland
I mean, you want to dump a schema into a directory. Alembic, sqlalchemy and pathlib will do that in a few minutes. If you want to sync changes then write alembic change scripts and reflect those changes in the ORM, alembic does that. Modifying the ORM and reflecting those changes is a terrible

Re: Is there a way to dump schema to files on disk and keep them in sync

2020-12-13 Thread Adrian Klaver
On 12/13/20 1:04 PM, Tim Uckun wrote: pgAdmin does not create directories, it just organizes the contents of the system catalogs into GUI elements. I realize that :). I meant organized in the same way but on disk. Nothing that I know of. You could do a pg_dump -d some_db -s/--schema-only

Re: Is there a way to dump schema to files on disk and keep them in sync

2020-12-13 Thread Tim Uckun
>pgAdmin does not create directories, it just organizes the contents of the system catalogs into GUI elements. I realize that :). I meant organized in the same way but on disk.

Re: Is there a way to dump schema to files on disk and keep them in sync

2020-12-13 Thread Tim Uckun
My primary use case for this is for development and experimentation, I have no intent on using it on production servers :) I normally use migrations for those. On Sun, Dec 13, 2020 at 9:04 PM Ron wrote: > > On 12/12/20 8:58 PM, Tim Uckun wrote: > > I want to dump my postgres schema to disk in

Re: pg_restore fails when psql succeeds

2020-12-13 Thread Cherio
The exact command is nothing fancy really. The complete exact command is below export PGPASSWORD=xxx pg_restore --verbose --no-password --clean --if-exists -h 111.111.111.111 -p 5432 -U user -d blankdbfromstandardtemplate0 /PATH/EXPORTEDDIR 2>&1 | tee logfile I was able to import

Re: Is there a way to dump schema to files on disk and keep them in sync

2020-12-13 Thread Adrian Klaver
On 12/13/20 10:03 AM, Benedict Holland wrote: You want Alembic and an afternoon of python writing. You just described an ORM. In other words out of the frying pan and into the fire. On Sun, Dec 13, 2020, 12:53 PM Tomas Vondra mailto:tomas.von...@enterprisedb.com>> wrote: On 12/13/20

Re: Is there a way to dump schema to files on disk and keep them in sync

2020-12-13 Thread Benedict Holland
You want Alembic and an afternoon of python writing. You just described an ORM. On Sun, Dec 13, 2020, 12:53 PM Tomas Vondra wrote: > On 12/13/20 6:34 PM, Adrian Klaver wrote: > > On 12/12/20 6:58 PM, Tim Uckun wrote: > >> I want to dump my postgres schema to disk in neat directories like > >>

Re: pg_restore fails when psql succeeds

2020-12-13 Thread Adrian Klaver
On 12/12/20 12:39 PM, Cherio wrote: I install PostgreSQL from "apt.postgresql.org " repository: $ /usr/lib/postgresql/13/bin/postgres --version postgres (PostgreSQL) 13.1 (Ubuntu 13.1-1.pgdg20.04+1) It runs in a VM, the most recent & updated version of Ubuntu LTS

Re: Is there a way to dump schema to files on disk and keep them in sync

2020-12-13 Thread Tomas Vondra
On 12/13/20 6:34 PM, Adrian Klaver wrote: > On 12/12/20 6:58 PM, Tim Uckun wrote: >> I want to dump my postgres schema to disk in neat directories like >> pgadmin presents. Then I want to be able to edit the files and sync >> changes to the database and ideally if changes were made in the >>

Re: Is there a way to dump schema to files on disk and keep them in sync

2020-12-13 Thread Adrian Klaver
On 12/12/20 6:58 PM, Tim Uckun wrote: I want to dump my postgres schema to disk in neat directories like pgadmin presents. Then I want to be able to edit the files and sync changes to the database and ideally if changes were made in the database to sync them back to the disk. Is there a tool

Re: Is there a way to dump schema to files on disk and keep them in sync

2020-12-13 Thread Ron
On 12/12/20 8:58 PM, Tim Uckun wrote: I want to dump my postgres schema to disk in neat directories like pgadmin presents. Then I want to be able to edit the files and sync changes to the database and ideally if changes were made in the database to sync them back to the disk. That could get