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

2018-05-29 Thread Pavan Teja
On Wed, May 30, 2018, 11:03 AM Łukasz Jarych wrote: > Hi Guys, > > i am using Access FE and Postgresql BE. > To track DML changes i have history log table wotking like here: > > https://www.fontstuff.com/access/acctut21.htm > > It is ok but this doesnt solve the problem with trakich DDL changes.

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

2018-05-29 Thread Łukasz Jarych
Hi Guys, i am using Access FE and Postgresql BE. To track DML changes i have history log table wotking like here: https://www.fontstuff.com/access/acctut21.htm It is ok but this doesnt solve the problem with trakich DDL changes. For DDL changes i can use flyway system but how to combine this wi

Re: existence of a savepoint?

2018-05-29 Thread David G. Johnston
On Tuesday, May 29, 2018, Stuart McGraw wrote: > But in my case I don't control the size of the input data > Not in production but you have an idea of both size and complexity and should be able to generate performance test scenarios, and related monitoring queries (system and service) to obtai

Re: existence of a savepoint?

2018-05-29 Thread Stuart McGraw
On 05/29/2018 05:01 PM, Alvaro Herrera wrote: On 2018-May-29, Stuart McGraw wrote: Alternatively if there were a setting to tell Postgresql to follow the SQL standard behavior of overwriting rather stacking savepoints, that too would also solve my current problem I think. Perhaps it is just my

Re: existence of a savepoint?

2018-05-29 Thread Stuart McGraw
On 05/29/2018 05:18 PM, David G. Johnston wrote: On Tue, May 29, 2018 at 4:01 PM, Alvaro Herrera mailto:alvhe...@2ndquadrant.com>>wrote: On 2018-May-29, Stuart McGraw wrote: > Alternatively if there were a setting to tell Postgresql to > follow the SQL standard behavior of overwriti

Re: reduce number of multiple values to be inserted

2018-05-29 Thread tango ward
On Wed, May 30, 2018 at 8:40 AM, Rob Sargent wrote: > > > > On 05/29/2018 06:36 PM, Adrian Klaver wrote: > >> On 05/29/2018 05:10 PM, tango ward wrote: >> >>> >>> Hi, >>> >> Not sure where you are pulling the data from and how it is ordered, but >> an outline: >> >> data_input (Assuming sorted by

Re: reduce number of multiple values to be inserted

2018-05-29 Thread Rob Sargent
On 05/29/2018 06:36 PM, Adrian Klaver wrote: On 05/29/2018 05:10 PM, tango ward wrote: Hi, Not sure where you are pulling the data from and how it is ordered, but an outline: data_input (Assuming sorted by village and then age) for village in data_input: for age in village:

Re: reduce number of multiple values to be inserted

2018-05-29 Thread Adrian Klaver
On 05/29/2018 05:10 PM, tango ward wrote: Hi, I am working on inserting multiple values for a table. I need to insert 3 values of data for each age of the students from the same village. It will be 3 different ages of student per village. My sample code: curr_pgsql.execute('''   

Re: reduce number of multiple values to be inserted

2018-05-29 Thread Rob Sargent
> On May 29, 2018, at 6:32 PM, tango ward wrote: > > On Wed, May 30, 2018 at 8:29 AM, Rob Sargent > wrote: > > Is “current_timezone, current_timezone” just a typo? I think you need to > make the 117 data lines and load using \copy > > > > Sorry, yeah, it's c

Re: reduce number of multiple values to be inserted

2018-05-29 Thread tango ward
On Wed, May 30, 2018 at 8:29 AM, Rob Sargent wrote: > > Is “current_timezone, current_timezone” just a typo? I think you need to > make the 117 data lines and load using \copy > > Sorry, yeah, it's current_timestamp.

Re: reduce number of multiple values to be inserted

2018-05-29 Thread Rob Sargent
> On May 29, 2018, at 6:10 PM, tango ward wrote: > > > Hi, > > I am working on inserting multiple values for a table. I need to insert 3 > values of data for each age of the students from the same village. It will be > 3 different ages of student per village. > > My sample code: > > > c

Re: reduce number of multiple values to be inserted

2018-05-29 Thread tango ward
On Wed, May 30, 2018 at 8:21 AM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Tuesday, May 29, 2018, tango ward wrote: >> >> I will repeat the same process for 13 villages so that will be 117 of >> values. I would like to know if there's a way to reduce the script? This >> has to b

Re: reduce number of multiple values to be inserted

2018-05-29 Thread David G. Johnston
On Tuesday, May 29, 2018, tango ward wrote: > > I will repeat the same process for 13 villages so that will be 117 of > values. I would like to know if there's a way to reduce the script? This > has to be done strictly via script. > > VALUES and CROSS JOIN might help but you haven't explained the

reduce number of multiple values to be inserted

2018-05-29 Thread tango ward
Hi, I am working on inserting multiple values for a table. I need to insert 3 values of data for each age of the students from the same village. It will be 3 different ages of student per village. My sample code: curr_pgsql.execute(''' INSERT INTO student (created, modified,

Re: existence of a savepoint?

2018-05-29 Thread David G. Johnston
On Tue, May 29, 2018 at 4:01 PM, Alvaro Herrera wrote: > On 2018-May-29, Stuart McGraw wrote: > > > Alternatively if there were a setting to tell Postgresql to > > follow the SQL standard behavior of overwriting rather stacking > > savepoints, that too would also solve my current problem I think.

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

2018-05-29 Thread Adrian Klaver
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 working when you run pgagent as the login user. Also: passfile     S

Re: existence of a savepoint?

2018-05-29 Thread Alvaro Herrera
On 2018-May-29, Stuart McGraw wrote: > Alternatively if there were a setting to tell Postgresql to > follow the SQL standard behavior of overwriting rather stacking > savepoints, that too would also solve my current problem I think. > Perhaps it is just my limited experience but the former behavio

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

2018-05-29 Thread nageswara Bandla
#1. Windows: My guess because the LocalSystem user does not have permissions on your: %APPDATA%/postgresql/pgpass.conf file. This seems to be confirmed by it working when you run pgagent as the login user. Also: passfile Specifies the name of the file used to store passwords (see Section 33.15

Re: existence of a savepoint?

2018-05-29 Thread Stuart McGraw
On 05/29/2018 08:26 AM, Brian Dunavant wrote: On Sun, May 27, 2018 at 6:04 PM, Stuart McGraw mailto:smcg4...@mtneva.com>> wrote: Is there some way to to test if a savepoint of a given name exists?  Or better yet, the number of stacked savepoints of that name? This is kind of backward

Re: existence of a savepoint?

2018-05-29 Thread Stuart McGraw
On 05/29/2018 08:38 AM, Alvaro Herrera wrote: On 2018-May-27, Stuart McGraw wrote: Is there some way to to test if a savepoint of a given name exists? Or better yet, the number of stacked savepoints of that name? What is the use case for this? I have a process that extracts data from a sou

Re: existence of a savepoint?

2018-05-29 Thread Stuart McGraw
On 05/27/2018 04:39 PM, David G. Johnston wrote: On Sunday, May 27, 2018, Stuart McGraw mailto:smcg4...@mtneva.com>> wrote: Is there some way to to test if a savepoint of a given name exists?  Or better yet, the number of stacked savepoints of that name? A scan of the documentation

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

2018-05-29 Thread Tim Cross
Moreno Andreo writes: > Hi Tim, > > Il 29/05/2018 00:06, Tim Cross ha scritto: >> Moreno Andreo writes: >> >>> Hi folks, >>> I'm trying to install Postgresql 9.6 on a test machine in Google Cloud >>> Platform >>> After a fresh install with Debian 9 (just after the instance has been >>> created

Re: How to drop a value from an ENUM?

2018-05-29 Thread Tom Lane
=?UTF-8?Q?Torsten_F=C3=B6rtsch?= writes: > I am absolutely sure a certain value of one of my ENUM types is not used in > the entire database. Now I am asked to drop that value. Unfortunately, > there is no ALTER TYPE DROP VALUE. Yup. > On my development box I tried > delete from pg_enum > where

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

2018-05-29 Thread Adrian Klaver
On 05/29/2018 12:14 PM, nageswara Bandla wrote: 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\bigsql\p

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

2018-05-29 Thread nageswara Bandla
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\bigsql\pgagent\bin\pgagent.exe INSTALL pgagent -l 2 -u L

Re: Login with LDAP authentication takes 5 seconds

2018-05-29 Thread Laurenz Albe
Andreas Schmid wrote: > 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 > completes immed

Re: existence of a savepoint?

2018-05-29 Thread Alvaro Herrera
On 2018-May-27, Stuart McGraw wrote: > Is there some way to to test if a savepoint of a given name > exists? Or better yet, the number of stacked savepoints of > that name? What is the use case for this? -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7

Re: existence of a savepoint?

2018-05-29 Thread Brian Dunavant
On Sun, May 27, 2018 at 6:04 PM, Stuart McGraw wrote: > Is there some way to to test if a savepoint of a given name > exists? Or better yet, the number of stacked savepoints of > that name? > > This is kind of backwards, but you can determine if a savepoint by a certain name exists by trying to

LDAP authentication slow

2018-05-29 Thread C GG
This is PostgreSQL 9.5 -- We just enabled LDAP(S) authentication (to an Active Directory server) for a certain grouping of users pg_hba.conf #... hostssl all +ldap_group 0.0.0.0/0 ldap ldaptls="1" ldapserver=" hostssl all all 0.0.0.0/0 md5 #... I'm getting complaints from the users authent

Login with LDAP authentication takes 5 seconds

2018-05-29 Thread Andreas Schmid
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 completes immediately. The LDAP server is beh

Update rules on views

2018-05-29 Thread Maroš Kollár
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 behaves in an odd way.The unexpected results are

Re: How to drop a value from an ENUM?

2018-05-29 Thread Melvin Davidson
On Mon, May 28, 2018 at 11:08 PM, Torsten Förtsch wrote: > Hi, > > I am absolutely sure a certain value of one of my ENUM types is not used > in the entire database. Now I am asked to drop that value. Unfortunately, > there is no ALTER TYPE DROP VALUE. > > On my development box I tried > > delete

Re: SQL problem (forgot to change header with earlier post!).

2018-05-29 Thread Adrian Klaver
On 05/29/2018 06:52 AM, Adrian Klaver wrote: On 05/29/2018 05:05 AM, Paul Linehan wrote: Hi again, and thanks for your efforts on my behalf! WITH num AS (     SELECT count (*) as cnt1 FROM v1   ), div AS (     SELECT count (*) as cnt2 FROM v2   )   SELECT (num.cnt1::numeric/div.cnt2)  From num

Re: SQL problem (forgot to change header with earlier post!).

2018-05-29 Thread Adrian Klaver
On 05/29/2018 05:05 AM, Paul Linehan wrote: Hi again, and thanks for your efforts on my behalf! WITH num AS ( SELECT count (*) as cnt1 FROM v1 ), div AS ( SELECT count (*) as cnt2 FROM v2 ) SELECT (num.cnt1::numeric/div.cnt2) From num cross join div; I've tried running this co

Re: SQL problem (forgot to change header with earlier post!).

2018-05-29 Thread Paul Linehan
Hi again, and thanks for your efforts on my behalf! > WITH num AS > ( >SELECT count (*) as cnt1 FROM v1 > ), > div AS > ( >SELECT count (*) as cnt2 FROM v2 > ) > SELECT (num.cnt1::numeric/div.cnt2) > From num cross join div; I've tried running this code 4 different ways and none of th

Re: SQL problem (forgot to change header with earlier post!).

2018-05-29 Thread Paul Linehan
Hi and grazie for your reply! > If it's not an excercise, I think you don't need them Not an exercise - I have to use the VIEW though - this was only a sample. In real life the VIEW is trickier! > select (select count(*) from t1) / (select count(*) from t2)::float Looks as if the CAST was pa

Re: SQL problem (forgot to change header with earlier post!).

2018-05-29 Thread Paul Linehan
Hi, and thanks for taking the trouble to reply! > WITH num AS > ( > SELECT count (*) as cnt1 FROM v1 > ), > div AS > ( > SELECT count (*) as cnt2 FROM v2 > ) > SELECT (num.cnt1::numeric/div.cnt2); I get this error ERROR: missing FROM-clause entry for table "num" LINE 9: SELECT (num.cnt1::n

Re: SQL problem (forgot to change header with earlier post!).

2018-05-29 Thread Moreno Andreo
Il 29/05/2018 13:14, Paul Linehan ha scritto: Hi all, I have a problem that I just can't seem to solve: I want to divide the count of one table by the count of another - seems simple enough! I created simple VIEWs with counts of the tables, but I just can't grasp the logic! If it's not an exce

Re: binaries for 11 beta compiled with --with-llvm?

2018-05-29 Thread Andreas Kretschmer
On 29 May 2018 13:12:33 CEST, Paul Linehan wrote: >Hi all, > >I have a problem that I just can't seem to solve: > Please create a new thread for a new question. Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company

SQL problem (forgot to change header with earlier post!).

2018-05-29 Thread Paul Linehan
Hi all, I have a problem that I just can't seem to solve: I want to divide the count of one table by the count of another - seems simple enough! I created simple VIEWs with counts of the tables, but I just can't grasp the logic! DDL and DML (simplified) at the bottom of post. I tried various c

Re: binaries for 11 beta compiled with --with-llvm?

2018-05-29 Thread Paul Linehan
Hi all, I have a problem that I just can't seem to solve: I want to divide the count of one table by the count of another - seems simple enough! I created simple VIEWs with counts of the tables, but I just can't grasp the logic! DDL and DML (simplified) at the bottom of post. I tried various c

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

2018-05-29 Thread Moreno Andreo
Hi Tim, Il 29/05/2018 00:06, Tim Cross ha scritto: Moreno Andreo writes: Hi folks, I'm trying to install Postgresql 9.6 on a test machine in Google Cloud Platform After a fresh install with Debian 9 (just after the instance has been created) I follow steps from here https://wiki.postgresql.o

Re: binaries for 11 beta compiled with --with-llvm?

2018-05-29 Thread Christoph Moench-Tegeder
## Thomas Kellerer (spam_ea...@gmx.net): > But what about Linux binaries with JITting enabled? The Debian packages do have JIT enabled. https://www.postgresql.org/download/linux/debian/ Regards, Christoph -- Spare Space

inner join elimination

2018-05-29 Thread Arturo Guadagnin
Hi I was just wondering whether inner join elimination is working in postgres, so I put up a simple test case and compared it with an Oracle database (see output below). It doesn't look like this feature is implemented in postgres, or am I missig something? Are there any plans to implement it