Re: Insert UUID GEN 4 Value

2018-05-31 Thread Ron
On 05/31/2018 07:39 PM, tango ward wrote: On Thu, May 31, 2018 at 12:32 PM, tango ward > wrote: On Thu, May 31, 2018 at 12:18 PM, David G. Johnston mailto:david.g.johns...@gmail.com>> wrote: On Wednesday, May 30, 2018, tango ward mailto:tangowar...

Re: Insert UUID GEN 4 Value

2018-05-31 Thread tango ward
On Thu, May 31, 2018 at 12:32 PM, tango ward wrote: > > 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 syn

Re: Sort is generating rows

2018-05-31 Thread Adrian Klaver
On 05/31/2018 02:09 AM, Nicolas Seinlet wrote: Hi, I have a query with a strange query plan. This query is roughly searching for sales, and convert them with a currency rate. As currency rate changes from time to time, table contains the currency, the company, the rate, the start date of ava

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

2018-05-31 Thread George Neuner
On Thu, 31 May 2018 15:40:21 -0500, nageswara Bandla wrote: >On Thu, May 31, 2018 at 12:57 PM, George Neuner >wrote: > >> It just occurred to me that you said PGPASSFILE was set to >> >> %APPDATA%/postgresql/pgpass.conf >> >> >> The problem may be that when LocalSystem expands %APPDATA%, it

RE: now getting log messages!

2018-05-31 Thread Ian Bell
Hello Adrian, I agree with your 'Hmm' skepticism and will be looking at this later tonight. On the bright side, I finally have the logging working properly and this should make it relative easy for me to backtrack and find/understand the mistake I was making. I only have one instance of th

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

2018-05-31 Thread nageswara Bandla
On Thu, May 31, 2018 at 12:57 PM, George Neuner wrote: > On Thu, 31 May 2018 11:24:18 -0500, nageswara Bandla > wrote: > > >On Wed, May 30, 2018 at 7:45 PM, George Neuner > wrote: > > > >> LocalSystem has administrator permissions to virtually everything. > >> https://msdn.microsoft.com/en-us/l

Re: now getting log messages!

2018-05-31 Thread Adrian Klaver
On 05/31/2018 01:03 PM, Ian Bell wrote: Hello Adrian, Your suggestions have changed something and my messages are appearing in the log file. As per your suggestion, I enabled ' log_connections' and 'log_disconnections' and restarted the server. Hmm, again:) Changing log_connections, log_di

now getting log messages!

2018-05-31 Thread Ian Bell
Hello Adrian, Your suggestions have changed something and my messages are appearing in the log file. As per your suggestion, I enabled ' log_connections' and 'log_disconnections' and restarted the server. I now have something to work with. In addition, I now know what to expect when attemp

RE: unable to write 'raise' messages to log file?

2018-05-31 Thread Ian Bell
Hello Olivier, Yes, I have used ‘notice’, ‘log’ and the various ‘debug’ levels but again none of my message show up in the log files. Ian From: Olivier Gautherot [mailto:oliv...@gautherot.net] Sent: 31 May, 2018 15:26 To: Adrian Klaver Cc: i...@ianbellsoftware.com; pgsql-general@lis

Re: unable to write 'raise' messages to log file?

2018-05-31 Thread Adrian Klaver
On 05/31/2018 12:18 PM, Ian Bell wrote: Hello Adrian, Yes, if I call the function in PSQL then the expected message is displayed the console display. Here is what is displayed in PSQL: testdb=# select * from test.testwithbasictypearguments( 1, 2::numeric, '3' ); LOG: statemen

Re: unable to write 'raise' messages to log file?

2018-05-31 Thread Olivier Gautherot
Hi Ian, On Thu, May 31, 2018 at 3:19 PM, Adrian Klaver wrote: > On 05/31/2018 12:15 PM, Olivier Gautherot wrote: > >> On Thu, May 31, 2018 at 3:07 PM, Adrian Klaver > > wrote: >> >> On 05/31/2018 11:20 AM, Ian Bell wrote: >> >> I am having considerab

Re: unable to write 'raise' messages to log file?

2018-05-31 Thread Adrian Klaver
On 05/31/2018 12:15 PM, Olivier Gautherot wrote: On Thu, May 31, 2018 at 3:07 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 05/31/2018 11:20 AM, Ian Bell wrote: I am having considerable difficulty logging information in PL-pgSQL functions by using the ‘RAIS

RE: unable to write 'raise' messages to log file?

2018-05-31 Thread Ian Bell
Hello Adrian, Yes, if I call the function in PSQL then the expected message is displayed the console display. Here is what is displayed in PSQL: testdb=# select * from test.testwithbasictypearguments( 1, 2::numeric, '3' ); LOG: statement: select * from test.testwithbasictypearg

Re: unable to write 'raise' messages to log file?

2018-05-31 Thread Olivier Gautherot
On Thu, May 31, 2018 at 3:07 PM, Adrian Klaver wrote: > On 05/31/2018 11:20 AM, Ian Bell wrote: > >> I am having considerable difficulty logging information in PL-pgSQL >> functions by using the ‘RAISE’ statement.I am asking for >> comments/suggestions on what I am doing wrong. >> >> > >> I’v

Re: unable to write 'raise' messages to log file?

2018-05-31 Thread Adrian Klaver
On 05/31/2018 11:20 AM, Ian Bell wrote: I am having considerable difficulty logging information in PL-pgSQL functions by using the ‘RAISE’ statement.    I am asking for comments/suggestions on what I am doing wrong. I’ve tried flushing/rotating the log files by executing *‘select pg_rotat

unable to write 'raise' messages to log file?

2018-05-31 Thread Ian Bell
I am having considerable difficulty logging information in PL-pgSQL functions by using the 'RAISE' statement.I am asking for comments/suggestions on what I am doing wrong. Each time I restart the server then server startup messages appear in the log file. In addition, changing the message

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

2018-05-31 Thread George Neuner
On Thu, 31 May 2018 11:24:18 -0500, nageswara Bandla wrote: >On Wed, May 30, 2018 at 7:45 PM, George Neuner wrote: > >> LocalSystem has administrator permissions to virtually everything. >> https://msdn.microsoft.com/en-us/library/windows/desktop/ >> ms684190(v=vs.85).aspx >> >> It should be abl

R: Re: License Question

2018-05-31 Thread Federico Di Gregorio
Federico Di Gregorio ha scritto > Steve Crawford ha scritto > > > > On Thu, May 31, 2018 at 7:35 AM Jamie Specter > > wrote: > > > > > > ... > > > > > > I would love to use it in an Apache-licensed project but unfortunately, > > LGPL licenses are not compatible with

R: Re: License Question

2018-05-31 Thread Federico Di Gregorio
Steve Crawford ha scritto > On Thu, May 31, 2018 at 7:35 AM Jamie Specter wrote: > > ... > > I would love to use it in an Apache-licensed project but unfortunately, LGPL > licenses are not compatible with Apache 2.0. > ... > > Is there any chance the project can be dual-licensed w

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

2018-05-31 Thread nageswara Bandla
On Wed, May 30, 2018 at 7:45 PM, George Neuner wrote: > 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

Re: Insert UUID GEN 4 Value

2018-05-31 Thread David G. Johnston
On Wed, May 30, 2018 at 9:32 PM, tango ward wrote: > > 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

Re: License Question

2018-05-31 Thread Steve Crawford
On Thu, May 31, 2018 at 7:35 AM Jamie Specter wrote: > ... > I would love to use it in an Apache-licensed project but unfortunately, > LGPL licenses are not compatible with Apache 2.0. > > ... > Is there any chance the project can be dual-licensed with a permissive > option like MIT or BSD? ... >

Re: Login with LDAP authentication takes 5 seconds

2018-05-31 Thread Achilleas Mantzios
On 28/05/2018 17:26, 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 60 seconds, the login c

License Question

2018-05-31 Thread Jamie Specter
Hello - Big fan of psycopg2! I would love to use it in an Apache-licensed project but unfortunately, LGPL licenses are not compatible with Apache 2.0. See here for more info: https://www.apache.org/legal/resolved.html#category-x Apache 2.0 explicitly states that we cannot distribute components

Re: Insert UUID GEN 4 Value

2018-05-31 Thread Adrian Klaver
On 05/30/2018 09:32 PM, tango ward wrote: I'm testing this code: curr_pgsql.execute('''CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; ''') curr_pgsql.execute('''     INSERT INTO enrollmentinfo ( created, modified,

Re: Insert UUID GEN 4 Value

2018-05-31 Thread Adrian Klaver
On 05/31/2018 06:39 AM, Tom Lane wrote: Adrian Klaver writes: My suspicion is it had to do with this from a post upstream: "When I tried it, I am getting an error: Invalid input syntax for UUID: uuid_generate_v4()," Yeah. We haven't seen the actual query yet, but I'm betting the OP really wr

Re: Insert UUID GEN 4 Value

2018-05-31 Thread Dennis Gearon
Sent from Yahoo Mail on Android On Wed, May 30, 2018 at 8:25 PM, tango ward wrote: 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  | aq

Re: Question on disk contention

2018-05-31 Thread Fabio Pardi
As far as I know, the OS cache is shared, and shared_buffers too. Back to the matter of contention, your statement i think might be true only in cases when you are querying data which does not fit in RAM. Under those circumstances, the OS or Postgres might need to evict blocks from RAM to make

RE: Question on disk contention

2018-05-31 Thread Igor Neyman
> Why isn't the OS caching the disk blocks, and why isn't Postgres using the > cached data? It does, but the cache is for each connection/job. They are not shared. -- Melvin Davidson Maj. Database & Exploration Specialist Universe Exploration Command – UXC Employment by invitation only! That

Re: Question on disk contention

2018-05-31 Thread Melvin Davidson
On Thu, May 31, 2018 at 10:04 AM, Ron wrote: > On 05/31/2018 08:52 AM, Melvin Davidson wrote: > > > > On Thu, May 31, 2018 at 1:13 AM, Charles Clavadetscher < > clavadetsc...@swisspug.org> wrote: > >> Hi Melvin >> >> As an answer to a previous post you wrote: >> >> "Also, your main problem is tha

Re: Question on disk contention

2018-05-31 Thread Ron
On 05/31/2018 08:52 AM, Melvin Davidson wrote: On Thu, May 31, 2018 at 1:13 AM, Charles Clavadetscher mailto:clavadetsc...@swisspug.org>> wrote: Hi Melvin As an answer to a previous post you wrote: "Also, your main problem is that when you have two exact same queries execut

Re: Question on disk contention

2018-05-31 Thread Melvin Davidson
On Thu, May 31, 2018 at 1:13 AM, Charles Clavadetscher < clavadetsc...@swisspug.org> wrote: > 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, a

Re: Insert UUID GEN 4 Value

2018-05-31 Thread Tom Lane
Adrian Klaver writes: > My suspicion is it had to do with this from a post upstream: > "When I tried it, I am getting an error: Invalid input syntax for UUID: > uuid_generate_v4()," Yeah. We haven't seen the actual query yet, but I'm betting the OP really wrote INSERT ... , 'uuid_gener

Re: Long running DDL statements blocking all queries

2018-05-31 Thread Ashu Pachauri
There was too much noise in the pg_stat_activity output, so I did not post it. I'll collect the output again and post. But, when I checked in pg_stat_activity, PID 18317 is the session that's running the ALTER statement and it was showing up as "active". So, it's not blocked by anything, but the f

Re: Insert UUID GEN 4 Value

2018-05-31 Thread Adrian Klaver
On 05/30/2018 09:45 PM, tango ward wrote: On Thu, May 31, 2018 at 12:06 PM, Rob Sargent > wrote: If I try these in psql, CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; SELECT uuid_generate_v4(); I am getting the generated code but I dunno how to use this in INSE

Re: Insert UUID GEN 4 Value

2018-05-31 Thread Adrian Klaver
On 05/31/2018 05:36 AM, C GG wrote: On Thu, May 31, 2018 at 12:45 AM, tango ward > wrote: On Thu, May 31, 2018 at 12:06 PM, Rob Sargent mailto:robjsarg...@gmail.com>> wrote: On May 30, 2018, at 9:57 PM, tango ward mailto:tangowar...@gmail.com>> wrot

Re: Long running DDL statements blocking all queries

2018-05-31 Thread Fabio Pardi
Ashu, please, provide full output of: \x select * from pg_stat_activity ; What you posted on github is only providing a list of blocked backends. If I read it correctly, then PID 18317 is the root cause of all the locks, but it does not show up in the list, not being blocked by anything...

Re: Insert UUID GEN 4 Value

2018-05-31 Thread C GG
On Thu, May 31, 2018 at 12:45 AM, tango ward wrote: > 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:

Re: Long running DDL statements blocking all queries

2018-05-31 Thread Ashu Pachauri
Thanks Fabio for the reply. The queries are blocked in the sense that I can see them in pg_stat_activity. Please find the query and its output for correlating the blocked activity with blocking query from pg_state_activity and pg_locks: https://gist.github.com/ashu210890/c39cd7a38ce37f4baab2f58e1a

Re: LDAP authentication slow

2018-05-31 Thread C GG
On Wed, May 30, 2018 at 6:31 PM, Tim Cross wrote: > > 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 wis

Re: Long running DDL statements blocking all queries

2018-05-31 Thread Fabio Pardi
Hi Ashu, when you say 'almost every query in our application starts getting blocked'... 'blocked' as in 'they are stuck and can be seen in pg_stat_activity'? (in this case, please post the full content of pg_stat_activity) or 'blocked' as in 'they are waiting in pgbouncer pool? regards,

Long running DDL statements blocking all queries

2018-05-31 Thread Ashu Pachauri
We have been using Postgres 9.5.12 behind PGBouncer and facing some weird issues. Whenever we running long running DDL statements (e.g. 'add index concurently' or 'Alter table alter column type'), after some time, we start seeing that almost every query in our application starts getting blocked. I

Sort is generating rows

2018-05-31 Thread Nicolas Seinlet
Hi, I have a query with a strange query plan. This query is roughly searching for sales, and convert them with a currency rate. As currency rate changes from time to time, table contains the currency, the company, the rate, the start date of availability of this rate and the end date of availabil