[GENERAL] Migration to pglister - Before

2017-11-20 Thread Stephen Frost
Greetings, We will be migrating these lists to pglister in the next few minutes. This final email on the old list system is intended to let you know that future emails will have different headers and you will need to adjust your filters. The changes which we expect to be most significant to

Re: [GENERAL] Query Using Massive Temp Space

2017-11-20 Thread legrand legrand
Hi, there are many Hash and Merge joins that may generate a lot of temp space, it could also be a problem of forgotten column in the join. Could you also provide indexes definitions (pk, uk and others) with the EXPLAIN (ANALYZE BUFFERS) (you can limit the scope of the query to help it to finish

[GENERAL] Registering Event Log on Windows

2017-11-20 Thread Ronen Nofar
Hi Guys, I'm trying to register the event log on Windows ( Windows Server 2012 64-bit ) with the following command: regsvr32.exe C:\PostgreSQL\pg96\lib\postgresql\pgevent.dll and I'm recieving an error message: The modoule "C:\PostgreSQL\pg96\lib\postgesql\pgevent.dll" was loaded but the entry

Re: [GENERAL] Query Using Massive Temp Space

2017-11-20 Thread Semler Miloslav
Hello, I have one question… Why you using so huge amount of grouping columns? Is there some reason for it? It is not definitelly fast method. I would prefer firstly do named query grouped by ids (account_id, candidate_id, parent_id) and then left join table candidates (to get rest of requested

Re: [GENERAL] unnest-like pg_stats.most_common_values and pg_stats.most_common_freqs

2017-11-20 Thread Luca Ferrari
On Fri, Nov 17, 2017 at 9:41 PM, Justin Pryzby wrote: > I think you want something like this ? > > postgres=# SELECT schemaname, tablename, attname, > unnest(histogram_bounds::text::text[]), histogram_bounds FROM pg_stats LIMIT > 9; > pg_catalog | pg_pltemplate | tmplname

Re: [GENERAL] Query Using Massive Temp Space

2017-11-19 Thread Laurenz Albe
Cory Tucker wrote: > I have a query that is using a tremendous amount of temp disk space given the > overall size of the dataset. > I'd love for someone to try to explain what PG is doing and why its using so > much space for the query. It could be a sort or a hash operation. Do determine what

[GENERAL] Query Using Massive Temp Space

2017-11-19 Thread Cory Tucker
Hello, I have a query that is using a tremendous amount of temp disk space given the overall size of the dataset. I'd love for someone to try to explain what PG is doing and why its using so much space for the query. First off, the system is PG 9.6 on Ubuntu with 4 cores and 28 GB of RAM. The

Re: [GENERAL] How to store multiple rows in array .

2017-11-19 Thread Tom Lane
brahmesr writes: > SELECT ARRAY (SELECT ROW (COL1,COL2, COUNT(*) *AS txn_cnt* ):: > ap.validate_crtr_line_items$inv_lines_rt FROM Distinct_Records GROUP BY > COL1, COL2 HAVING COUNT(*) > 1) INTO L_INV_LINES; > ERROR: syntax error at or near "AS" > LINE 73: COL1,COL2,

Re: [GENERAL] How to store multiple rows in array .

2017-11-19 Thread brahmesr
I already defined the composite type as "validate_crtr_line_items$inv_lines_rt" with the selected columns(COL1,COL2,COl3) DeCLARE Block : INV_LINES_T validate_crtr_line_items$inv_lines_rt ARRAY; L_INV_LINES INV_LINES_T%TYPE; L_INV_LINES$temporary_record

Re: [GENERAL] parallel query in 9.6.6 + oracle_fdw -> ERROR: invalid cache ID: 41

2017-11-19 Thread Chris Mair
Hi, So I'd call this an oracle_fdw bug. It needs to postpone what it's doing here to the first normal FDW function call in a session. Thanks a lot for looking so quickly into this! I've opened an issue with oracle_fdw: https://github.com/laurenz/oracle_fdw/issues/215 Thanks, Chris. --

Re: [GENERAL] parallel query in 9.6.6 + oracle_fdw -> ERROR: invalid cache ID: 41

2017-11-19 Thread Tom Lane
Chris Mair writes: > Whenever a session has performed a query on a foreign table, any subsequent > query on a local table big enough to use the parallel query feature exits with > an error: > ERROR: invalid cache ID: 41 > CONTEXT: parallel worker Hm, syscache 41 is

Re: [GENERAL] How to store multiple rows in array .

2017-11-19 Thread Tom Lane
Pavel Stehule writes: > 2017-11-19 18:57 GMT+01:00 Brahmam Eswar : >> How to collect multiple columns into array which is composite data type of >> all select colums > SELECT ARRAY(SELECT ROW(col1, col2, ...) INTO You probably need an explicit

[GENERAL] parallel query in 9.6.6 + oracle_fdw -> ERROR: invalid cache ID: 41

2017-11-19 Thread Chris Mair
Hi! I've found a problem in either PostgreSQL 9.6.6 or oracle_fdw 2.0.0. Background: I was testing a setup on a current CentOS 7 system with PostgreSQL 9.6.6 installed from the PGDG repositories and oracle_fdw 2.0.0 installed via pgxn install. Everything went absolutely fine until I enabled

Re: [GENERAL] How to store multiple rows in array .

2017-11-19 Thread Pavel Stehule
2017-11-19 18:57 GMT+01:00 Brahmam Eswar : > Hi , > > System is migrating from Oracle to Postgre SQL. > Oracle is providing BULK COLLECT INTO function to collect the multiple > records from table . > > Select COL1,COL2 ,COL3 BULK COLLECT INTO LINES from Distinct_Records.

[GENERAL] How to store multiple rows in array .

2017-11-19 Thread Brahmam Eswar
Hi , System is migrating from Oracle to Postgre SQL. Oracle is providing BULK COLLECT INTO function to collect the multiple records from table . Select COL1,COL2 ,COL3 BULK COLLECT INTO LINES from Distinct_Records. LINES IS TABLE OF TABLE1 (Defined lines as IS TABLE OF type). In PotGres:

Re: [GENERAL] mild modification to pg_dump

2017-11-18 Thread Matt Zagrabelny
On Fri, Nov 17, 2017 at 3:58 PM, marcelo wrote: > Again: knowing of .pgpass (thank you Scott) this is what I will do. > > Just in case you might not know. The perms of the .pgpass file need to not have group or all write access. For instance: chmod 0600 .pgpass -m

[GENERAL] Changing the location of the default data directory on PG 9.6.6 (CentOS 7)?

2017-11-17 Thread Robert Gordon
I'm trying to identify which postgresql.conf file I should be editing, in order to change the default database files location for Postgres 9.6.6, when installed on CentOS 7.x/ Is the bet method for changing the default data directory at the time of database init, to include the $PGDATA

Re: [GENERAL] mild modification to pg_dump

2017-11-17 Thread Andres Freund
On 2017-11-17 18:56:45 -0300, marcelo wrote: > Truly, I'm catched in a very big app, so I have no time to read all > the docs. People on this list also have jobs. - Andres -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] mild modification to pg_dump

2017-11-17 Thread marcelo
Again: knowing of .pgpass (thank you Scott) this is what I will do. On 17/11/17 17:49, Ron Johnson wrote: On 11/17/2017 02:23 PM, John R Pierce wrote: On 11/17/2017 12:19 PM, marcelo wrote: Sorry, I was not exact. I don't need nor like to change pg_dump. Rather, based on pg_dump code, I need

Re: [GENERAL] mild modification to pg_dump

2017-11-17 Thread marcelo
Thank you, Scott. That's happening me because incomplete docs reading. Truly, I'm catched in a very big app, so I have no time to read all the docs. On 17/11/17 18:31, Scott Mead wrote: On Fri, Nov 17, 2017 at 4:06 PM, marcelo >

Re: [GENERAL] mild modification to pg_dump

2017-11-17 Thread Scott Mead
On Fri, Nov 17, 2017 at 4:06 PM, marcelo wrote: > I need to "emulate" the pg_dump code because the password prompt. Years > ago I write a program (for the QnX environment) that catched some prompt > and emulates the standard input. I don't like to do that again.

Re: [GENERAL] mild modification to pg_dump

2017-11-17 Thread Ron Johnson
What about the pgpass file? https://www.postgresql.org/docs/9.2/static/libpq-pgpass.html On 11/17/2017 03:06 PM, marcelo wrote: I need to "emulate" the pg_dump code because the password prompt. Years ago I write a program (for the QnX environment) that catched some prompt and emulates the

Re: [GENERAL] mild modification to pg_dump

2017-11-17 Thread marcelo
I will give expect a try. But the source code embedded in my daemon. On 17/11/17 17:49, Ron Johnson wrote: On 11/17/2017 02:23 PM, John R Pierce wrote: On 11/17/2017 12:19 PM, marcelo wrote: Sorry, I was not exact. I don't need nor like to change pg_dump. Rather, based on pg_dump code, I

Re: [GENERAL] mild modification to pg_dump

2017-11-17 Thread Vick Khera
pg_dump is a libpq client, and thus will read the environment for a variable with the password. no need to emulte any command prompt tty operations. On Fri, Nov 17, 2017 at 4:06 PM, marcelo wrote: > I need to "emulate" the pg_dump code because the password prompt.

Re: [GENERAL] mild modification to pg_dump

2017-11-17 Thread marcelo
I need to "emulate" the pg_dump code because the password prompt. Years ago I write a program (for the QnX environment) that catched some prompt and emulates the standard input. I don't like to do that again. On 17/11/17 17:23, John R Pierce wrote: On 11/17/2017 12:19 PM, marcelo wrote:

Re: [GENERAL] mild modification to pg_dump

2017-11-17 Thread Ron Johnson
On 11/17/2017 02:23 PM, John R Pierce wrote: On 11/17/2017 12:19 PM, marcelo wrote: Sorry, I was not exact. I don't need nor like to change pg_dump. Rather, based on pg_dump code, I need to develop a daemon which can receive a TCP message (from a privileged app) containing some elements: the

Re: [GENERAL] unnest-like pg_stats.most_common_values and pg_stats.most_common_freqs

2017-11-17 Thread Justin Pryzby
On Fri, Nov 17, 2017 at 09:32:23PM +0100, Luca Ferrari wrote: > Hi all, > maybe this is trivial, but I need an hint on a way to see a table form > of the MCVs and MCFs out of pg_stats with a query. Is it possible to > get a set of rows each with a most common value on one column and the >

[GENERAL] unnest-like pg_stats.most_common_values and pg_stats.most_common_freqs

2017-11-17 Thread Luca Ferrari
Hi all, maybe this is trivial, but I need an hint on a way to see a table form of the MCVs and MCFs out of pg_stats with a query. Is it possible to get a set of rows each with a most common value on one column and the corresponding column on the the other? (assuming I can cast the array of MCVs to

Re: [GENERAL] mild modification to pg_dump

2017-11-17 Thread John R Pierce
On 11/17/2017 12:19 PM, marcelo wrote: Sorry, I was not exact. I don't need nor like to change pg_dump. Rather, based on pg_dump code, I need to develop a daemon which can receive a TCP message (from a privileged app) containing some elements: the database to dump, the user under which do

Re: [GENERAL] mild modification to pg_dump

2017-11-17 Thread marcelo
Sorry, I was not exact. I don't need nor like to change pg_dump. Rather, based on pg_dump code, I need to develop a daemon which can receive a TCP message (from a privileged app) containing some elements: the database to dump, the user under which do that, and his password. (My apps are using

[GENERAL] explain analyze output with parallel workers - question about meaning of information for explain.depesz.com

2017-11-17 Thread hubert depesz lubaczewski
Hi, up to parallel executions, when we had node in explain analyze showing "loops=x" with x more than 1, it meant that the "actual time" had to be multiplied by loops to get real time spent in a node. For example, check step 13 in https://explain.depesz.com/s/gNBd It shows time of 3ms, but

Re: [GENERAL] mild modification to pg_dump

2017-11-17 Thread Scott Mead
On Fri, Nov 17, 2017 at 7:51 AM, marcelo wrote: > I would need to do a mild change to pg_dump, working against a 9.4 server > on linux. > Which source tree do I need? Have gcc 4.9.2 in my Lubuntu installation. > TIA What exactly do you need to change? Most likely,

[GENERAL] mild modification to pg_dump

2017-11-17 Thread marcelo
I would need to do a mild change to pg_dump, working against a 9.4 server on linux. Which source tree do I need? Have gcc 4.9.2 in my Lubuntu installation. TIA -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] postmaster deadlock while logging after syslogger exited

2017-11-16 Thread Tom Lane
Andres Freund writes: > It doesn't seem impossible to get into a situation where syslogger is > the source of the OOM. Just enabling a lot of logging in a workload with > many large query strings might do it. So making it less likely to be > killed might make the problem

Re: [GENERAL] postmaster deadlock while logging after syslogger exited

2017-11-16 Thread Andres Freund
On November 16, 2017 7:06:23 PM PST, Tom Lane wrote: >Andres Freund writes: >> On 2017-11-16 21:39:49 -0500, Tom Lane wrote: >>> What might be worth thinking about is allowing the syslogger process >to >>> inherit the postmaster's OOM-kill-proofness

Re: [GENERAL] postmaster deadlock while logging after syslogger exited

2017-11-16 Thread Tom Lane
Andres Freund writes: > On 2017-11-16 21:39:49 -0500, Tom Lane wrote: >> What might be worth thinking about is allowing the syslogger process to >> inherit the postmaster's OOM-kill-proofness setting, instead of dropping >> down to the same vulnerability as the postmaster's

Re: [GENERAL] postmaster deadlock while logging after syslogger exited

2017-11-16 Thread Andres Freund
On 2017-11-16 21:39:49 -0500, Tom Lane wrote: > > We could work around a situation like that if we made postmaster use a > > *different* pipe as stderr than the one we're handing to normal > > backends. If postmaster created a new pipe and closed the read end > > whenever forking a syslogger, we

Re: [GENERAL] postmaster deadlock while logging after syslogger exited

2017-11-16 Thread Tom Lane
Andres Freund writes: > On 2017-11-06 15:35:03 -0500, Tom Lane wrote: >> David Pacheco writes: >>> I ran into what appears to be a deadlock in the logging subsystem. It >>> looks like what happened was that the syslogger process exited because it >>> ran out

Re: [GENERAL] postmaster deadlock while logging after syslogger exited

2017-11-16 Thread Michael Paquier
On Fri, Nov 17, 2017 at 11:14 AM, Andres Freund wrote: > On 2017-11-17 11:09:56 +0900, Michael Paquier wrote: >> when redirection_done is switched to true because the first process >> generating a message to the syslogger pipe needs to open it first if >> not done yet? > > I

Re: [GENERAL] postmaster deadlock while logging after syslogger exited

2017-11-16 Thread Andres Freund
On 2017-11-17 11:09:56 +0900, Michael Paquier wrote: > On Fri, Nov 17, 2017 at 10:50 AM, Andres Freund wrote: > > On 2017-11-06 15:35:03 -0500, Tom Lane wrote: > >> David Pacheco writes: > >> > I ran into what appears to be a deadlock in the logging

Re: [GENERAL] postmaster deadlock while logging after syslogger exited

2017-11-16 Thread Michael Paquier
On Fri, Nov 17, 2017 at 10:50 AM, Andres Freund wrote: > On 2017-11-06 15:35:03 -0500, Tom Lane wrote: >> David Pacheco writes: >> > I ran into what appears to be a deadlock in the logging subsystem. It >> > looks like what happened was that the syslogger

Re: [GENERAL] postmaster deadlock while logging after syslogger exited

2017-11-16 Thread Andres Freund
On 2017-11-06 15:35:03 -0500, Tom Lane wrote: > David Pacheco writes: > > I ran into what appears to be a deadlock in the logging subsystem. It > > looks like what happened was that the syslogger process exited because it > > ran out of memory. But before the postmaster got a

Re: [GENERAL] postmaster deadlock while logging after syslogger exited

2017-11-16 Thread David Pacheco
On Mon, Nov 6, 2017 at 12:35 PM, Tom Lane wrote: > David Pacheco writes: > > I ran into what appears to be a deadlock in the logging subsystem. It > > looks like what happened was that the syslogger process exited because it > > ran out of memory. But

Re: [GENERAL] pg_restore load data

2017-11-16 Thread Ron Johnson
On 11/16/2017 03:13 PM, bricklen wrote: On Thu, Nov 16, 2017 at 1:07 PM, Ron Johnson > wrote: v9.2.7  (Yes, I know, it's old.  Nothing I can do about it.) During a "whole database" restore using pg_restore of a custom dump,

Re: [GENERAL] pg_restore load data

2017-11-16 Thread melvin6925
The command is COPY, not load. Sent via the Samsung Galaxy S® 6, an AT 4G LTE smartphone Original message From: Ron Johnson Date: 11/16/17 16:07 (GMT-05:00) To: pgsql-general@postgresql.org Subject: [GENERAL] pg_restore load data Hi, v9.2.7  (Yes, I

Re: [GENERAL] pg_restore load data

2017-11-16 Thread bricklen
On Thu, Nov 16, 2017 at 1:07 PM, Ron Johnson wrote: > v9.2.7 (Yes, I know, it's old. Nothing I can do about it.) > > During a "whole database" restore using pg_restore of a custom dump, when > is the data actually loaded? I've looked in the list output and don't see >

[GENERAL] pg_restore load data

2017-11-16 Thread Ron Johnson
Hi, v9.2.7  (Yes, I know, it's old.  Nothing I can do about it.) During a "whole database" restore using pg_restore of a custom dump, when is the data actually loaded?  I've looked in the list output and don't see any "load" statements. Thanks -- World Peace Through Nuclear Pacification

Re: [GENERAL] expanded auto and header linestyle double

2017-11-16 Thread Pavel Stehule
2017-11-16 21:16 GMT+01:00 Matt Zagrabelny : > Thanks for the reply, Pavel! > > On Thu, Nov 16, 2017 at 1:01 AM, Pavel Stehule > wrote: > >> Hi >> >> 2017-11-15 23:37 GMT+01:00 Matt Zagrabelny : >> >>> Greetings, >>> >>> Using PG

Re: [GENERAL] expanded auto and header linestyle double

2017-11-16 Thread Matt Zagrabelny
Thanks for the reply, Pavel! On Thu, Nov 16, 2017 at 1:01 AM, Pavel Stehule wrote: > Hi > > 2017-11-15 23:37 GMT+01:00 Matt Zagrabelny : > >> Greetings, >> >> Using PG 10.1. >> >> In my .psqlrc I have: >> >> \x auto >> \pset linestyle 'unicode' >>

Re: [GENERAL] Build in function to verify email addresses

2017-11-16 Thread Michael Nolan
On Thu, Nov 16, 2017 at 1:56 AM, Nick Dro wrote: > I beleieve that every information system has the needs to send emails. > Currently PostgreSQL doesn't have a function which gets TEXT and return > true if it's valid email address (x...@yyy.com / .co.ZZ) > Do you believe

Re: [GENERAL] Build in function to verify email addresses

2017-11-16 Thread Andreas Joseph Krogh
På torsdag 16. november 2017 kl. 09:05:00, skrev Pavel Stehule < pavel.steh...@gmail.com >: Hi   2017-11-16 8:56 GMT+01:00 Nick Dro >: I beleieve that every information system has the needs to send emails.

Re: [GENERAL] Build in function to verify email addresses

2017-11-16 Thread bto...@computer.org
- Original Message - From: "Nick Dro" To: pgsql-general@postgresql.org Sent: Thursday, November 16, 2017 2:56:42 AM Subject: [GENERAL] Build in function to verify email addresses I beleieve that every information system has the needs to send emails.

Re: [GENERAL] Build in function to verify email addresses

2017-11-16 Thread Chris Withers
I'm pretty sure this isn't as simple as you think it is, I'd suggest having a good read of: https://stackoverflow.com/a/201378/216229 Chris On 16/11/2017 07:56, Nick Dro wrote: I beleieve that every information system has the needs to send emails. Currently PostgreSQL doesn't have a

Re: [GENERAL] Build in function to verify email addresses

2017-11-16 Thread Pavel Stehule
Hi 2017-11-16 8:56 GMT+01:00 Nick Dro : > I beleieve that every information system has the needs to send emails. > Currently PostgreSQL doesn't have a function which gets TEXT and return > true if it's valid email address (x...@yyy.com / .co.ZZ) > Do you believe such

[GENERAL] Build in function to verify email addresses

2017-11-15 Thread Nick Dro
I beleieve that every information system has the needs to send emails. Currently PostgreSQL doesn't have a function which gets TEXT and return true if it's valid email address (x...@yyy.com / .co.ZZ) Do you believe such function should exist in PostgreSQL or it's best to let every user to

Re: [GENERAL] expanded auto and header linestyle double

2017-11-15 Thread Pavel Stehule
Hi 2017-11-15 23:37 GMT+01:00 Matt Zagrabelny : > Greetings, > > Using PG 10.1. > > In my .psqlrc I have: > > \x auto > \pset linestyle 'unicode' > \pset unicode_header_linestyle double > > and when the output is expanded, I do not see a double line for the first > record,

Re: [GENERAL] pg_basebackup running from a remote machine

2017-11-15 Thread Jeff Janes
On Tue, Nov 14, 2017 at 8:28 AM, Laurenz Albe wrote: > rakeshkumar464 wrote: > > If pg_basebackup is run from a remote machine with compress option > --gzip , > > compress level 9, > > will the compression occur prior to the data being sent on the network or > > after

Re: [GENERAL] Setting up replication slave on remote high latency host

2017-11-15 Thread Rory Falloon
Thank you for that. Back to the drawing board! On Wed, Nov 15, 2017 at 9:30 PM, John R Pierce wrote: > On 11/15/2017 6:02 PM, Rory Falloon wrote: > >> >> Right now I am trying to dump the database, gzip, move across, and import >> into the new slave (which is configured as

Re: [GENERAL] Setting up replication slave on remote high latency host

2017-11-15 Thread John R Pierce
On 11/15/2017 6:02 PM, Rory Falloon wrote: Right now I am trying to dump the database, gzip, move across, and import into the new slave (which is configured as a master to perform the initial setup). Ideally I do this dump, move and import during a period of inactivity on the master so the

[GENERAL] Setting up replication slave on remote high latency host

2017-11-15 Thread Rory Falloon
Hi, Thoughts and opinions on this please - I have a db (data dir is 90gb) that I am trying to setup on a replication slave. The slave is on a host which maintains latency over 300ms at all times (wan link). Other times I have done this setup, I have simply rsync'ed the data dir to another host,

Re: [GENERAL] PGPool in Master-Master mode, is it possible?

2017-11-15 Thread Tatsuo Ishii
I am not familiar with swarm cluster nor repmgr. So I wonder why you wouldn't be able to get to the goal you are trying to achieve without repmgr. Can you please elaborate more? Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php

[GENERAL] expanded auto and header linestyle double

2017-11-15 Thread Matt Zagrabelny
Greetings, Using PG 10.1. In my .psqlrc I have: \x auto \pset linestyle 'unicode' \pset unicode_header_linestyle double and when the output is expanded, I do not see a double line for the first record, but I do for all subsequent records. For example: % select * from artist; ─[ RECORD 1

Re: [GENERAL] problem changing jsonb attribute to null value

2017-11-15 Thread Dmitry Dolgov
> On 15 November 2017 at 22:54, RODRIGUEZ CORTES MARIO IGNACIO < ignacio.cor...@inegi.org.mx> wrote: > > I have a problem with a record in a jsonb type table, I'm trying to > change the value of an attribute to null but it leaves me all the > content in null and not just the value > > prueba=#

[GENERAL] problem changing jsonb attribute to null value

2017-11-15 Thread RODRIGUEZ CORTES MARIO IGNACIO
Hello: I have a problem with a record in a jsonb type table, I'm trying to change the value of an attribute to null but it leaves me all the content in null and not just the value, I show you an example first of how to define the null attribute: prueba=# select jsonb_build_object('v', null);  

Re: [GENERAL] pg_basebackup running from a remote machine

2017-11-15 Thread rakeshkumar464
Does pg_basebackup on a remote machine follow the standard libpq protocol. I am not able to force it to use ssl, despite having an entry in pg_hba.conf: hostnossl all all all reject >From the same remote machine, psql is forced to use ssl. Makes me wonder whether pg_basebackup has a different

Re: [GENERAL] Query on pg_settings view

2017-11-15 Thread Stephen Frost
Greetings, * Laurenz Albe (laurenz.a...@cybertec.at) wrote: > Ronen Nofar wrote: > > I have a weird case when running a query on the pg_settings view. > > I have two users, first one is the default user - postgres which is a > > superuser > > and another one is a role which i had created, i

Re: [GENERAL] Query on pg_settings view

2017-11-15 Thread Laurenz Albe
Ronen Nofar wrote: > I have a weird case when running a query on the pg_settings view. > I have two users, first one is the default user - postgres which is a > superuser > and another one is a role which i had created, i called it test_role and it's > not a superuser. > When I run a select on

Re: [GENERAL] PGPool in Master-Master mode, is it possible?

2017-11-15 Thread Vikas Sharma
Thank you Tatsuo for the Reply, I will post this in list you mentioned. By Master-Master, I meant two pgpool servers both active accepting connections from Application, If one Pgpool Server becomes unlavailable other still accepting connections. At an Ideal time, both Pgpool instances on each

[GENERAL] Query on pg_settings view

2017-11-15 Thread Ronen Nofar
Hi, I have a weird case when running a query on the pg_settings view. I have two users, first one is the default user - postgres which is a superuser and another one is a role which i had created, i called it test_role and it's not a superuser. When I run a select on pg_settings with these two

Re: [GENERAL] archive_command not being executed

2017-11-14 Thread Eric D
Hi Jeremy, Thanks for the info on 9.3 vs 9.5. While searching for Paul's suggestion I'd seen the same thing, but didn't "reply all" so my response didn't make it into the mailing list. Regarding your question, as I understand the process, you need to get the WAL files being shipped over to

Re: [GENERAL] jsonb

2017-11-14 Thread John R Pierce
On 11/14/2017 2:30 PM, hmidi slim wrote: I'm trying to use the function to_jsonb and create the name: to_jsonb ('{"key1":" ' || 'text1' || '","key2":" ' || 'text2' || '"}'); But after that I used Objection.js ORM to get data using the query: Product.query().where('id',1).then(prod =>

Re: [GENERAL] jsonb

2017-11-14 Thread Johannes Graën
On 11/14/2017 11:30 PM, hmidi slim wrote: > I'm trying to use the function to_jsonb and create the name: > to_jsonb ('{"key1":" ' || 'text1' || '","key2":" ' || 'text2' || '"}'); This query converts a string into a JSON object that consist of that string. I guess what you intend to accomplish is

Re: [GENERAL] jsonb

2017-11-14 Thread Merlin Moncure
On Tue, Nov 14, 2017 at 4:30 PM, hmidi slim wrote: > I'm trying to use the function to_jsonb and create the name: > to_jsonb ('{"key1":" ' || 'text1' || '","key2":" ' || 'text2' || '"}'); > But after that I used Objection.js ORM to get data using the query: >

Re: [GENERAL] PGPool in Master-Master mode, is it possible?

2017-11-14 Thread Tatsuo Ishii
> Hello There, > > I need to setup two PGPool Servers in Master-Master mode, First thing I > want to know, is it possible? > > I know we can setup 2 PGPool servers in master-slave mode using watchdog. > http://www.pgpool.net/pgpool-web/contrib_docs/watchdog_master_slave_3.3/en.html > > Could

Re: [GENERAL] jsonb

2017-11-14 Thread hmidi slim
I'm trying to use the function to_jsonb and create the name: to_jsonb ('{"key1":" ' || 'text1' || '","key2":" ' || 'text2' || '"}'); But after that I used Objection.js ORM to get data using the query: Product.query().where('id',1).then(prod => {console.log(prod)}) I think that the problem maybe

Re: [GENERAL] jsonb

2017-11-14 Thread Merlin Moncure
On Tue, Nov 14, 2017 at 3:32 PM, hmidi slim wrote: > I have a column name of type 'jsonb' on my table named product. The format > of the column: > name: {"key1": "text1", "key2": "text2"} > > When I make a query to fetch data from the table I got this format: > name:

[GENERAL] jsonb

2017-11-14 Thread hmidi slim
I have a column name of type 'jsonb' on my table named product. The format of the column: name: {"key1": "text1", "key2": "text2"} When I make a query to fetch data from the table I got this format: name: '{"key1": "text1", "key2": "text2"}' Why does postgresql returns the name such as string

Re: [GENERAL] missing public on schema public

2017-11-14 Thread Stephen Frost
Tom, all, * Tom Lane (t...@sss.pgh.pa.us) wrote: > =?iso-8859-1?Q?Bo_Thorbj=F8rn_Jensen?= writes: > > I have some additional info and a fix. > > Firstly steps to reproduce: > > Yeah, I can reproduce this. I suspect it got broken by Stephen's hacking > around with default

Re: [GENERAL] pg 10 crashes on int8_avg_combine

2017-11-14 Thread Dingyuan Wang
ok, I just avoided it using sum(cnt::int) since cnt is small. 2017-11-15 00:25, Tom Lane: > Dingyuan Wang writes: >> PostgreSQL 10.0 on x86_64-pc-linux-gnu, compiled by gcc (Debian 7.2.0-8) >> 7.2.0, 64-bit >> >> (gdb) bt >> #0 int8_avg_combine (fcinfo=0x55bdb92472d8) at >>

Re: [GENERAL] pg_basebackup running from a remote machine

2017-11-14 Thread Laurenz Albe
rakeshkumar464 wrote: > If pg_basebackup is run from a remote machine with compress option --gzip , > compress level 9, > will the compression occur prior to the data being sent on the network or > after it has been received > at the remote machine. That only means that the output TAR file will

Re: [GENERAL] pg 10 crashes on int8_avg_combine

2017-11-14 Thread Tom Lane
Dingyuan Wang writes: > PostgreSQL 10.0 on x86_64-pc-linux-gnu, compiled by gcc (Debian 7.2.0-8) > 7.2.0, 64-bit > > (gdb) bt > #0 int8_avg_combine (fcinfo=0x55bdb92472d8) at > ./build/../src/backend/utils/adt/numeric.c:4285 I think this is the same issue being discussed at

[GENERAL] PGPool in Master-Master mode, is it possible?

2017-11-14 Thread Vikas Sharma
Hello There, I need to setup two PGPool Servers in Master-Master mode, First thing I want to know, is it possible? I know we can setup 2 PGPool servers in master-slave mode using watchdog. http://www.pgpool.net/pgpool-web/contrib_docs/watchdog_master_slave_3.3/en.html Could anyone please

[GENERAL] pg 10 crashes on int8_avg_combine

2017-11-14 Thread Dingyuan Wang
Hi, PostgreSQL constantly crashes on this query: select dategrid, category, sum(cnt) from v_crime_grid group by dategrid, category; Where v_crime_grid is a materialized view, have columns "dategrid" int4, "category" int4, and "cnt" int8. Version is: PostgreSQL 10.0 on x86_64-pc-linux-gnu,

[GENERAL] pg_basebackup running from a remote machine

2017-11-14 Thread rakeshkumar464
If pg_basebackup is run from a remote machine with compress option --gzip , compress level 9, will the compression occur prior to the data being sent on the network or after it has been received at the remote machine. -- Sent from:

Re: [GENERAL] missing public on schema public

2017-11-14 Thread Tom Lane
=?iso-8859-1?Q?Bo_Thorbj=F8rn_Jensen?= writes: > I have some additional info and a fix. > Firstly steps to reproduce: Yeah, I can reproduce this. I suspect it got broken by Stephen's hacking around with default ACLs. A simple example is $ pg_dump -c -U postgres postgres |

Re: [GENERAL] Retrieve the server's time zone

2017-11-14 Thread Thomas Kellerer
Tom Lane schrieb am 14.11.2017 um 15:36: >> is there any way (short of writing a function in an untrusted PL) >> to determine the actual time zone (or time) of the server OS? > > AFAIK that would only be true if some part of your client stack > is issuing a SET TIMEZONE command. (libpq will do

Re: [GENERAL] Retrieve the server's time zone

2017-11-14 Thread Tom Lane
Thomas Kellerer writes: > is there any way (short of writing a function in an untrusted PL) to > determine the actual time zone (or time) of the server OS? The default value of the timezone parameter is as close as you'll get in modern versions of PG. > "show timezone"

[GENERAL] Re: PostgreSQL walsender process doesn't exist after "pg_ctl stop -m fast"

2017-11-14 Thread y39chen
Thank you for the explanation. We shall try the latest PostgreSQL 9.6.6 version. -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] Because PostgreSQL is compiling in old versions of OS?

2017-11-14 Thread Jose Maria Terry Jimenez
El 11/11/17 a las 0:48, DrakoRod escribió: Oh!! Jose Maria TJ wrote You're wrong, that are gcc versions, not OS versions. For example in my CentOS 6 Box cat /etc/redhat-release CentOS release 6.9 (Final) gcc -v [...trimmed...] gcc versión 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) You're

Re: [GENERAL] missing public on schema public

2017-11-14 Thread Bo Thorbjørn Jensen
I have some additional info and a fix. Firstly steps to reproduce: 1. create database: CREATE DATABASE test WITH ENCODING='UTF8' OWNER=postgres CONNECTION LIMIT=-1; -- here public has access to public 2. dump: pg_dump -f testfile.dump -F c -h localhost -U postgres test 3. restore: pg_restore

[GENERAL] Connection loosing at some places - caused by firewall

2017-11-14 Thread Durumdara
Dear Members! Windows 10, PGSQL 9.4 and 9.6 (Debian with SSL, and Windows without it - it doesn't matter). When I (or my boss) work(s) at home, I got connection lost errors from PGAdmin (3/4) or from other applications too. server closed the connection unexpectedly This probably means the

[GENERAL] Retrieve the server's time zone

2017-11-14 Thread Thomas Kellerer
Hello, is there any way (short of writing a function in an untrusted PL) to determine the actual time zone (or time) of the server OS? "show timezone" always returns the client's time zone. localtimestamp also converts the server's time to the client time zone (the one defined by

Re: [GENERAL] archive_command not being executed

2017-11-13 Thread Eric D
I'd come to the same conclusion Jeremy had about 9.5 being the first version with the 'always' option for archive_mode. Looking at pg_receivexlog, that might work, but with me being a total noob I'm wary of the various steps I'd have to take in going from: Master -> streaming replication to

Re: [GENERAL] PostgreSQL walsender process doesn't exist after "pg_ctl stop -m fast"

2017-11-13 Thread Michael Paquier
On Tue, Nov 14, 2017 at 12:05 AM, Tom Lane wrote: > y39chen writes: >> We encounter one problem that PostgreSQL walsender process doesn't exist >> after "pg_ctl stop -m fast". >> Uses PostgreSQL 9.6.2 > > There was a fix in 9.6.4 that's at least

Re: [GENERAL] archive_command not being executed

2017-11-13 Thread Michael Paquier
On Tue, Nov 14, 2017 at 8:56 AM, Jeremy Schneider wrote: > From my reading of the docs and commit logs, standby databases > couldn't archive their WALs until 9.5. pg_receivexlog is available in 9.3. You could leverage your archives with it easily, by for example

Re: [GENERAL] archive_command not being executed

2017-11-13 Thread Jeremy Schneider
Hi Eric, Thanks for using PostgreSQL! On Fri, Nov 10, 2017 at 9:26 AM, Paul Jungwirth wrote: > Oh this has happened to me before. :-) On SB1 you need to set > archive_mode to always (not on). Otherwise it is ignored when running as a > standby. It looks to me

Re: [GENERAL] PG-10 + ICU and abbreviated keys

2017-11-13 Thread Andreas Joseph Krogh
På tirsdag 14. november 2017 kl. 00:44:11, skrev Peter Geoghegan >: On Mon, Nov 13, 2017 at 2:05 PM, Andreas Joseph Krogh wrote: > When sorting on text, we're usually doing so using an multi-column index, like for instance "CREATE INDEX

Re: [GENERAL] PG-10 + ICU and abbreviated keys

2017-11-13 Thread Peter Geoghegan
On Mon, Nov 13, 2017 at 2:05 PM, Andreas Joseph Krogh wrote: > When sorting on text, we're usually doing so using an multi-column index, > like for instance "CREATE INDEX xxx ON my_table (lower(name) ASC, created > ASC)". Will abbreviated keys help here? Yes, they'll help

[GENERAL] "Cascading Logical Replication" from a physical replica

2017-11-13 Thread Hannes Erven
Hi, as of PG10, it is not possible to create logical replication slots on standby servers. Should that fact probably be mentioned more explicitly in https://www.postgresql.org/docs/10/static/logical-replication.html ? There seems to be work by Craig Ringer going on, but that doesn't seem

Re: [GENERAL] PG-10 + ICU and abbreviated keys

2017-11-13 Thread Andreas Joseph Krogh
På mandag 13. november 2017 kl. 22:28:40, skrev Peter Geoghegan >: On Mon, Nov 13, 2017 at 12:48 PM, Andreas Joseph Krogh wrote: > Thanks. As the person that worked on abbreviated keys, I'd like to hear about how you get with this. How

  1   2   3   4   5   6   7   8   9   10   >