Question on disk contention

2018-05-30 Thread Charles Clavadetscher
Hi Melvin As an answer to a previous post you wrote: "Also, your main problem is that when you have two exact same queries executing at the same time, they will cause contention in the disk, and neither one will make much progress." Could you elaborate a little more on the meaning of "contentio

Re: Insert UUID GEN 4 Value

2018-05-30 Thread tango ward
On Thu, May 31, 2018 at 12:06 PM, Rob Sargent wrote: > > > On May 30, 2018, at 9:57 PM, tango ward wrote: > > On Thu, May 31, 2018 at 11:53 AM, tango ward > wrote: > >> On Thu, May 31, 2018 at 11:51 AM, Laurenz Albe >> wrote: >> >>> tango ward wrote: >>> > I found this: >>> > >>> > CREATE EXTE

Re: Insert UUID GEN 4 Value

2018-05-30 Thread tango ward
On Thu, May 31, 2018 at 12:18 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wednesday, May 30, 2018, tango ward wrote: >> >> Okay I will try it. >>> >> >> When I tried it, I am getting an error: Invalid input syntax for UUID: >> uuid_generate_v4(), >> > > Avoid references to "it

Re: Insert UUID GEN 4 Value

2018-05-30 Thread David G. Johnston
On Wednesday, May 30, 2018, tango ward wrote: > > Okay I will try it. >> > > When I tried it, I am getting an error: Invalid input syntax for UUID: > uuid_generate_v4(), > Avoid references to "it" and just show the code you tried to run. David J.

Re: Insert UUID GEN 4 Value

2018-05-30 Thread Rob Sargent
> On May 30, 2018, at 9:57 PM, tango ward wrote: > >> On Thu, May 31, 2018 at 11:53 AM, tango ward wrote: >>> On Thu, May 31, 2018 at 11:51 AM, Laurenz Albe >>> wrote: >>> tango ward wrote: >>> > I found this: >>> > >>> > CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; >>> > SELECT uuid_genera

Re: Insert UUID GEN 4 Value

2018-05-30 Thread tango ward
On Thu, May 31, 2018 at 11:53 AM, tango ward wrote: > On Thu, May 31, 2018 at 11:51 AM, Laurenz Albe > wrote: > >> tango ward wrote: >> > I found this: >> > >> > CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; >> > SELECT uuid_generate_v4(); >> > >> > My problem is I have a table like this: >> > CRE

Re: Insert UUID GEN 4 Value

2018-05-30 Thread tango ward
On Thu, May 31, 2018 at 11:51 AM, Laurenz Albe wrote: > tango ward wrote: > > I found this: > > > > CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; > > SELECT uuid_generate_v4(); > > > > My problem is I have a table like this: > > CREATE TABLE enrollmentinfo ( > > id integer NOT NULL, > > cre

Re: Insert UUID GEN 4 Value

2018-05-30 Thread Laurenz Albe
tango ward wrote: > I found this: > > CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; > SELECT uuid_generate_v4(); > > My problem is I have a table like this: > CREATE TABLE enrollmentinfo ( > id integer NOT NULL, > created timestamp with time zone NOT NULL, > modified timestamp with tim

Re: Insert UUID GEN 4 Value

2018-05-30 Thread tango ward
On Thu, May 31, 2018 at 11:47 AM, tango ward wrote: > Hi, > > thanks. > > I found this: > > CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; > SELECT uuid_generate_v4(); > > My problem is I have a table like this: > CREATE TABLE enrollmentinfo ( > id integer NOT NULL, > created timestamp with

Re: Insert UUID GEN 4 Value

2018-05-30 Thread tango ward
Hi, thanks. I found this: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; SELECT uuid_generate_v4(); My problem is I have a table like this: CREATE TABLE enrollmentinfo ( id integer NOT NULL, created timestamp with time zone NOT NULL, modified timestamp with time zone NOT NULL, secu

Re: Insert UUID GEN 4 Value

2018-05-30 Thread Laurenz Albe
tango ward wrote: > I would like to know how to properly use uuid_generate_v4 when inserting data > into PostgreSQL table. > > When I run the command select * from pg_available_extensions; > I can see this uuid-ossp | 1.0 | | > generate universally unique i

Insert UUID GEN 4 Value

2018-05-30 Thread tango ward
Hi, I would like to know how to properly use uuid_generate_v4 when inserting data into PostgreSQL table. When I run the command select * from pg_available_extensions; I can see this uuid-ossp | 1.0 | | generate universally unique identifiers (UUIDs) I am tr

Re: Pgagent is not reading pgpass file either in Windows or Linux.

2018-05-30 Thread George Neuner
On Tue, 29 May 2018 13:32:46 -0700, Adrian Klaver wrote: >On 05/29/2018 12:14 PM, nageswara Bandla wrote: > >> As per the link- >> (https://www.postgresql.org/docs/9.6/static/libpq-pgpass.html) I set >> PGPASSFILE environment variable to point to pgpass.conf location. Even >> then, it’s throwi

Re: LDAP authentication slow

2018-05-30 Thread Tim Cross
C GG writes: > On Wed, May 30, 2018 at 2:50 PM, Stephen Frost wrote: > >> Greetings, >> >> * C GG (cgg0...@gmail.com) wrote: >> > On Wed, May 30, 2018 at 12:04 PM, Stephen Frost >> wrote: >> > > What's the reason for wishing for them to "be able to type in a >> > > password"? With GSSAPI/Ker

Re: LDAP authentication slow

2018-05-30 Thread C GG
On Wed, May 30, 2018 at 5:43 PM, Adrian Klaver wrote: > On 05/30/2018 01:41 PM, C GG wrote: > >> >> >> > Please let me be clear, this is not a question about whether or not to use >> passwords. This is a question of how to determine the cause of and remedy a >> slowdown retrieving data from Postg

Re: LDAP authentication slow

2018-05-30 Thread Adrian Klaver
On 05/30/2018 01:41 PM, C GG wrote: Please let me be clear, this is not a question about whether or not to use passwords. This is a question of how to determine the cause of and remedy a slowdown retrieving data from PostgreSQL when using LDAP(S) to authenticate PostgreSQL users. One of th

Re: LDAP authentication slow

2018-05-30 Thread C GG
On Wed, May 30, 2018 at 2:50 PM, Stephen Frost wrote: > Greetings, > > * C GG (cgg0...@gmail.com) wrote: > > On Wed, May 30, 2018 at 12:04 PM, Stephen Frost > wrote: > > > What's the reason for wishing for them to "be able to type in a > > > password"? With GSSAPI/Kerberos, users get true singl

Re: execute block like Firebird does

2018-05-30 Thread Peter J. Holzer
On 2018-05-30 15:16:56 +0200, Félix GERZAGUET wrote: > On Wed, May 30, 2018 at 2:50 PM, PegoraroF10 wrote: > So, is that possible to change a DO structure is ran, to be possible to > return one or more values ? > It would be like ... > DO returns(ID Integer, Description Text) as >

Re: LDAP authentication slow

2018-05-30 Thread Stephen Frost
Greetings, * C GG (cgg0...@gmail.com) wrote: > On Wed, May 30, 2018 at 12:04 PM, Stephen Frost wrote: > > What's the reason for wishing for them to "be able to type in a > > password"? With GSSAPI/Kerberos, users get true single-sign-on, so they > > would log into the Windows system with a passw

Re: Pgagent is not reading pgpass file either in Windows or Linux.

2018-05-30 Thread Adrian Klaver
On 05/30/2018 08:48 AM, nageswara Bandla wrote: On Tue, May 29, 2018 at 6:15 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 05/29/2018 03:57 PM, nageswara Bandla wrote: #1. Windows: My guess because the LocalSystem user does not have permissions

Re: Login with LDAP authentication takes 5 seconds

2018-05-30 Thread Jeff Janes
On Mon, May 28, 2018 at 10:26 AM, Andreas Schmid wrote: > Hi, > > I configured my PostgreSQL 10 DB on Debian 9.2 with LDAP authentication > (simple bind mode). While this basically works, it has the strange effect > that the first login with psql takes around 5 seconds. When I reconnect > within

Re: LDAP authentication slow

2018-05-30 Thread C GG
On Wed, May 30, 2018 at 12:04 PM, Stephen Frost wrote: > Greetings, > > * C GG (cgg0...@gmail.com) wrote: > > This is PostgreSQL 9.5 -- We just enabled LDAP(S) authentication (to an > > Active Directory server) for a certain grouping of users > > You really shouldn't be using LDAP auth to an Acti

Re: LDAP authentication slow

2018-05-30 Thread Stephen Frost
Greetings, * C GG (cgg0...@gmail.com) wrote: > This is PostgreSQL 9.5 -- We just enabled LDAP(S) authentication (to an > Active Directory server) for a certain grouping of users You really shouldn't be using LDAP auth to an Active Directory system. Active Directory supports Kerberos, which is a m

Re: Pgagent is not reading pgpass file either in Windows or Linux.

2018-05-30 Thread nageswara Bandla
On Wed, May 30, 2018 at 5:11 AM, Stéphane Dunand wrote: > > Le 29/05/2018 à 21:14, nageswara Bandla a écrit : > > > > The intention of this post is to find out ways to run pgagent without > passing password in its connection string. > > > > *Windows:* > > I have installed pgagent on windows and c

Re: Pgagent is not reading pgpass file either in Windows or Linux.

2018-05-30 Thread nageswara Bandla
On Tue, May 29, 2018 at 6:15 PM, Adrian Klaver wrote: > On 05/29/2018 03:57 PM, nageswara Bandla wrote: > >> #1. Windows: >> >> My guess because the LocalSystem user does not have permissions on your: >> %APPDATA%/postgresql/pgpass.co nf >> file. This seems to be confirmed by it

Re: Query running for 12 hours

2018-05-30 Thread Adrian Klaver
On 05/30/2018 07:41 AM, Yavuz Selim Sertoğlu wrote: Major upgrade would be very painful because there are many application running on different servers but same database server. FYI, 9.5.3 --> 9.5.13 is considered a minor upgrade. Their tests would take too much time. So I will try to go with

Re: Query running for 12 hours

2018-05-30 Thread Yavuz Selim Sertoğlu
Major upgrade would be very painful because there are many application running on different servers but same database server. Their tests would take too much time. So I will try to go with minor upgrade. Thanks for your help, have a good day. >> > Remaining suggestions/questions: > > 1) If it

Re: Query running for 12 hours

2018-05-30 Thread Adrian Klaver
On 05/30/2018 07:19 AM, Yavuz Selim Sertoğlu wrote: 2018-05-30 17:02 GMT+03:00 Adrian Klaver >: On 05/30/2018 06:54 AM, Yavuz Selim Sertoğlu wrote: I am just a regular dba so I dont know what's sent from application exactly but I assume n

Re: Query running for 12 hours

2018-05-30 Thread Yavuz Selim Sertoğlu
2018-05-30 17:02 GMT+03:00 Adrian Klaver : > On 05/30/2018 06:54 AM, Yavuz Selim Sertoğlu wrote: > >> I am just a regular dba so I dont know what's sent from application >> exactly but I assume now()-1 week. >> In the log file, there are two more same queries. And their value is >> *2018-05-23 02:

Re: Query running for 12 hours

2018-05-30 Thread Adrian Klaver
On 05/30/2018 07:00 AM, Melvin Davidson wrote: T*wo things: * *From your explain, it looks like you need an index on this_.tarih, since it is doing a sequential scan when it should be using an index.* * * *Also, your main problem is that when you have two exact same queries executing at

Re: Query running for 12 hours

2018-05-30 Thread Adrian Klaver
On 05/30/2018 06:54 AM, Yavuz Selim Sertoğlu wrote: I am just a regular dba so I dont know what's sent from application exactly but I assume now()-1 week. In the log file, there are two more same queries. And their value is *2018-05-23 02:00:00* And these queries are not showing up in pg_sta

Re: Query running for 12 hours

2018-05-30 Thread Melvin Davidson
On Wed, May 30, 2018 at 9:54 AM, Yavuz Selim Sertoğlu < yavuzselim.serto...@bisoft.com.tr> wrote: > I am just a regular dba so I dont know what's sent from application > exactly but I assume now()-1 week. > In the log file, there are two more same queries. And their value is > *2018-05-23 > 02:0

Re: Query running for 12 hours

2018-05-30 Thread Yavuz Selim Sertoğlu
I am just a regular dba so I dont know what's sent from application exactly but I assume now()-1 week. In the log file, there are two more same queries. And their value is *2018-05-23 02:00:00* *Here are todays log lines for that query.* tarih=2018-05-30 02:12:19 +03,session_number=1,db=mydb,use

Re: Update rules on views

2018-05-30 Thread Adrian Klaver
On 05/26/2018 11:32 AM, Maroš Kollár wrote: Hello, I am currently evaluating multiple ways of denying certain updates on record AND indicating whether an update was denied because it did not match some criteria or if it simply was not found. One of these methods is using the rule system and be

Re: Query running for 12 hours

2018-05-30 Thread Adrian Klaver
On 05/30/2018 04:37 AM, Yavuz Selim Sertoğlu wrote: Hi everybody, * * *Today I saw that two queries have been running for more then 12 hours(They are the same query actually).* /mydb=# select * from pg_stat_activity where state='active' and state_change < now()-'12 hours'::interval;/ *I

Re: execute block like Firebird does

2018-05-30 Thread Félix GERZAGUET
Hello, On Wed, May 30, 2018 at 2:50 PM, PegoraroF10 wrote: > How to send a script to server and return one or more values from that > execution ? > > You´ll probably answer me that I could solve that with a function. But > suppose those executions are dynamic, depends on businness rules or any >

Re: execute block like Firebird does

2018-05-30 Thread Adrian Klaver
On 05/30/2018 05:50 AM, PegoraroF10 wrote: Some time ago I´ve posted this thread because we had lots of these execute blocks to be translated to Postgres. Now, continuing on same matter, I would like to discuss the same topic, basically calling the server one time only, instead of several times.

Re: execute block like Firebird does

2018-05-30 Thread PegoraroF10
Some time ago I´ve posted this thread because we had lots of these execute blocks to be translated to Postgres. Now, continuing on same matter, I would like to discuss the same topic, basically calling the server one time only, instead of several times. Usually we want get some values from server a

Query running for 12 hours

2018-05-30 Thread Yavuz Selim Sertoğlu
Hi everybody, *Today I saw that two queries have been running for more then 12 hours(They are the same query actually).* *mydb=# select * from pg_stat_activity where state='active' and state_change < now()-'12 hours'::interval;* -[ RECORD 1 ]+-

Re: pgdg-keyring (or apt-key) failure on fresh 9.6 install

2018-05-30 Thread Moreno Andreo
Il 30/05/2018 00:25, Tim Cross ha scritto: Personally, I tend to prefer using the packages which come with the particular flavour of Linux your installing as they are often more in-line with the current version of the package management system being used. I only grab packages from the specific P

Re: Pgagent is not reading pgpass file either in Windows or Linux.

2018-05-30 Thread Stéphane Dunand
Le 29/05/2018 à 21:14, nageswara Bandla a écrit : The intention of this post is to find out ways to run pgagent without passing password in its connection string. *Windows:* I have installed pgagent on windows and configured to run under Local System account. Command:- C:\PostgreSQL\big

Re: Fwd: Tracking DDL and DML changes in Postgresql and different versions of database (advance)

2018-05-30 Thread pavan95
Hi Luke, >Thank you Pavan, >I have a few questions. >Could you please describe in more details about event triggers? Maybe some examples how to start with this? Please refer the below link for more detailed information about "Event Triggers". Link: https://www.postgresql.org/docs/10/static

Fwd: Tracking DDL and DML changes in Postgresql and different versions of database (advance)

2018-05-30 Thread Łukasz Jarych
-- Forwarded message -- From: Łukasz Jarych Date: 2018-05-30 9:35 GMT+02:00 Subject: Re: Tracking DDL and DML changes in Postgresql and different versions of database (advance) To: Pavan Teja Thank you Pavan, I have a few questions. Could you please describe in more details ab