Re: Keeping state in a foreign data wrapper

2020-08-11 Thread Laurenz Albe
On Mon, 2020-08-03 at 19:23 +0300, Stelios Sfakianakis wrote: > I am trying to implement a FDW in Postgres for accessing a web api and I > would > like to keep information like for example the total number of requests > submiited. > Ideally these data should be kept “per-user” and of course wi

Implement a new data type

2020-08-11 Thread mohand oubelkacem makhoukhene
Hello; I whould like to implement a new data type next to char, number, varchar... A Money type. So i'll have to change the source code, but i don't know which fonctions i need to change and which part to work on. I need some help to implement this new data type. Thank you and best regards Mohand

Re: Implement a new data type

2020-08-11 Thread Laurenz Albe
On Tue, 2020-08-11 at 11:31 +, mohand oubelkacem makhoukhene wrote: > I whould like to implement a new data type next to char, number, varchar... A > Money type. > So i'll have to change the source code, but i don't know which fonctions i > need to change and which part to work on. You don'

Re: Implement a new data type

2020-08-11 Thread Pavel Stehule
Hi út 11. 8. 2020 v 13:31 odesílatel mohand oubelkacem makhoukhene < mohand-oubelka...@outlook.com> napsal: > Hello; > I whould like to implement a new data type next to char, number, > varchar... A Money type. > So i'll have to change the source code, but i don't know which fonctions i > need to

Re: Implement a new data type

2020-08-11 Thread Adrian Klaver
On 8/11/20 4:31 AM, mohand oubelkacem makhoukhene wrote: Hello; I whould like to implement a new data type next to char, number, varchar... A Money type. One that is different from the current one?: https://www.postgresql.org/docs/12/datatype-money.html So i'll have to change the source code

Re: Implement a new data type

2020-08-11 Thread Miles Elam
Also of note: PostgreSQL already has a money type ( https://www.postgresql.org/docs/current/datatype-money.html) But you shouldn't use it ( https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don.27t_use_money). I only bring it up so that you can know to make your money type a slightly different name

How is PG replication typically used to create a High Availability (HA) config ?

2020-08-11 Thread David Gauthier
Hi: Our IT dept has created what they call a High Availability DB for our PG DB (9.6.7 on linux). If the primary fails, they promise to promote the backup to be the new primary but leave it at that. But from the perspective of the app, I'm left with 1) detecting an SQL error is a DB connecti

Re: How is PG replication typically used to create a High Availability (HA) config ?

2020-08-11 Thread Paul Förster
Hi David, > On 11. Aug, 2020, at 17:12, David Gauthier wrote: > > Hi: > > Our IT dept has created what they call a High Availability DB for our PG DB > (9.6.7 on linux). If the primary fails, they promise to promote the backup > to be the new primary but leave it at that. But from the persp

Sizing PostgreSQL VM server sizing

2020-08-11 Thread Samarendra Sahoo
Dear all, We are getting ready to install in production and would like to know what are key considerations and how do we use them to provision VMs for the same? Thanks a lot!

Re: Certficates

2020-08-11 Thread Shankar Bhaskaran
Hi All , Thank you for all the replies , I think even if psql does not verify the certificate , it still has to import it. I guess like David mentioned it might have default certificates in the client and server. Regards, Shankar On Tue, Aug 11, 2020 at 1:45 AM Tom Lane wrote: > "David G. John

Re: serial + db key, or guid?

2020-08-11 Thread Mark Phillips
Thank you for the reply. The article is a good one. I posed the question on the chance things had evolved since 2012, specifically as it relates to postgres. > On Aug 10, 2020, at 3:21 PM, Christophe Pettus wrote: > > > >> On Aug 10, 2020, at 15:19, Mark Phillips wrote: >> Advice, cautionar

Re: serial + db key, or guid?

2020-08-11 Thread Christophe Pettus
> On Aug 11, 2020, at 09:37, Mark Phillips wrote: > > I posed the question on the chance things had evolved since 2012, > specifically as it relates to postgres. The essentials haven't changed. Keys (such as UUIDs, especially UUID v4) that have most of their randomness in the most signific

Re: serial + db key, or guid?

2020-08-11 Thread Christopher Browne
On Tue, 11 Aug 2020 at 12:40, Christophe Pettus wrote: > > On Aug 11, 2020, at 09:37, Mark Phillips > wrote: > > > > I posed the question on the chance things had evolved since 2012, > specifically as it relates to postgres. > > The essentials haven't changed. Keys (such as UUIDs, especially UU

Re: serial + db key, or guid?

2020-08-11 Thread Adam Brusselback
I mentioned this in another email thread yesterday about a similar topic, but I'd highly suggest if you do go the UUID route, do not use the standard UUID generation functions, they all suck for database use (v1 also sucks). I use: https://pgxn.org/dist/sequential_uuids/ written by Thomas Vondara

Re: How is PG replication typically used to create a High Availability (HA) config ?

2020-08-11 Thread David Gauthier
Thanks for the response Paul :-) Our code is actually perl which uses DBI which has functions to ping a DB on a specific server and connect to it. But my question was more along the lines of whether or not the onus to do this sort of thing typically lies with the app or something outside which is

Re: How is PG replication typically used to create a High Availability (HA) config ?

2020-08-11 Thread Rob Sargent
On 8/11/20 2:57 PM, David Gauthier wrote: Thanks for the response Paul :-) Our code is actually perl which uses DBI which has functions to ping a DB on a specific server and connect to it. But my question was more along the lines  of whether or not the onus to do this sort of thing typicall

Re: Implement a new data type

2020-08-11 Thread raf
On Tue, Aug 11, 2020 at 06:38:39AM -0700, Miles Elam wrote: > Also of note: PostgreSQL already has a money type ( > https://www.postgresql.org/docs/current/datatype-money.html) > But you shouldn't use it ( > https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don.27t_use_money). > > I only bring i

pglogical 2.3.2 on 9.4 --> 12.3 CONFLICT: remote DELETE (tuple not found). Resolution: skip.

2020-08-11 Thread milist ujang
Configured pglogical source is 9.4 target is 12.3 a table has PK from multiple column (varchar(50),char(2),char(1)). initial syncronization is OK, but when at source there is delete , but got error at target... LOG: CONFLICT: remote DELETE on relation public.a_ replica identity index a_XXX_

Re: Sizing PostgreSQL VM server sizing

2020-08-11 Thread Amul Sul
https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server might help. Regards, Amul On Tue, Aug 11, 2020 at 9:49 PM Samarendra Sahoo wrote: > > Dear all, > We are getting ready to install in production and would like to know what are > key considerations and how do we use them to provisi

Re: Sizing PostgreSQL VM server sizing

2020-08-11 Thread Samarendra Sahoo
Thanks Amul. This helps a lot. I am also looking for infra sizing so that we can request our infra team to provision. On Wed, Aug 12, 2020 at 9:45 AM Amul Sul wrote: > https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server > might help. > > Regards, > Amul > > > > On Tue, Aug 11, 2020 at

Re: Implement a new data type

2020-08-11 Thread Chris Travers
On Wed, Aug 12, 2020 at 2:01 AM raf wrote: > On Tue, Aug 11, 2020 at 06:38:39AM -0700, Miles Elam < > miles.e...@productops.com> wrote: > > > Also of note: PostgreSQL already has a money type ( > > https://www.postgresql.org/docs/current/datatype-money.html) > > But you shouldn't use it ( > > htt