Re: Different Autovacuum Settings on Master and Replica in Streaming Replication

2025-01-17 Thread Guillaume Lelarge
27;t activity statistics. They are data statistics, and they are replicated. They're needed by the planner on the primary and on the secondary. > On Fri, Jan 17, 2025 at 4:34 PM Guillaume Lelarge > wrote: > >> Hi, >> >> Le ven. 17 janv. 2025 à 15:38, Franjo Stipanovi

Re: Different Autovacuum Settings on Master and Replica in Streaming Replication

2025-01-17 Thread Guillaume Lelarge
Hi, Le ven. 17 janv. 2025 à 15:38, Franjo Stipanovic a écrit : > Question regarding autovacuum settings in a PostgreSQL streaming > replication setup. Specifically, I am curious about whether it is possible > (and advisable) to have different values for the following settings on the > master and

Re: VACUUM FULL, power failure results in unrecoverable space

2024-12-02 Thread Guillaume Lelarge
Hi, Le mar. 3 déc. 2024, 01:02, Pierre Barre a écrit : > Hello, > > I encountered an issue while attempting to reclaim space from a heavily > bloated table: > > Initial analysis using > https://github.com/ioguix/pgsql-bloat-estimation/blob/master/table/table_bloat.sql > indicated > approximate

Re: pg_dump and not MVCC-safe commands

2024-05-20 Thread Guillaume Lelarge
Hi, Le lun. 20 mai 2024 à 11:27, PetSerAl a écrit : > How pg_dump interact with not MVCC-safe commands? > > As I understand, pg_dump first take snapshot and then lock all tables > it intended to dump. What happens if not MVCC-safe command committed > after snapshot but before lock? From comment

Re: xmax not zero?

2023-10-30 Thread Guillaume Lelarge
Hi, Le lun. 30 oct. 2023 à 13:45, Luca Ferrari a écrit : > Hi all, > I have a table that presents an xmax not zeroed outside of a > transaction block, and it does not look normal to me. > I have no idea about how this happened, it is one of my "toy" > PostgreSQL virtual machines. > But how to di

Re: setting up streaming replication, part 2

2023-10-25 Thread Guillaume Lelarge
Hi, Le mer. 25 oct. 2023 à 02:29, Brad White a écrit : > I have the replication server set up and the streaming is working. > The latest data show up, as desired. > > 3 minor issues. > > 1) I also have the WAL files being copied to a common location from the > primary server with > archive

Re: what is the solution like oracle DB's datafile

2022-12-27 Thread Guillaume Lelarge
Le mar. 27 déc. 2022 à 11:37, Eagna a écrit : > > > wrote: > > > - Oracle was developed earlier, and one can argue that in those days > file systems > > were not so great, so there was more need to write your own > > > Correct me if I'm wrong, but didn't Postgres (or Ingres upon which it's > bas

Re: best practice to patch a postgresql version?

2022-12-26 Thread Guillaume Lelarge
Le mar. 27 déc. 2022 à 06:33, qihua wu a écrit : > Thanks Ron, > > But on a critical production database, we need to cut down the downtime as > much as possible. If just remove a version, and then install a new version, > both of them need a downtime. If we can install several versions on > diffe

Re: pg_restore remap schema

2022-11-16 Thread Guillaume Lelarge
Hi, Le mer. 16 nov. 2022 à 13:08, Fabrice Chapuis a écrit : > Hi, > I worked on the pg_dump source code to add remap schema functionality to > use it internally where I work. This is a first version that allows to > remap tables, views and sequences (only to export schema). Is this > development

Re: "set role" semantics

2022-11-09 Thread Guillaume Lelarge
Hi, Le mer. 9 nov. 2022, 19:55, Bryn Llewellyn a écrit : > adrian.kla...@aklaver.com wrote: > > david.g.johns...@gmail.com wrote: > > b...@yugabyte.com wrote: > > Notice that I didn't grant "connect" on either of the databases, "d1" or > "d2", to any of the roles, "clstr$mgr, "d1$mgr", or "d2$mg

Re: Unable to use pg_verify_checksums

2022-11-04 Thread Guillaume Lelarge
Hi, Le ven. 4 nov. 2022 à 07:12, shashidhar Reddy a écrit : > Hello, > > I am using postgres version 11, in the process of upgrade using pg_upgrade > I am trying to run checksums on version 11 but getting error > > pg_verify_checksums: data checksums are not enabled in cluster > > when trying to

Re: Number of updated rows with LibPQ

2022-10-14 Thread Guillaume Lelarge
Le ven. 14 oct. 2022 à 13:52, Dominique Devienne a écrit : > On Wed, Oct 5, 2022 at 8:17 PM Tom Lane wrote: > > Laurenz Albe writes: > > > On Wed, 2022-10-05 at 16:38 +0200, Dominique Devienne wrote: > > > Yes, you have to use PQcmdTuples(), and you have to convert the string > to an integer. >

Re: recovery.conf and archive files

2022-10-14 Thread Guillaume Lelarge
> max_wal_senders = 10 > wal_keep_segments=10 > synchronous_standby_names='standby0' > wal_log_hints=on > > The archive command stores the WAL in a local directory. That's what I said earlier. > > On Sun, Oct 9, 2022 at 8:45 AM Guillaume Lelarge > wrote: >

Re: Weird planner issue on a standby

2022-10-12 Thread Guillaume Lelarge
Le mer. 12 oct. 2022 à 08:56, Guillaume Lelarge a écrit : > Le mar. 11 oct. 2022 à 19:42, Guillaume Lelarge > a écrit : > >> Le mar. 11 oct. 2022 à 18:27, Alvaro Herrera a >> écrit : >> >>> On 2022-Oct-11, Tom Lane wrote: >>> >>> > Ar

Re: Weird planner issue on a standby

2022-10-11 Thread Guillaume Lelarge
Le mar. 11 oct. 2022 à 19:42, Guillaume Lelarge a écrit : > Le mar. 11 oct. 2022 à 18:27, Alvaro Herrera a > écrit : > >> On 2022-Oct-11, Tom Lane wrote: >> >> > Are there any tables in this query where extremal values of the join >> > key are likely t

Re: Weird planner issue on a standby

2022-10-11 Thread Guillaume Lelarge
Le mer. 12 oct. 2022 à 06:08, Ron a écrit : > On 10/11/22 22:35, Julien Rouhaud wrote: > > On Tue, Oct 11, 2022 at 07:42:55PM +0200, Guillaume Lelarge wrote: > >> Le mar. 11 oct. 2022 à 18:27, Alvaro Herrera > a > >> écrit : > >> > >>> On 2022

Re: Weird planner issue on a standby

2022-10-11 Thread Guillaume Lelarge
Le mar. 11 oct. 2022 à 18:27, Alvaro Herrera a écrit : > On 2022-Oct-11, Tom Lane wrote: > > > Are there any tables in this query where extremal values of the join > > key are likely to be in recently-added or recently-dead rows? Does > > VACUUM'ing on the primary help? > > I remember having an

Weird planner issue on a standby

2022-10-11 Thread Guillaume Lelarge
Hello, My customer has a really weird planner issue on a standby. First, the context. There's a primary, and two standbys, all on a 11.8 release. (I know this isn't the latest release for the v11 branch.) The cluster is 5.5TB. The PostgreSQL configuration is the same on all servers. pg_db_role_se

Re: recovery.conf and archive files

2022-10-09 Thread Guillaume Lelarge
Hi, Le dim. 9 oct. 2022 à 13:54, Rita a écrit : > I have primary and standby replication setup. > > On my primary the archive directory is rather large (30GB) and growing. On > my standby I have recovery.conf which has > archive_cleanup_command = 'pg_archivecleanup -d > /var/lib/pgsql/11/data/ar

Re: Re[2]: CVE-2022-2625

2022-09-15 Thread Guillaume Lelarge
Le jeu. 15 sept. 2022 à 16:52, misha1966 misha1966 a écrit : > Is there a patch for 9.6 ? > A quick Google search for "postgres CVE-2022-2625" gives you https://www.postgresql.org/support/security/CVE-2022-2625/. And this page tells you there's only a fix for releases 10 to 14. Moreover, fixes i

Re: Is it possible to stop sessions killing eachother when they all authorize as the same role?

2022-09-14 Thread Guillaume Lelarge
Le mer. 14 sept. 2022 à 00:35, Bryn Llewellyn a écrit : > > *guilla...@lelarge.info wrote:* > This won't answer your question > > > It has been answered now. See my "case closed" email here: > > > www.postgresql.org/message-id/B33C40D9-2B79-44C7-B527-86E672BEA71A%40yugabyte.com > > …but still… I

Re: Is it possible to stop sessions killing eachother when they all authorize as the same role?

2022-09-13 Thread Guillaume Lelarge
Hi, This won't answer your question but still... I usually really like your scripts, it's nicely written, but this part seems really weird to me: Le mar. 13 sept. 2022 à 20:23, Bryn Llewellyn a écrit : > > > > > > > > > > > > > > > > > > *-- No errordo $body$declare p int not null := 0;begin

Re: pg_restore remap schema

2022-08-08 Thread Guillaume Lelarge
Hi, Le lun. 8 août 2022 à 18:28, Fabrice Chapuis a écrit : > Hello, > I can't find an option with pg_restore to rename an exported schema > schema1 -> schema2 > That's because it doesn't exist :) > Is a development in progress to add this option > > Nope, never heard of someone working on thi

Re: "set autocommit on" in golang client query

2022-08-01 Thread Guillaume Lelarge
Hi, Le lun. 1 août 2022 à 15:10, Rory Campbell-Lange a écrit : > Apologies for the rather naive question. > > I have a psql migration script to call a looping procedure which commits > batches of data along the following lines: > > set search_path = a, b c; > \set AUTOCOMMIT on > --

Re: Unable to archive logs in standby server

2022-07-21 Thread Guillaume Lelarge
Hi, Le jeu. 21 juil. 2022 à 13:58, Meera Nair a écrit : > Hi team, > > > > With non-exclusive backup method, trying backup from standby node. > > But pg_stop_backup function returns “WAL archiving is not enabled…” and > the logs are not archived to WAL directory configured. > > > > Please check

Re: Proposed Translations of Updated Code of Conduct Policy

2022-07-18 Thread Guillaume Lelarge
, the PostgreSQL > Community Code of Conduct Committee has solicited translations of the > updated CoC. > > > > The English version of the Policy is at: > > https://www.postgresql.org/about/policies/coc/ > > The following translations were contributed by: > > > >

Re: More than one Cluster on single server (single instance)

2022-07-18 Thread Guillaume Lelarge
Hi, Le lun. 18 juil. 2022 à 09:55, Daulat a écrit : > > Hello Team, > > We are planning to create multiple clusters on a single server (single > instance) with PostgreSQL V.10 to run multiple applications. > > Planning to create a database cluster on a release 10 sounds already like a bad idea,

Re: pg_dump: VACUUM and REINDEXING

2022-05-07 Thread Guillaume Lelarge
Le sam. 7 mai 2022 à 15:27, Hasan Marzooq a écrit : > Hello! > > Thanks Guillaume and Ron! > > I understand REINDEXING is not required, and as Guillaume highlighted, > vacuum will still be needed after pg_restore. > > Is it ok to perform a "standard" vacuum or do we need a "FULL" > vacuum after p

Re: pg_dump: VACUUM and REINDEXING

2022-05-07 Thread Guillaume Lelarge
Le sam. 7 mai 2022 à 10:21, Ron a écrit : > On 5/6/22 21:35, Hasan Marzooq wrote: > > Hello! > > I've some questions around Backup & Restore. > > 1: Is it necessary to perform a VACUUM and REINDEXING operation after > restoring the dump from Postgres 9.6 to Postgres 13? The dump size could be > 1

Re: pg_dump: VACUUM and REINDEXING

2022-05-07 Thread Guillaume Lelarge
Hi, Le sam. 7 mai 2022 à 04:36, Hasan Marzooq a écrit : > Hello! > > I've some questions around Backup & Restore. > > 1: Is it necessary to perform a VACUUM and REINDEXING operation after > restoring the dump from Postgres 9.6 to Postgres 13? The dump size could be > 1/2 TB to 1 TB. > > You can

Re: PostgreSQL : bug (ou not) in CTE Common Table Expressions or Subqueries in the FROM Clause

2022-03-22 Thread Guillaume Lelarge
Hi, Le mar. 22 mars 2022 à 10:46, PALAYRET Jacques a écrit : > Hello, > > # Let's consider a table defined as follows : > CREATE TABLE weather_stations( > id integer, > name varchar(30), > elev integer > ) ; > > # After loading, the content : > id| name | elev > -

Re: Robust ways for checking allowed values in a column

2022-01-25 Thread Guillaume Lelarge
Le mar. 25 janv. 2022 à 14:56, Shaozhong SHI a écrit : > I tried the following: > > select form from mytable where form ~ > '^Canal$|^Drain$|^Foreshore$|^inlandRiver$|^Lake$|^lockOrFlightOfLocks$|^Marsh$|^Researvoir$|^Sea$|^tidalRiver$|^Transfer$' > > I used ^ and $ to ensure checking of allowe

Re: Using a different column name in a foreign table

2022-01-21 Thread Guillaume Lelarge
Hi, Le ven. 21 janv. 2022 à 17:24, Alanoly Andrews a écrit : > Hello, > > I see that the syntax for the creation of a foreign table allows you to > use a column name in the FT that is different from the one in the base > table. Such a "create foreign table" statement executes successfully and >

Re: csv copy error

2021-12-29 Thread Guillaume Lelarge
Hi, Le mer. 29 déc. 2021 à 22:08, ourdiaspora a écrit : > Readers, > > Please could anyone help with the following error produced: > > " > ERROR: invalid input syntax for integer: "1,m " > CONTEXT: COPY exampletable, line 1, column examplenumber: "1,m " > > The database commands: > > " > CREAT

Re: Why does the OID jump by 3 when creating tables?

2021-10-30 Thread Guillaume Lelarge
Hi, Le sam. 30 oct. 2021 à 10:55, Daniel Westermann (DWE) < daniel.westerm...@dbi-services.com> a écrit : > Hi all, > > as I could not find the reason in the source code, can someone tell me why > the OID counter jumps by 3 between two create table statements? > > postgres=# create table t1 ( a i

Re: streaming replication different versions

2021-10-06 Thread Guillaume Lelarge
Le mer. 6 oct. 2021 à 13:46, Thomas Kellerer a écrit : > Marc Millas schrieb am 06.10.2021 um 13:43: > > on release 10, I remember reading something like: streaming replication > is NOW upward compatible. > > which could be understood as: its possible to have a master in rel 10 > and a slave in

Re: psql's default database on connect (our internal ref. SRP-30861)

2021-08-06 Thread Guillaume Lelarge
Le ven. 6 août 2021 à 09:51, Matthias Apitz a écrit : > El día viernes, agosto 06, 2021 a las 09:34:42a. m. +0200, Guillaume > Lelarge escribió: > > > > No, it does not match all my examples. Read again what it says as > > > default on --help. > > > > >

Re: psql's default database on connect (our internal ref. SRP-30861)

2021-08-06 Thread Guillaume Lelarge
Le ven. 6 août 2021 à 09:25, Matthias Apitz a écrit : > El día viernes, agosto 06, 2021 a las 09:07:56a. m. +0200, Guillaume > Lelarge escribió: > > > Le ven. 6 août 2021 à 08:53, Matthias Apitz a écrit : > > > > > > > > Hello, > &

Re: psql's default database on connect (our internal ref. SRP-30861)

2021-08-06 Thread Guillaume Lelarge
Le ven. 6 août 2021 à 08:53, Matthias Apitz a écrit : > > Hello, > > testpos@srap53dxr1:~> psql --help > ... > -d, --dbname=DBNAME database name to connect to (default: "testpos") > > testpos@srap53dxr1:~> whoami > testpos > > testpos@srap53dxr1:~> env | grep PG > PGPASSWORD= > P

Re: pg_dumpall with individual output files per database?

2021-07-23 Thread Guillaume Lelarge
Le ven. 23 juil. 2021 à 12:06, Luca Ferrari a écrit : > On Thu, Jul 15, 2021 at 7:27 PM Francisco Olarte > wrote: > > It would probably complicate it, and dumping a whole cluster using > > something like pg_dumpall -g for the globals plus a loop over the > > databases using something like pg_dum

Re: pg 13 fatal error message mentionning "standby_mode"

2021-06-08 Thread Guillaume Lelarge
Le mar. 8 juin 2021 à 13:15, Guillaume Lelarge a écrit : > Hi, > > Le mar. 8 juin 2021 à 12:11, Phil Florent a > écrit : > >> Hi, >> >> I had forgotten to include a restore_command and my standby database did >> not start (expected behavior) but the

Re: pg 13 fatal error message mentionning "standby_mode"

2021-06-08 Thread Guillaume Lelarge
Hi, Le mar. 8 juin 2021 à 12:11, Phil Florent a écrit : > Hi, > > I had forgotten to include a restore_command and my standby database did > not start (expected behavior) but the error message puzzled me : > > select version(); > > version >

Re: DB size

2021-04-26 Thread Guillaume Lelarge
Hi, Le lun. 26 avr. 2021 à 22:59, a écrit : > > - Mensagem original - > > De: "Alvaro Herrera" > > Para: "luis.roberto" > > Cc: "pgsql-general" > > Enviadas: Segunda-feira, 26 de abril de 2021 17:45:34 > > Assunto: Re: DB size > > > I would guess that there are leftover files because

Re: Question about contrib

2021-04-19 Thread Guillaume Lelarge
Le lun. 19 avr. 2021 à 10:43, Condor a écrit : > On 19-04-2021 11:39, Guillaume Lelarge wrote: > > Hi, > > > > Le lun. 19 avr. 2021 à 09:43, Condor a écrit : > > > >> Hello, > >> > >> I have a question about contrib directory. I know the

Re: Question about contrib

2021-04-19 Thread Guillaume Lelarge
Hi, Le lun. 19 avr. 2021 à 09:43, Condor a écrit : > > Hello, > > I have a question about contrib directory. I know the projects there is > not official supported by PostgreSQL development team Contrib modules (as in the contrib subdirectory) are officially supported. -- Guillaume.

Re: Upgrading from 11 to 13

2021-03-30 Thread Guillaume Lelarge
Hi, Le mar. 30 mars 2021 à 16:10, Susan Joseph a écrit : > I am currently using PostgreSQL 11.2 and would like to try and upgrade it > to the latest version 13. Can I go straight from 11 to 13 or do I need to > upgrade to 12 first and then to 13? > You can go straight to 13. Regards.

Re: ERROR: could not start WAL streaming: ERROR: replication slot "XXX" does not exist

2021-03-28 Thread Guillaume Lelarge
Le dim. 28 mars 2021 à 11:53, FOUTE K. Jaurès a écrit : > Curiously the slot is not dropped. > > You didn't say the name of the replication slot. Does it have upper case? That's probably the biggest issue with naming objects with PostgreSQL. Le sam. 27 mars 2021 à 20:31, Atul Kumar a écrit : >

Re: How to recover data from 9.3 data directory

2021-03-13 Thread Guillaume Lelarge
Le sam. 13 mars 2021 à 15:18, Andrus a écrit : > Should I create virtual machine and install Linux with 9.3 into it or is >> there simpler solution? >> > that's the only option, unless you already have some compatible server > around. > > I have new Debian virtual machine with Postgres 12 . > >

Re: count(*) vs count(id)

2021-02-01 Thread Guillaume Lelarge
Le mar. 2 févr. 2021 à 02:14, Matt Zagrabelny a écrit : > > > On Mon, Feb 1, 2021 at 6:35 PM Tom Lane wrote: > >> Matt Zagrabelny writes: >> > On Mon, Feb 1, 2021 at 5:57 PM Rob Sargent >> wrote: >> >> You got one null from count(*) likely. >> >> > What is count(*) counting then? I thought it

Re: CLUSTER, VACUUM, and TABLESPACEs (oh my)

2021-01-24 Thread Guillaume Lelarge
Le lun. 25 janv. 2021 à 03:27, Demitri Muna a écrit : > > > On Jan 24, 2021, at 9:03 PM, Guillaume Lelarge > wrote: > > > >> VACUUM FULL unclusters the table?? > > > > It will rebuild the table without sorting the data according to the > index used

Re: CLUSTER, VACUUM, and TABLESPACEs (oh my)

2021-01-24 Thread Guillaume Lelarge
Le lun. 25 janv. 2021 à 02:54, Ron a écrit : > On 1/24/21 7:50 PM, Guillaume Lelarge wrote: > > Hi, > > Le lun. 25 janv. 2021 à 01:38, Demitri Muna a > écrit : > > [snip] > > >> * If I have previously run a CLUSTER command on a table, will future >> VAC

Re: CLUSTER, VACUUM, and TABLESPACEs (oh my)

2021-01-24 Thread Guillaume Lelarge
Hi, Le lun. 25 janv. 2021 à 01:38, Demitri Muna a écrit : > Hi, > > I would like to request a little clarification on the CLUSTER and VACUUM > commands. My use case here (partially) is when my disk runs out of space > and I want to move a table to a newly created tablespace. These questions > so

Re: Deleting takes days, should I add some index?

2020-11-27 Thread Guillaume Lelarge
Le ven. 27 nov. 2020 à 16:05, Alvaro Herrera a écrit : > On 2020-Nov-27, Alexander Farber wrote: > > > Referenced by: > > TABLE "words_chat" CONSTRAINT "words_chat_gid_fkey" FOREIGN KEY (gid) > > REFERENCES words_games(gid) ON DELETE CASCADE > > TABLE "words_moves" CONSTRAINT "words_moves

Re: Cluster and Vacuum Full

2020-10-05 Thread Guillaume Lelarge
Le lun. 5 oct. 2020 à 12:22, PegoraroF10 a écrit : > I have tables which are Master Detail and usually my program loads all > detail > records of a master record. So I configured CLUSTER on all those detail > tables to use an index which is the relation with master table. With that I > can load l

Re: Need explanation on index size

2020-09-24 Thread Guillaume Lelarge
Hi, Le jeu. 24 sept. 2020 à 15:55, Guillaume Luchet a écrit : > Hi, > > I’m facing of a comportement I don’t understand on indexes, here a quick > example to reproduce my problem > > > test=# select version(); > version > > > -

Re: Error in Table Creation

2020-06-25 Thread Guillaume Lelarge
Le jeu. 25 juin 2020 à 10:59, Rajnish Vishwakarma < rajnish.nationfi...@gmail.com> a écrit : > I am creating dynamically table in PostgreSQL using psycopg2 by passing > the below 2 strings as column names: > > > 'BAF7_X_X_During_soaking-__Temperature__difference_coil_to_coil_with_metal_temp_TC_loa

Re: Lock Postgres account after X number of failed logins?

2020-05-06 Thread Guillaume Lelarge
Le mer. 6 mai 2020 à 04:18, Christian Ramseyer a écrit : > > > On 05.05.20 16:13, Wolff, Ken L wrote: > > Hi, everyone. Wondering if there’s a way in PostgreSQL to automatically > > lock accounts after a number of failed logins (a security requirement > > for my organization). > > > > Locking ac

Re: avoid WAL for refresh of materialized view

2020-03-24 Thread Guillaume Lelarge
Le mar. 24 mars 2020 à 17:00, Remund Alain a écrit : > Hi all > > > > We have PostgreSql 9.6 running and started to work with materialized > views. To refresh the materialized views, we set up a cron job that > refreshes the materialized views on a fix schedule. > > Since our materialized views c

Re: How can I set all constraints to be deferrable for a DB/schema

2020-03-18 Thread Guillaume Lelarge
Hi, Le mer. 18 mars 2020 à 04:14, David Gauthier a écrit : > Hi: > > psql (9.6.7, server 11.3) (linux) > > Is there a way to set all constraints on all tables of a DB and/or schema > to be deferrable ? Or do I have to do them one-by-one ? > > You have to do them one by one. Or write a DO script

Re: POLL: Adding transaction status to default psql prompt

2020-02-05 Thread Guillaume Lelarge
Le jeu. 6 févr. 2020 à 03:55, Vik Fearing a écrit : > Hello, > > I proposed a patch to add %x to PROMPT1 and PROMPT2 by default in psql. > > The effect of this is: > > - nothing at all when not in a transaction, > Too bad it doesn't add a space, so that we still have the same space used byt the

Re: How to reset a server error '25P02 in_failed_sql_transaction'

2019-12-31 Thread Guillaume Lelarge
Le mar. 31 déc. 2019 à 06:55, Matthias Apitz a écrit : > > Hello, > > Due to a wrong human input in the GUI of our application our > application server, from the point of view of the PostgreSQL server it > is the PostgreSQL client, issues a broken ESQL/C command to the PostgreSQL > server, here f

Re: Finding out about the dates of table modification

2019-11-22 Thread Guillaume Lelarge
Le sam. 23 nov. 2019 03:24, Martin Mueller a écrit : > I've moved happily from MySQL to Postgres but miss one really good > feature of MYSQL: the table of tables that let you use SQL queries to find > out metadata about your table. Thus looking at the table of tables and > sorting it by last cha

Re: A question about user atributes

2019-11-22 Thread Guillaume Lelarge
First, please reply to the list, not me specifically. Le ven. 22 nov. 2019 à 14:51, stan a écrit : > On Fri, Nov 22, 2019 at 01:58:11PM +0100, Guillaume Lelarge wrote: > > Hi, > > > > Le ven. 22 nov. 2019 ?? 13:51, stan a ??crit : > > > > > I am trting to

Re: A question about user atributes

2019-11-22 Thread Guillaume Lelarge
Hi, Le ven. 22 nov. 2019 à 13:51, stan a écrit : > I am trting to do something, and it ias not working as I think it should. > > Consider: > > onnected to a database called stan as stan > > /dt reports > > List of relations > Schema | Name | Type | Owner > +

Re: Execute a function through fdw

2019-10-18 Thread Guillaume Lelarge
Le ven. 18 oct. 2019 à 17:53, Patrick FICHE a écrit : > Hi, > > I got one more issue after I created my view. > > I created it on my Server 1 but I am unable to view it on the Server 2. > I can see all tables through fdw after IMPORT FOREIGN SCHEMA. > > I was able to get access to my view only af

Re: Execute a function through fdw

2019-10-18 Thread Guillaume Lelarge
Le ven. 18 oct. 2019 à 11:51, Patrick FICHE a écrit : > Hello, > > > > Is it possible to execute a function located on a server accessed through > Postgres fdw. > > This function returns a TABLE structure. > > > > I have mapped rmt_schema and there is a function called Get_Tables in this > schema

Re: logging "raise" to file

2019-07-28 Thread Guillaume Lelarge
Hi, Le dim. 28 juil. 2019 à 12:32, a écrit : > Hi, > > is there a way to log output from "raise ..." to a local file? \o file > does not work (for me). > No, RAISE messages can only go to log files. You would need to call a function that could write to a file (though without calling RAISE). -

Re: One way replication in PostgreSQL

2019-06-04 Thread Guillaume Lelarge
Le mar. 4 juin 2019 à 09:03, PALAYRET Jacques a écrit : > Hello, > > Thanks a lot for the suggested solutions. > > So, I can use WAL-shipping replication from Primary to the Secundary > server, but it's only for full replication. > > Yes. Let's call " P " the provider/primary/master and " S " t

Re: Weird behaviour of ROLLUP/GROUPING

2019-01-17 Thread Guillaume Lelarge
Le jeu. 17 janv. 2019 à 08:27, Andrew Gierth a écrit : > >>>>> "Guillaume" == Guillaume Lelarge writes: > > >> I will see about fixing this, somehow. > > Guillaume> Thanks a lot. > > I've committed a fix (to all supported branches,

Re: Weird behaviour of ROLLUP/GROUPING

2019-01-16 Thread Guillaume Lelarge
Le mer. 16 janv. 2019 à 17:40, Andrew Gierth a écrit : > >>>>> "Andrew" == Andrew Gierth writes: > >>>>> "Guillaume" == Guillaume Lelarge writes: > > Guillaume> CASE grouping(to_char(b, 'MM')) > > Guillaume&

Weird behaviour of ROLLUP/GROUPING

2019-01-16 Thread Guillaume Lelarge
Hi, One of my customers found something quite weird on his 9.6 cluster. Here is a quick demo showing the issue: -- quick demo table CREATE TABLE t1 (a integer, b timestamp, c integer); -- a working query SELECT CASE grouping(a) WHEN 1 THEN 'some text' ELSE a::text END AS new_a, CASE WHEN gro

Re: Installing pg_buffercache (was Re: shared_buffers on Big RAM systems)

2018-12-13 Thread Guillaume Lelarge
Le ven. 14 déc. 2018 à 07:00, Ron a écrit : > On 12/13/2018 08:25 PM, Rene Romero Benavides wrote: > > This topic seems to be always open to discussion. In my opinion, it > > depends on how big your work dataset is, there's no use in sizing > > shared_buffers beyond that size. I think, the most r

Re: Postgres 8.3 Grant all on database or schema

2018-11-07 Thread Guillaume Lelarge
Hi, Le mer. 7 nov. 2018 à 09:59, Saikumar a écrit : > Dear Sir, > > > > I am quite new the Postgre DB and working as DBA. > > > > I wanted to set the grant all permissions on the database to the role. > > > > Whatever the user assign to this role should inherits the same permissions > on the dat

Re: Question about index on different tablespace and rebuild it

2018-11-06 Thread Guillaume Lelarge
Le mar. 6 nov. 2018 20:49, Condor a écrit : > On 05-11-2018 10:56, Condor wrote: > > Hello, > > > > I have a database that use index on different table space (nvme). I > > read documentation about table space and understand table space cannot > > be treated as an autonomous collection of data fil

Re: Weird behaviour of the planner

2018-08-01 Thread Guillaume Lelarge
2018-08-01 16:59 GMT+02:00 David Rowley : > On 2 August 2018 at 02:48, Guillaume Lelarge > wrote: > > EXPLAIN (ANALYZE) SELECT DISTINCT * FROM gleu2; > > > >

Weird behaviour of the planner

2018-08-01 Thread Guillaume Lelarge
Hi, While working on a slow query of one of our customers, I found this behaviour which seems quite weird to me. Here it is: (no changes on any parameter) EXPLAIN (ANALYZE) SELECT DISTINCT * FROM gleu2; QUERY PLAN ---

Re: PG backup check

2018-07-17 Thread Guillaume Lelarge
2018-07-17 2:35 GMT+02:00 Ravi Krishna : > Not sure I am following this. Did Google release this because PG backups > are not 100% reliable or the data corruption can occur due to hardware > failure. > > http://www.eweek.com/cloud/google-releases-open-source- > tool-that-checks-postgres-backup-in

Re: Disable TRUST authentication by using ClientAuthentication_hook

2018-07-13 Thread Guillaume Lelarge
2018-07-13 15:19 GMT+02:00 Fabrízio de Royes Mello : > > 2018-07-13 9:01 GMT-03:00 Guillaume Lelarge : > >> 2018-07-13 13:57 GMT+02:00 : >> >>> I’d like to disable the TRUST authentication method for certain servers >>> where modification of pg_hba.conf

Re: Disable TRUST authentication by using ClientAuthentication_hook

2018-07-13 Thread Guillaume Lelarge
2018-07-13 13:57 GMT+02:00 : > I’d like to disable the TRUST authentication method for certain servers > where modification of pg_hba.conf and restarting a service is fairly easy > for a number of users. > > > > I looked at this example https://wiki.postgresql.org/images/e/e3/Hooks_in_ > postgresq

Re: Using always genereted

2018-07-13 Thread Guillaume Lelarge
Hi, 2018-07-13 9:29 GMT+02:00 Łukasz Jarych : > hi, > > i am trying to alter table : > > ALTER TABLE logging.t_history > alter column "id" GENERATED ALWAYS AS IDENTITY PRIMARY KEY, > > but this is not working. Error i have. > > How to change this properly? > > Which error message do you get? -

Re: How to watch for schema changes

2018-07-12 Thread Guillaume Lelarge
2018-07-12 6:12 GMT+02:00 Adrian Klaver : > On 07/11/2018 08:46 PM, Igor Korot wrote: > >> Hi, guys, >> >> >> On Mon, Jul 9, 2018 at 5:38 PM, Adrian Klaver >> wrote: >> >>> On 07/09/2018 01:49 PM, Igor Korot wrote: >>> Hi, Adrian On Tue, Jul 3, 2018 at 1:24 PM, Adrian Klaver <

Re: Create event triger

2018-07-10 Thread Guillaume Lelarge
2018-07-10 11:28 GMT+02:00 Łukasz Jarych : > Thank you very much Guillaume. > > Do you know maybe any function to do it automatically? > > Nope, but it should be easy to write a shell script or a DO script to do it. Best, > Jacek > > wt., 10 lip 2018 o 11:25 Guilla

Re: Create event triger

2018-07-10 Thread Guillaume Lelarge
2018-07-10 10:56 GMT+02:00 Łukasz Jarych : > No possible? > > Nope, you need to set up the trigger on each table. Jacek > > pon., 9 lip 2018 o 13:03 Łukasz Jarych napisał(a): > >> Hi, >> >> i have small database and i am tracking changes using trigger: >> >> CREATE TRIGGER t BEFORE INSERT OR UPD

Re: hardcode password in connect string

2018-04-15 Thread Guillaume Lelarge
2018-04-15 17:16 GMT+02:00 Raymond O'Donnell : > On 15/04/18 12:35, Ricardo Martin Gomez wrote: > >> Hello David, >> I think so, the parameter you need in psql command is -w mipassword. >> > > Sorry, this is not correct. -w causes psql *never* to prompt for a > password, and -W forces a password p

Re: Update blocking another update

2018-01-15 Thread Guillaume Lelarge
2018-01-12 8:25 GMT+01:00 Sachin Kotwal : > Hi All, > > As update operation is "ROW Exclusive" It should not block another update > operation. > > As long as two processes don't try to update the same row. In below case we are updating all values for in one column. > > It is blocking another upda