Re: List all tables from a specific database

2022-01-14 Thread Mladen Gogala
There is also INFORMATION_SCHEMA which is SQL standard and extremely easy to use. On Fri, Jan 14, 2022, 1:08 PM Thomas Boussekey wrote: > > > Le ven. 14 janv. 2022 à 12:04, Ray O'Donnell a écrit : > >> On 14/01/2022 10:39, Flaviu2 wrote: >> > I work on a project that use Postgre SQL, and I have

Re: [Extern] Re: postgres event trigger workaround

2022-01-14 Thread Julien Rouhaud
Hi, On Sat, Jan 15, 2022 at 08:36:21AM +0500, Дмитрий Иванов wrote: > In my solution, all users don't need direct access to the schema because > you have to use the functional API to access it. If you can manage users > with functions, you can close the schema in the same way. > Usually the functi

Re: [Extern] Re: postgres event trigger workaround

2022-01-14 Thread Дмитрий Иванов
Hi In my solution, all users don't need direct access to the schema because you have to use the functional API to access it. If you can manage users with functions, you can close the schema in the same way. Usually the function is executed with the permissions of the calling user, which requires pe

Re: Assistance with an out of shared memory error

2022-01-14 Thread Gautam Bellary
Hi Tom, This was very helpful, thanks for the tips. Gautam On Thu, Jan 13, 2022 at 3:36 PM Tom Lane wrote: > Gautam Bellary writes: > > I've got a PL/pgSQL function (regenerate_gateway_last_seen, attached) > that > > loops through all partitions of 2 tables ("Measure" and > "ValuelessMeasure"

Re: WAL Archiving and base backup

2022-01-14 Thread Adrian Klaver
On 1/14/22 13:04, Daniel Westermann (DWE) wrote: On 1/14/22 1:40 PM, Stephen Frost wrote: snip] We shouldn't be trying to provide documentation around how to write a tool like pgbackrest, we should, instead, have a tool like pgbackrest in core with its own documentation, as most other RDBMS's do

Re: WAL Archiving and base backup

2022-01-14 Thread Daniel Westermann (DWE)
>On 1/14/22 1:40 PM, Stephen Frost wrote: >snip] >> We shouldn't be trying to provide >> documentation around how to write a tool like pgbackrest, we should, >> instead, have a tool like pgbackrest in core with its own documentation, >> as most other RDBMS's do. >That's an excellent solution to th

Re: WAL Archiving and base backup

2022-01-14 Thread David G. Johnston
On Fri, Jan 14, 2022 at 1:48 PM Ron wrote: > On 1/14/22 1:40 PM, Stephen Frost wrote: > [snip] > > We shouldn't be trying to provide > > documentation around how to write a tool like pgbackrest, we should, > > instead, have a tool like pgbackrest in core with its own documentation, > > as most ot

Re: WAL Archiving and base backup

2022-01-14 Thread Ron
On 1/14/22 1:40 PM, Stephen Frost wrote: [snip] We shouldn't be trying to provide documentation around how to write a tool like pgbackrest, we should, instead, have a tool like pgbackrest in core with its own documentation, as most other RDBMS's do. That's an excellent solution to this problem.

Re: WAL Archiving and base backup

2022-01-14 Thread Stephen Frost
Greetings, * Ron (ronljohnso...@gmail.com) wrote: > On 1/14/22 12:31 PM, Stephen Frost wrote: > >* Issa Gorissen (issa-goris...@usa.net) wrote: > >>Thx a lot. I thought about it but was not so sure about having a complex > >>script (compared to the very simple version when using the exclusive back

Re: WAL Archiving and base backup

2022-01-14 Thread Ron
On 1/14/22 12:31 PM, Stephen Frost wrote: Greetings, * Issa Gorissen (issa-goris...@usa.net) wrote: Thx a lot. I thought about it but was not so sure about having a complex script (compared to the very simple version when using the exclusive backup - but this this is deprecated...). I will tes

Re: WAL Archiving and base backup

2022-01-14 Thread Stephen Frost
Greetings, * Issa Gorissen (issa-goris...@usa.net) wrote: > Thx a lot. I thought about it but was not so sure about having a complex > script (compared to the very simple version when using the exclusive backup > - but this this is deprecated...). > > I will test your option with the simpler vers

Re: How can a Postgres SQL script be automatically run when a new table turns up?

2022-01-14 Thread Miles Elam
On Thu, Jan 13, 2022 at 4:32 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Thu, Jan 13, 2022 at 8:55 AM Shaozhong SHI > wrote: > >> >> How to create an event trigger in Postgres? When a user finished loading >> a new table on to it, the trigger can start off an script 10 minutes

Upgrade 13 to 14 with replication of partitioned table

2022-01-14 Thread Sergey Belyashov
Hi, I have tried to upgrade my cluster from version 13 to 14 using the command: "pg_upgradecluster -m links --no-start 13 main". But upgrade failed with messages: - pg_restore: creating INDEX "public.closed_sessions_closed_id_idx" pg_restore: while processing header: pg_restore: fro

Re: List all tables from a specific database

2022-01-14 Thread Ray O'Donnell
On 14/01/2022 12:51, Flaviu2 wrote: Yes, I ran *\c mydb1* but I didn't see any SQL script underhood :( Ah, OK. As I understand it, connecting to a database isn't something you can do in SQL: it's a function of the client, and how you do it depends on the client. - So in psql, it's a command

Re: List all tables from a specific database

2022-01-14 Thread Flaviu2
Yes, I ran \c mydb1 but I didn't see any SQL script underhood :( On Friday, January 14, 2022, 02:45:52 PM GMT+2, Ray O'Donnell wrote: On 14/01/2022 12:42, Flaviu2 wrote: > Yes, I started psql with -E, and now I see the SQL underhood. Thank you. > > Now I need to find how to get and ho

Re: List all tables from a specific database

2022-01-14 Thread Ray O'Donnell
On 14/01/2022 12:42, Flaviu2 wrote: Yes, I started psql with -E, and now I see the SQL underhood. Thank you. Now I need to find how to get and how to select a specific database, I have no experience in Postgre SQL. Well, connecting from the command line with psql, you just specify it: psql

Re: List all tables from a specific database

2022-01-14 Thread Flaviu2
Yes, I started psql with -E, and now I see the SQL underhood. Thank you. Now I need to find how to get and how to select a specific database, I have no experience in Postgre SQL.On Friday, January 14, 2022, 01:04:47 PM GMT+2, Ray O'Donnell wrote: On 14/01/2022 10:39, Flaviu2 wrote: > I

Re: List all tables from a specific database

2022-01-14 Thread Julien Rouhaud
Hi, On Fri, Jan 14, 2022 at 12:19:28PM +, Flaviu2 wrote: > Thanks a lot. > Maybe I am not far from a solving solution. So, if I create a database, lets > say (SQL script): > CREATE database mydb3; > How can I create a table under mydb3 ? Because, if I run: > SELECT relname FROM pg_class WHER

Re: List all tables from a specific database

2022-01-14 Thread Flaviu2
Thanks a lot. Maybe I am not far from a solving solution. So, if I create a database, lets say (SQL script): CREATE database mydb3; How can I create a table under mydb3 ? Because, if I run: SELECT relname FROM pg_class WHERE relkind = 'r'; Got me all tables, but I don't know the database under w

Re: List all tables from a specific database

2022-01-14 Thread Thomas Boussekey
Le ven. 14 janv. 2022 à 12:04, Ray O'Donnell a écrit : > On 14/01/2022 10:39, Flaviu2 wrote: > > I work on a project that use Postgre SQL, and I have 0 experience in > > this regard. I hope to get help here. I need two SQL scripts for Postgre: > > > > 1. Get all databases, which I aquired already

Re: List all tables from a specific database

2022-01-14 Thread Ray O'Donnell
On 14/01/2022 10:39, Flaviu2 wrote: I work on a project that use Postgre SQL, and I have 0 experience in this regard. I hope to get help here. I need two SQL scripts for Postgre: 1. Get all databases, which I aquired already: *SELECT datname FROM pg_database WHERE datistemplate = false* This

List all tables from a specific database

2022-01-14 Thread Flaviu2
I work on a project that use Postgre SQL, and I have 0 experience in this regard. I hope to get help here. I need two SQL scripts for Postgre: 1. Get all databases, which I aquired already: SELECT datname FROM pg_database WHERE datistemplate = false This one is functional, it's ok. 2. Now, I need

Re: [Extern] Re: postgres event trigger workaround

2022-01-14 Thread Julien Rouhaud
Hi, On Fri, Jan 14, 2022 at 09:01:12AM +, Zwettler Markus (OIZ) wrote: > > We have the need to separate user (role) management from infrastructure > (database) management. > > Granting CREATEROLE to any role also allows this role to create other roles > having CREATEDB privileges and there

Re: [Extern] Re: postgres event trigger workaround

2022-01-14 Thread Dominique Devienne
On Fri, Jan 14, 2022 at 10:01 AM Zwettler Markus (OIZ) < markus.zwett...@zuerich.ch> wrote: > We have the need to separate user (role) management from infrastructure > (database) management. > Granting CREATEROLE to any role also allows this role to create other > roles having CREATEDB privileges

AW: [Extern] Re: postgres event trigger workaround

2022-01-14 Thread Zwettler Markus (OIZ)
> > Hi, > > On Wed, Jan 12, 2022 at 11:57:45AM +, Zwettler Markus (OIZ) wrote: > > > > PG event triggers are not firing on CREATE ROLE, CREATE DATABASE, > > CREATE TABLESPACE by definition (would be nice if they do). > > > > Is there any workaround to react with ddl_command_start behavior on