Re: Storing a time interval

2019-11-08 Thread Pankaj Jangid
Steve Baldwin writes: > I agree with Michael. Another consideration is how the composite type is > going to be handled in the DB layer of your processing code (e.g. node, > python, ...). In the scenario you described it seems unlikely you will be > either having multiple columns of that type on y

Merge sort/postgis performance tweaking?

2019-11-08 Thread Israel Brewster
I have the following query: SELECT read_date, to_char(read_date,'-MM-DD') as text_date, CASE WHEN lat_2>lat_1 THEN ns_dist*-1 ELSE ns_dist END as ns_dist, CASE WHEN lon_2>lon_1 THEN ew_dist*-1

Re: Storing a time interval

2019-11-08 Thread Steve Baldwin
I agree with Michael. Another consideration is how the composite type is going to be handled in the DB layer of your processing code (e.g. node, python, ...). In the scenario you described it seems unlikely you will be either having multiple columns of that type on your PO table, or using that com

Re: Storing a time interval

2019-11-08 Thread Michael Lewis
> CREATE TYPE po_dates AS ( > po_isssued_datetimestamptz, > discount_last_date timestamptz, > net_date timestamptz > ); > What advantage does combining these three values into a custom composite type give you rather than just storing directly?

Re: firewall trouble on Windows

2019-11-08 Thread Adrian Klaver
On 11/8/19 12:41 PM, Boylan, Ross wrote: I have a physical machine H (host) running a virtual machine V. Both are Win 10 64 bit; vmware provides the virtualization. Symantec EndPoint Protection (SEP) on H is blocking attempts to connect to my postgres 12 server running on V. I am trying to g

firewall trouble on Windows

2019-11-08 Thread Boylan, Ross
I have a physical machine H (host) running a virtual machine V. Both are Win 10 64 bit; vmware provides the virtualization. Symantec EndPoint Protection (SEP) on H is blocking attempts to connect to my postgres 12 server running on V. I am trying to get it to permit the necessary traffic. I'

Re: Storing a time interval

2019-11-08 Thread stan
On Fri, Nov 08, 2019 at 12:12:59PM -0800, Adrian Klaver wrote: > On 11/8/19 11:57 AM, Michael Lewis wrote: > > You certainly could choose to store as??tstzrange, but why not use two > > fields? > > > > https://www.postgresql.org/docs/current/rangetypes.html > > I would lean more to a composite ty

Re: Storing a time interval

2019-11-08 Thread Adrian Klaver
On 11/8/19 11:57 AM, Michael Lewis wrote: You certainly could choose to store as tstzrange, but why not use two fields? https://www.postgresql.org/docs/current/rangetypes.html I would lean more to a composite type: https://www.postgresql.org/docs/11/rowtypes.html Range types are built aroun

Re: Storing a time interval

2019-11-08 Thread Michael Lewis
You certainly could choose to store as tstzrange, but why not use two fields? https://www.postgresql.org/docs/current/rangetypes.html

pg_logical for RHEL 8

2019-11-08 Thread Olivier Gautherot
Hi folks, We are installing a server with RHEL 8, installing PG 11 was a child's play but pg_logical is apparently not available. We followed the instructions in https://dl.2ndquadrant.com/default/release/site/ but yum does not find the packages. Following this documentation, I eventually found

Storing a time interval

2019-11-08 Thread stan
I need to create a table to store terms and conditions for purchase orders. Some of the attributes of a PO include payment terms. Quite often these will be 2 periods associated with these, the first is a period on which if you pay, you receive a discount, and the 2nd is when payment is due with no

Re: AW: AW: AW: AW: AW: AW: AW: broken backup trail in case of quickly patroni switchback and forth

2019-11-08 Thread Brad Nicholson
"Zwettler Markus (OIZ)" wrote on 2019/11/08 11:54:14 AM: > > (please don't top post, makes the replies hard to follow) > > > patronictl switchover > > > follow the prompts > > > there is also a /switchover API endpoint you can use. > > > Brad > > I wondered about your "patronictl switchover + sy

AW: AW: AW: AW: AW: AW: AW: broken backup trail in case of quickly patroni switchback and forth

2019-11-08 Thread Zwettler Markus (OIZ)
? "Zwettler Markus (OIZ)" mailto:markus.zwett...@zuerich.ch>> wrote on 2019/11/08 11:27:00 AM: >> From: "Zwettler Markus (OIZ)" >> mailto:markus.zwett...@zuerich.ch>> >> To: Brad Nicholson mailto:br...@ca.ibm.com>> >> Cc: Adrian Klaver >> mailto:adrian.kla...@aklaver.com>>, "pgsql- >> gene...

Re: AW: AW: AW: AW: AW: AW: broken backup trail in case of quickly patroni switchback and forth

2019-11-08 Thread Brad Nicholson
"Zwettler Markus (OIZ)" wrote on 2019/11/08 11:27:00 AM: > From: "Zwettler Markus (OIZ)" > To: Brad Nicholson > Cc: Adrian Klaver , "pgsql- > gene...@lists.postgresql.org" > Date: 2019/11/08 11:27 AM > Subject: [EXTERNAL] AW: AW: AW: AW: AW: AW: broken backup trail > in case of quickly patr

AW: AW: AW: AW: AW: AW: broken backup trail in case of quickly patroni switchback and forth

2019-11-08 Thread Zwettler Markus (OIZ)
How exactly? Please clarify. "Zwettler Markus (OIZ)" mailto:markus.zwett...@zuerich.ch>> wrote on 2019/11/08 11:02:49 AM: > From: "Zwettler Markus (OIZ)" > mailto:markus.zwett...@zuerich.ch>> > To: Brad Nicholson mailto:br...@ca.ibm.com>> > Cc: Adrian Klaver > mailto:adrian.kla...@aklaver.c

Re: AW: AW: AW: AW: AW: broken backup trail in case of quickly patroni switchback and forth

2019-11-08 Thread Brad Nicholson
"Zwettler Markus (OIZ)" wrote on 2019/11/08 11:02:49 AM: > From: "Zwettler Markus (OIZ)" > To: Brad Nicholson > Cc: Adrian Klaver , "pgsql- > gene...@lists.postgresql.org" > Date: 2019/11/08 11:02 AM > Subject: [EXTERNAL] AW: AW: AW: AW: AW: broken backup trail in > case of quickly patroni s

AW: AW: AW: AW: AW: broken backup trail in case of quickly patroni switchback and forth

2019-11-08 Thread Zwettler Markus (OIZ)
Let me clarify: "But, it might start killing processes after a certain period if a _fast_ shutdown after SIGTERM didn't happen". I am talking about stopping the Patroni master process with a systemd scipt. Von: Brad Nicholson Gesendet: Freitag, 8. November 2019 15:58 An: Zwettler Markus (OIZ)

Re: INOUT PARAMETERS WITH RETURN TABLES IN FUNCTION

2019-11-08 Thread Adrian Klaver
On 11/8/19 12:18 AM, İlyas Derse wrote: I'm trying to migration to PostgreSql from SQL Server.  I have Stored Procedures what have output parameters and return tables. How can i do both together. Can you show an example of a SQL Server procedure that demonstrates what you want to achieve?

Re: AW: AW: AW: AW: broken backup trail in case of quickly patroni switchback and forth

2019-11-08 Thread Brad Nicholson
"Zwettler Markus (OIZ)" wrote on 2019/11/08 07:51:33 AM: > From: "Zwettler Markus (OIZ)" > To: Brad Nicholson > Cc: Adrian Klaver , "pgsql- > gene...@lists.postgresql.org" > Date: 2019/11/08 07:51 AM > Subject: [EXTERNAL] AW: AW: AW: AW: broken backup trail in case of > quickly patroni switch

Re: SQL SERVER migration to PostgreSql

2019-11-08 Thread SERHAD ERDEM
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 CREATE OR REPLACE FUNCTION get_film (p_pattern VARCHAR) RETURNS TABLE ( film_title VARCHAR, film_release_year INT ) AS $$ BEGIN RETURN QUERY SELECT title, cast( release_year as integer) FROM film WHERE title ILIKE p_pattern ; END

AW: AW: AW: AW: broken backup trail in case of quickly patroni switchback and forth

2019-11-08 Thread Zwettler Markus (OIZ)
It depends. It is a switchover if Patroni could to a clean shutdown. But, it might start killing processes after a certain period if a normal shutdown after SIGTERM didn't happen. This would not be a switchover anymore. In other words there is no guarantee for a "clean" switchover. This might be

Re: INOUT PARAMETERS WITH RETURN TABLES IN FUNCTION

2019-11-08 Thread Thomas Kellerer
İlyas Derse schrieb am 08.11.2019 um 09:18: > I'm trying to migration to PostgreSql from SQL Server.  I have Stored > Procedures what have output parameters and return tables. How can i do both > together.  > > CREATE or replace FUNCTION public."test" (INOUT "x" integer, INOUT "y" > character v

INOUT PARAMETERS WITH RETURN TABLES IN FUNCTION

2019-11-08 Thread İlyas Derse
I'm trying to migration to PostgreSql from SQL Server. I have Stored Procedures what have output parameters and return tables. How can i do both together. Its like ; CREATE or replace FUNCTION public."test" (INOUT "x" integer, INOUT "y" character varying(36)) RETURNS TABLE ( "id" integer, "fil

AW: broken backup trail in case of quickly patroni switchback and forth

2019-11-08 Thread Zwettler Markus (OIZ)
1) If I got you right this means enabling archiving on both machines (archive_mode=on, archive_command=cp...). Yes? 2) Will the latest transactions on the actual primary be archived (copied from pg_xlog to the local archive_directory) before this primary is reinstated as new standby? Thanks, M