Re: Code of Conduct plan

2018-09-19 Thread Chris Travers
On Thu, Sep 20, 2018 at 5:11 AM Craig Ringer  wrote:

> On Fri, 14 Sep 2018 at 23:11, James Keener  wrote:
>
>> And if you believe strongly that a given statement you may have made is
>>> not objectionable...you should be willing to defend it in an adjudication
>>> investigation.
>>
>>
>> So because someone doesn't like what I say in a venue 100% separate from
>> postgres,  I have to subject myself, and waste my time, defending actions
>> in this (and potentially other groups who would also adopt overly broad
>> CoC) group.
>>
>
> (Usual disclaimer, I speak for myself not my employer here):
>
> My understanding is that that's really only a concern for "Big Stuff".
>
> If we have a committer who loudly and proudly goes to neo-nazi rallies or
> pickup artist / pro-rape meetups, then actually yes, I have a problem with
> that. That impacts my ability to work in the community, impacts everyone's
> ability to recruit people to work on Postgres, potentially makes people
> reluctant to engage with the community, etc.
>

There's a problem here though. Generally in Europe, one would not be able
to fire a person or even discriminate against him for such activity.  So if
you kick someone out of the PostgreSQL community for doing such things in,
say, Germany but their employer cannot fire them for the same, then you
have a real problem if improving PostgreSQL is the basis of their
employment.EU antidiscrimination law includes political views and other
opinions so internationally that line is actually very hard to push in an
international project.  So I think you'd have a problem where such
enforcement might actually lead to legal action by the employer, or the
individual kicked out, or both.

If one of my reports were to come out in favor of the holocaust or Stalin's
purges, etc. I would not be allowed to use that as grounds to fire that
employee, even in Germany.  Now, if they communicated such aggressively at
work, I might.

This also highlights the problem of trying to enforce norms across global
projects.  My view simply is that we cannot.  There are probably some rare
cases even more extreme than this where enforcement globally might not be a
problem.

The goal of a code of conduct is to protect the community and this is
actually a hard problem which gets substantially harder as more cultures
and legal jurisdictions are included.  However there is also a topic of
global fairness.  Would we tolerate treating someone in, say, the US who
attended Neo-Nazi rallies worse than someone who attended right-wing
rallies in Europe?

So I think one has to go with least common denominator in these areas and
this is also why this really isn't that much of a problem.  The CoC really
cannot be enforced in the way which a lot of people fear without serious
consequences for the community and so I trust it won't.


>
> Thankfully we don't.
>

Agreed on that.

>
> I'm not sure how to codify it more clearly, though, and to a large degree
> I think it's a case of presuming good intent and good will amongst all
> parties.
>

At the end, human judgment has to rule.


>
> It's clear that if the CoC leans too far, there'll certainly be no
> shortage of proud defenders of liberty and free speech coming out of the
> woodwork, right? (But remember, freedom of speech doesn't mean freedom from
> consequences, even in nations that codify the concept of freedom of speech
> at all. You shouldn't face Government sanction for it, but your peers can
> still ostracise you, you can still get fired, etc.)
>

One of the standard European values is freedom of political opinion and the
idea that there must be no economic consequences of merely having unpopular
political opinions.  However there may be time/manner/place restrictions on
expressing those.

For example, Mozilla Corporation could ask Brendan Eich to leave because
they are an American corporation and this is solely about the American
leadership.  Therefore they don't have to deal with European laws.  I don't
think the same applies to us and certainly if they were to fire a developer
in Germany for more more abrasive political communications via facebook
etc. they would have a lawsuit on their hands.

The freedom to a) hold political ideas without consequence, and b)
communicate them civilly without consequence is something that I find many
people the US (and I assume Australia) find strange,


>
> One of the biggest drivers of plea-bargains for innocent people in the US
>> justice system is the expense of having to defend yourself. I find that to
>> be a travesty; why are we duplicating that at a smaller level?
>>
>
> Because the fact that it is at a smaller level makes it way less of a
> concern. No expensive lawyers. More likely we waste a lot of hot air. Like
> this mail, probably.
>
> There are intangible but very real (IMO) costs to being a community that
> welcomes an unhealthy and hostile communication style, harassment and
> personal attacks in the guise of technical argument, 

Re: Code of Conduct plan

2018-09-19 Thread Craig Ringer
On Fri, 14 Sep 2018 at 23:11, James Keener  wrote:

> And if you believe strongly that a given statement you may have made is
>> not objectionable...you should be willing to defend it in an adjudication
>> investigation.
>
>
> So because someone doesn't like what I say in a venue 100% separate from
> postgres,  I have to subject myself, and waste my time, defending actions
> in this (and potentially other groups who would also adopt overly broad
> CoC) group.
>

(Usual disclaimer, I speak for myself not my employer here):

My understanding is that that's really only a concern for "Big Stuff".

If we have a committer who loudly and proudly goes to neo-nazi rallies or
pickup artist / pro-rape meetups, then actually yes, I have a problem with
that. That impacts my ability to work in the community, impacts everyone's
ability to recruit people to work on Postgres, potentially makes people
reluctant to engage with the community, etc.

Thankfully we don't.

I'm not sure how to codify it more clearly, though, and to a large degree I
think it's a case of presuming good intent and good will amongst all
parties.

It's clear that if the CoC leans too far, there'll certainly be no shortage
of proud defenders of liberty and free speech coming out of the woodwork,
right? (But remember, freedom of speech doesn't mean freedom from
consequences, even in nations that codify the concept of freedom of speech
at all. You shouldn't face Government sanction for it, but your peers can
still ostracise you, you can still get fired, etc.)

One of the biggest drivers of plea-bargains for innocent people in the US
> justice system is the expense of having to defend yourself. I find that to
> be a travesty; why are we duplicating that at a smaller level?
>

Because the fact that it is at a smaller level makes it way less of a
concern. No expensive lawyers. More likely we waste a lot of hot air. Like
this mail, probably.

There are intangible but very real (IMO) costs to being a community that
welcomes an unhealthy and hostile communication style, harassment and
personal attacks in the guise of technical argument, bullying defended as
making sure you have the right stuff to survive in a "meritocracy", etc.
Thankfully we are generally not such a community. But try asking a few
women you know in the Postgres community - if you can find any! - how their
experience at conferences has been. Then ask if maybe there are still a few
things we could work on changing.

I've found it quite confronting dealing with some of the more heated
exchanges on hackers from some of our most prominent team members. I've
sent the occasional gentle note to ask someone to chill and pause before
replying, too. And I've deserved to receive one a couple of times, though I
never have, as I'm far from free from blame here.

People love to point to LKML as the way it "must" be done to succeed in
software. Yet slowly that community has also come to recognise that verbal
abuse under the cloak of technical discussion is harmful to quality
discussion and drives out good people, harming the community long term.
Sure, not everything has to be super-diplomatic, but there's no excuse for
verbal bullying and wilful use of verbal aggression either. As widely
publicised, even Linus has recently recognised aspects of this, despite
being the poster child of proponents of abusive leadership for decades.

We don't have a culture like that. So in practice, I don't imagine the CoC
will see much use. The real problematic stuff that happens in this
community happens in conference halls and occasionally by private mail,
usually in the face of a power imbalance that makes the recipient/victim
reluctant to speak out. I hope a formal CoC will give them some hope
they'll be heard if they do take the personal risk to speak up. I've seen
so much victim blaming in tech that I'm not convinced most people
experiencing problems will be willing to speak out anyway, but hopefully
they'll be more so with a private and receptive group to talk to.

Let me be clear here, I'm no fan of trial by rabid mob. That's part of why
something like the CoC and a backing body is important. Otherwise people
are often forced to silently endure, or go loudly public. The latter tends
to result in a big messy explosion that hurts the community, those saying
they're victim(s) and the alleged perpetrator(s), no matter what the facts
and outcomes. It also encourages people to jump on one comment and run way
too far with it, instead of looking at patterns and giving people chances
to fix their behaviour.

I don't want us to have this:
https://techcrunch.com/2013/03/21/a-dongle-joke-that-spiraled-way-out-of-control/
. Which is actually why I favour a CoC, one with a resolution process and
encouragement toward some common sense. Every player in that story was an
idiot, and while none deserved the abuse and harrassment that came their
way, it's a shame it wan't handled by a complaint to a conference CoC group
instead.

I'd 

Re: Replicate Tables from SAP (DB2/HANA) to PostgreSQL

2018-09-19 Thread bricklen
On Tue, Sep 18, 2018 at 11:31 PM Thomas Güttler <
guettl...@thomas-guettler.de> wrote:

> Hi,
>
> is it possible to replicate some tables from SAP to PostgreSQL?
> At the moment there are two underlaying database systems.
> Some run DB2 and some run SAP-HANA.
> In my case it would be nice, if it would be possible to replicate
> only some rows, not all.
>
> The replication should be unidirectional. The data in PostgreSQL
> is only needed for reading, not for inserts/updates.
>

My team is about to start a proof-of-concept doing the same thing, except
it's a large MSSQL to PG11 replication process. The tool we are evaluating
is from https://www.hvr-software.com/solutions/database-replication/, and
the demos looked pretty good (at least, for our use-case). You didn't
mention if you're looking for free or paid software; HVR is not free so
that may or may not fit your needs.


Re: Converting to number with given format

2018-09-19 Thread Ken Tanzer
On Wed, Sep 19, 2018 at 6:34 AM Gabriel Furstenheim Milerud <
furstenh...@gmail.com> wrote:

Maybe that is not possible with numbers? To say in a format something like
> "my numbers have comma as decimal separator and no thousands separators" or
> "my numbers are point separated and have comma as thousands separator"
>
>
Would stripping out the thousand separator, and leaving in the decimal
separator work?

SELECT replace('9,000.34',',','')::numeric;
 replace
-
 9000.34

If so, then (conceptually) does this work?

SELECT replace(

  replace(my_numeric_string, user_thousand_sep, ''),

  user_decimal_sep, system_decimal_sep

)::numeric


Or maybe I'm missing something about this!

Cheers,

Ken



-- 
AGENCY Software
A Free Software data system
By and for non-profits
*http://agency-software.org/ *
*https://demo.agency-software.org/client
*
ken.tan...@agency-software.org
(253) 245-3801

Subscribe to the mailing list
 to
learn more about AGENCY or
follow the discussion.


help with startup slave after pg_rewind

2018-09-19 Thread Dylan Luong

Hi
After promoting slave to master, I completed a pg_rewind of the slave (old 
master) to the new master. But when I try to start the slave I am getting the 
following error.

2018-09-20 07:53:51 ACST [20265]: [2-1] db=[unknown],user=replicant 
app=[unknown],host=10.69.20.22(51271) FATAL:  the database system is starting up
2018-09-20 07:53:51 ACST [20264]: [3-1] db=,user= app=,host= LOG:  restored log 
file "000C.history" from archive
2018-09-20 07:53:51 ACST [20264]: [4-1] db=,user= app=,host= LOG:  restored log 
file "000C085B" from archive
2018-09-20 07:53:51 ACST [20264]: [5-1] db=,user= app=,host= LOG:  contrecord 
is requested by 85B/28
2018-09-20 07:53:51 ACST [20268]: [1-1] db=,user= app=,host= LOG:  started 
streaming WAL from primary at 85B/0 on timeline 12
2018-09-20 07:53:51 ACST [20264]: [6-1] db=,user= app=,host= LOG:  contrecord 
is requested by 85B/28
2018-09-20 07:53:51 ACST [20268]: [2-1] db=,user= app=,host= FATAL:  
terminating walreceiver process due to administrator command
2018-09-20 07:53:51 ACST [20264]: [7-1] db=,user= app=,host= LOG:  restored log 
file "000C085B" from archive
2018-09-20 07:53:51 ACST [20264]: [8-1] db=,user= app=,host= LOG:  contrecord 
is requested by 85B/28
2018-09-20 07:53:51 ACST [20264]: [9-1] db=,user= app=,host= LOG:  contrecord 
is requested by 85B/28
2018-09-20 07:53:51 ACST [20264]: [10-1] db=,user= app=,host= LOG:  restored 
log file "000C085B" from archive
2018-09-20 07:53:51 ACST [20264]: [11-1] db=,user= app=,host= LOG:  contrecord 
is requested by 85B/28
2018-09-20 07:53:51 ACST [20264]: [12-1] db=,user= app=,host= LOG:  contrecord 
is requested by 85B/28


I tried to run pg_rewind again, but now it says I cannot do it as its already 
same timeline.

Regards
Dylan



Re: Converting to number with given format

2018-09-19 Thread Tim Cross


Gabriel Furstenheim Milerud  writes:

> Sorry,
> So basically what I'm trying to achieve is the following. There is an input
> file from the user and a configuration describing what is being inserted.
> For example, he might have Last activity which is '-MM-DD HH:mi:ss' and
> Join date which is only '-MM-DD' because there is no associated timing.
> For dates this works perfectly and it is possible to configure what the
> input from the user will be. Think it is as a dropdown where the user says,
> this is the kind of data that I have.
>
> Maybe that is not possible with numbers? To say in a format something like
> "my numbers have comma as decimal separator and no thousands separators" or
> "my numbers are point separated and have comma as thousands separator"
>
> Nice thing of having a string for the format is that I can use it as a
> parameter for a prepared statement.
>

I think this is normally something much better dealt with at the client
level. Things like comma separator/grouping in numbers is really just a
'human' thing and is very locale dependent. The values 9,999 and 
are the same values. Things can quickly become complicated as you can
have locale information at both the server and client end and they may
not be the same. 

As you should always be sanitising your data before inserting into the
database anyway, you may as well just add this as another check at the
client end.

Tim

-- 
Tim Cross



Re: how to know whether query data from memory after pg_prewarm

2018-09-19 Thread Thomas Munro
On Wed, Sep 19, 2018 at 7:44 PM Cédric Villemain  wrote:
> Le 19/09/2018 à 05:29, Thomas Munro a écrit :
> > On Wed, Sep 19, 2018 at 1:35 PM jimmy  wrote:
> >> I use select pg_prewarm('table1','read','main')  to load data of table1 
> >> into the memory.
> >> when I use select count(1) from table1 group by aa to query data.
> >> I find the speed of query is not fast, I wonder whether it query data from 
> >> memory.
> >> And it is slower than Oracle, both of Oracle and Postgresql has same table 
> >> and count of data.
> >> when pg_prewarm use 'read' mode,  the data is put into the OS cache, how 
> >> to examine the table which is pg_prewarmed into the OS cache .
> >> I know pg_buffercache ,but it just examine the table in the shared buffer 
> >> of Postgresql, not the table in the OS cache.
> >
> > This is a quick and dirty hack, but it might do what you want:
> >
> > https://github.com/macdice/pgdata_mincore
> >
> > Tested on FreeBSD, not sure how well it'll travel.
>
> You can use pgfincore extension for that purpose, and more.
>
> https://github.com/klando/pgfincore/blob/master/README.md

Yes, if you only want to know *how many* pages are in the OS page
cache.  pgdata_mincore shows you which PG blocks are in the page cache
in the same format as pg_buffercache, which is useful for studying
double buffering effects.  Maybe I should turn it into a patch for
pgfincore...

-- 
Thomas Munro
http://www.enterprisedb.com



Re: Code of Conduct

2018-09-19 Thread Bruce Momjian
On Wed, Sep 19, 2018 at 11:24:29AM +1000, Julian Paul wrote:
> It's overly long and convoluted.
> 
> "inclusivity" Is a ideologue buzzword of particular individuals that offer
> very little value apart from excessive policing of speech and behaviour
> assumed to be a problem where none exist.
> 
> "Personal attacks and negative comments on personal characteristics are
> unacceptable, and will not be permitted. Examples of personal
> characteristics include, but are not limited to age, race, national origin
> or ancestry, religion, gender, or sexual orientation."
> 
> So just leaving it at "Personal attacks" and ending it there won't do
> obviously. I'm a big advocate of people sorting out there own personal
> disputes in private but...
> 
> "further personal attacks (public or *private*);"
> 
> ...lets assume people don't have the maturity for that and make it all
> public.
> 
> "may be considered offensive by fellow members" - Purely subjective and
> irrelevant to a piece of community software.

You might notice that a bullet list was removed and those example items
were added 18 months ago:


https://wiki.postgresql.org/index.php?title=Code_of_Conduct=31924=29402

I realize that putting no examples has its attractions, but some felt
that having examples would be helpful.  I am not a big fan of the
"protected groups" concept because it is often exploited, which is why
they are listed more as examples.

-- 
  Bruce Momjian  http://momjian.us
  EnterpriseDB http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+  Ancient Roman grave inscription +



Re: Code of Conduct

2018-09-19 Thread Andrew Dunstan




On 09/19/2018 04:27 PM, Kevin Grittner wrote:

On Tue, Sep 18, 2018 at 5:28 AM Dave Page  wrote:

The PostgreSQL Core team are pleased to announce that following a long 
consultation process, the project’s Code of Conduct (CoC) has now been 
finalised and published at https://www.postgresql.org/about/policies/coc/.

Please take time to read and understand the CoC, which is intended to ensure 
that PostgreSQL remains an open and enjoyable project for anyone to join and 
participate in.

A Code of Conduct Committee has been formed to handle any complaints. This 
consists of the following volunteers:

- Stacey Haysler (Chair)
- Lætitia Avrot
- Vik Fearing
- Jonathan Katz
- Ilya Kosmodemiansky

We would like to extend our thanks and gratitude to Stacey Haysler for her 
patience and expertise in helping develop the Code of Conduct, forming the 
committee and guiding the work to completion.

My thanks to all who participated.



Indeed, many thanks.

[...]

In the meantime, I was very happy to see the so many new faces at
PostgresOpen SV 2018; maybe it's just a happy coincidence, but if this
effort had anything to do with drawing in more people, it was well
worth the effort!




Yeah. The crowd also seemed noticeably more diverse than I have usually 
seen at Postgres conferences. That's a small beginning, but it's a 
welcome development.


cheers

andrew


--
Andrew Dunstanhttps://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




Re: Code of Conduct

2018-09-19 Thread Kevin Grittner
On Tue, Sep 18, 2018 at 5:28 AM Dave Page  wrote:
>
> The PostgreSQL Core team are pleased to announce that following a long 
> consultation process, the project’s Code of Conduct (CoC) has now been 
> finalised and published at https://www.postgresql.org/about/policies/coc/.
>
> Please take time to read and understand the CoC, which is intended to ensure 
> that PostgreSQL remains an open and enjoyable project for anyone to join and 
> participate in.
>
> A Code of Conduct Committee has been formed to handle any complaints. This 
> consists of the following volunteers:
>
> - Stacey Haysler (Chair)
> - Lætitia Avrot
> - Vik Fearing
> - Jonathan Katz
> - Ilya Kosmodemiansky
>
> We would like to extend our thanks and gratitude to Stacey Haysler for her 
> patience and expertise in helping develop the Code of Conduct, forming the 
> committee and guiding the work to completion.

My thanks to all who participated.

FWIW, my view is that a CoC shares one very important characteristic
with coding style guides: it's not as important what the details are
as that you have one and everyone pays attention to it.  I was in an
early PGCon meeting on the topic, and offered some opinions early in
the process, so many of you may remember that my view was to keep it
short and simple -- a wide net with broad mesh, and trust that with
competent application nothing would slip through.

My biggest concern about the current document is that it is hard to
make it from start to end, reading every word.  To check my
(admittedly subjective) impression, I put it through the free
"Readability Test Tool" at
https://www.webpagefx.com/tools/read-able/check.php (pasting the
document itself into the "TEST BY DIRECT INPUT" tab so that page
menus, footers, etc. were not included in the score), and got this:

"""
Test Results:
Your text has an average grade level of about 16. It should be easily
understood by 21 to 22 year olds.
"""

Now, on the whole that doesn't sound too bad, since the audience
should be mature and educated enough to deal with that, but it does
suggest that it might be a bit of a burden on some for whom English is
not their first language (unless we have translations?).

Further detail:

"""
Readability Indices

Flesch Kincaid Reading Ease 32.2
Flesch Kincaid Grade Level 15.2
Gunning Fog Score 18.3
SMOG Index 13.9
Coleman Liau Index 14.8
Automated Readability Index 16

Text Statistics

No. of sentences 65
No. of words 1681
No. of complex words 379
Percent of complex words 22.55%
Average words per sentence 25.86
Average syllables per word 1.75
"""

Note that the page mentions that the Flesch Kincaid Reading Ease score
is based on a 0-100 scale. A high score means the text is easier to
read. Low scores suggest the text is complicated to understand.  A
value between 60 and 80 should be easy for a 12 to 15 year old to
understand.  Our score was 32.2.

Perhaps in next year's review we could try to ease this a little.

In the meantime, I was very happy to see the so many new faces at
PostgresOpen SV 2018; maybe it's just a happy coincidence, but if this
effort had anything to do with drawing in more people, it was well
worth the effort!

Kevin Grittner

--
Kevin Grittner
VMware vCenter Server
https://www.vmware.com/



Re: Code of Conduct

2018-09-19 Thread Fred Pratt
Sorry, I emailed using my company account and thus the long sig.   In an effort 
to avoid further insulting Mr Olarte, I will delete it this time.See, 
Self-policing works !

Fred




Re: Code of Conduct

2018-09-19 Thread Stephen Frost
Greetings,

* Francisco Olarte (fola...@peoplecall.com) wrote:
> I will happily pardon brevity ( although I would not call a ten line
> sig plus a huge bottom quote "breve", and AFAIK it means the same in
> english as in spanish ) and/or typos, but the "I am not responsible"
> feels nearly insulting. Did someone force you to use "this device" (
> which you seem to perceive as inadequate for a nice answer ) to reply,
> or did you choose to do it ? ( real, not rethoric question, but do not
> answer if you feel  its inadequate )

Let's please try to keep the off-topic discussion on these lists to a
minimum.

> As an aside, is this kind of afirmations and/or my response to it a
> violation of the current CoC ?

There's a way to find out the answer to that question, but it's
certainly not to send an email to this list asking about it.  Please
review the policy, and follow the process outlined there if you feel the
need to.

Thanks!

Stephen


signature.asc
Description: PGP signature


Re: Code of Conduct

2018-09-19 Thread Francisco Olarte
On Wed, Sep 19, 2018 at 5:27 PM, Fred Pratt
 wrote:
> Keep pg open and free.   This smells of PC police.   This community can 
> police itself
No comment on this, just kept for context.

> Sent from my mobile device. Please pardon my brevity and typos.   I am not 
> responsible for changes made by this device’s autocorrect feature.

I will happily pardon brevity ( although I would not call a ten line
sig plus a huge bottom quote "breve", and AFAIK it means the same in
english as in spanish ) and/or typos, but the "I am not responsible"
feels nearly insulting. Did someone force you to use "this device" (
which you seem to perceive as inadequate for a nice answer ) to reply,
or did you choose to do it ? ( real, not rethoric question, but do not
answer if you feel  its inadequate )


As an aside, is this kind of afirmations and/or my response to it a
violation of the current CoC ?

Francisco Olarte.



Re: Code of Conduct

2018-09-19 Thread Steve Litt
On Wed, 19 Sep 2018 16:30:56 +0200
ERR ORR  wrote:


> A CoC will inevitably lead to the project taken over by leftists,

Here we go again.
 
SteveT

Steve Litt 
September 2018 featured book: Quit Joblessness: Start Your Own Business
http://www.troubleshooters.com/startbiz



Re: Pgbouncer and postgres

2018-09-19 Thread Adrian Klaver

On 9/19/18 8:39 AM, ncontu1 wrote:

So unexpectedly with the rpms, it installed it on a different place and it is
working from command line

[root@cmd-dev1 pgbouncer]# /bin/pgbouncer /etc/pgbouncer/pgbouncer.ini -u
postgres
2018-09-19 15:38:36.081 46322 LOG File descriptor limit: 1024 (H:4096),
max_client_conn: 100, max fds possible: 230
2018-09-19 15:38:36.082 46322 LOG Stale pidfile, removing
2018-09-19 15:38:36.082 46322 LOG listening on 0.0.0.0:6543
2018-09-19 15:38:36.082 46322 LOG listening on ::/6543
2018-09-19 15:38:36.083 46322 WARNING Cannot listen on
unix:/tmp/.s.PGSQL.6543: bind(): Address already in use


Is the compiled version still running?

Or is something else sitting on the 6543 socket?


2018-09-19 15:38:36.083 46322 LOG process up: pgbouncer 1.8.1, libevent
2.0.21-stable (epoll), adns: c-ares 1.10.0, tls: OpenSSL 1.0.2k-fips  26 Jan
2017

[root@cmd-dev1 ~]# psql -U ncontu -p 6543 cmd3dev -h IP_ADD
Password for user ncontu:
psql (10.5)
Type "help" for help.

cmd3dev=# \q


So at this point... I don't really know why compiled from source it does not
work.


Not sure.

For those that might know it would help to provide the complete 
./configure used and the config.log(or equivalent)






--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html




--
Adrian Klaver
adrian.kla...@aklaver.com



Re: Code of Conduct plan

2018-09-19 Thread Tom Lane
Tatsuo Ishii  writes:
> Now that CoC is out,
> https://www.postgresql.org/about/policies/coc/
> I would like to start the translation work.  Can somebody suggest me
> how I can proceed?

Sure, translate away.  Probably the -www list is the place to discuss
questions like where it would appear on the website.

regards, tom lane



Re: Code of Conduct

2018-09-19 Thread Fred Pratt
Keep pg open and free.   This smells of PC police.   This community can police 
itself

Sent from my mobile device. Please pardon my brevity and typos.   I am not 
responsible for changes made by this device’s autocorrect feature.

Fred Pratt
AmerisourceBergen
Manager – IT Infrastructure
Micro Technologies

8701 CenterPort Blvd
Amarillo, TX  79108

Work: 806.372.2369 (Ext. 8364)
Fax: 855.849.0680
Mobile: 806.679.1742

microtechnologies.com

On Sep 19, 2018, at 9:32 AM, ERR ORR 
mailto:rd0...@gmail.com>> wrote:

I was never consulted.
I was only Told that there was a CoC "to be". Not when, not how.
A CoC will inevitably lead to the project taken over by leftists, political and 
technical decisions will be made by others.
Most important from my PoV, the projects quality will decrease until its made 
unviable.
As others have said, this was rammed down our throats.
Before you ppl become unemployed, read "SJWs always lie". You'll know what 
awaits you.
As for myself, I'll be on the lookout for another DB. One that's not 
infiltrated by leftist nuts.

And Dave, you can tell the core team a big "FUCK YOU" for this.

James Keener mailto:j...@jimkeener.com>> schrieb am Di., 
18. Sep. 2018, 13:48:
> following a long consultation process

It's not a consultation if any dissenting voice is simply ignored. Don't 
sugar-coat or politicize it like this -- it was rammed down everyone's throats. 
That is core's right, but don't act as everyone's opinions and concerns were 
taken into consideration. There are a good number of folks who are concerned 
that this CoC is overreaching and is ripe for abuse. Those concerns were always 
simply, plainly, and purposely ignored.

> Please take time to read and understand the CoC, which is intended to ensure 
> that PostgreSQL remains an open and enjoyable project for anyone to join and 
> participate in.

I sincerely hope so, and that it doesn't become a tool to enforce social 
ideology like in other groups I've been part of. Especially since this is the 
main place to come to get help for PostgreSQL and not a social club.

Jim

On September 18, 2018 6:27:56 AM EDT, Dave Page 
mailto:dp...@postgresql.org>> wrote:
The PostgreSQL Core team are pleased to announce that following a long 
consultation process, the project’s Code of Conduct (CoC) has now been 
finalised and published at https://www.postgresql.org/about/policies/coc/.

Please take time to read and understand the CoC, which is intended to ensure 
that PostgreSQL remains an open and enjoyable project for anyone to join and 
participate in.

A Code of Conduct Committee has been formed to handle any complaints. This 
consists of the following volunteers:

- Stacey Haysler (Chair)
- Lætitia Avrot
- Vik Fearing
- Jonathan Katz
- Ilya Kosmodemiansky

We would like to extend our thanks and gratitude to Stacey Haysler for her 
patience and expertise in helping develop the Code of Conduct, forming the 
committee and guiding the work to completion.

--
Dave Page
PostgreSQL Core Team
http://www.postgresql.org/


--
Sent from my Android device with K-9 Mail. Please excuse my brevity.



Re: Pgbouncer and postgres

2018-09-19 Thread ncontu1
So unexpectedly with the rpms, it installed it on a different place and it is
working from command line

[root@cmd-dev1 pgbouncer]# /bin/pgbouncer /etc/pgbouncer/pgbouncer.ini -u
postgres 
2018-09-19 15:38:36.081 46322 LOG File descriptor limit: 1024 (H:4096),
max_client_conn: 100, max fds possible: 230
2018-09-19 15:38:36.082 46322 LOG Stale pidfile, removing
2018-09-19 15:38:36.082 46322 LOG listening on 0.0.0.0:6543
2018-09-19 15:38:36.082 46322 LOG listening on ::/6543
2018-09-19 15:38:36.083 46322 WARNING Cannot listen on
unix:/tmp/.s.PGSQL.6543: bind(): Address already in use
2018-09-19 15:38:36.083 46322 LOG process up: pgbouncer 1.8.1, libevent
2.0.21-stable (epoll), adns: c-ares 1.10.0, tls: OpenSSL 1.0.2k-fips  26 Jan
2017

[root@cmd-dev1 ~]# psql -U ncontu -p 6543 cmd3dev -h IP_ADD
Password for user ncontu:
psql (10.5)
Type "help" for help.

cmd3dev=# \q


So at this point... I don't really know why compiled from source it does not
work.



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html



Re: Code of Conduct plan

2018-09-19 Thread Tatsuo Ishii
>>> Do we want official translations of this? We allow local communities
>>> do their own manual translations. However CoC is so important, I feel
>>> like we need more for Coc. Good thing with CoC is, it is expected that
>>> it would be stable (at least I hope so) and translation works when
>>> it's changed is expected to be minimal, unlike the manual translation
>>> works.
>> 
>> Good idea, but let's wait till the text is official; I'm not sure if
>> we'll change the draft again in response to the current discussions.
> 
> Of course. I will wait for the text to be settled down.

Now that CoC is out,

https://www.postgresql.org/about/policies/coc/

I would like to start the translation work.  Can somebody suggest me
how I can proceed?

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp



Re: *Regarding brin_index on required column of the table

2018-09-19 Thread Durgamahesh Manne
Hi

I have complex query like for ex  select  distinct
sub_head."vchSubmittersCode" ,rec."vchFileName" ,
rec."vchCusipFundIDSubFundID" , rec."vchFundUnitPrice"  ,
sub_head."vchValuationDate" ,rec."vchAdvisorLabel" from  "table1" rec join
"table2" sub_head on rec."vchSubmittersCode"=sub_head."vchSubmittersCode"
where  rec."bFetch"=false and sub_head."bFetch"=false ;


Even i have already tried with BTREE indexes & HASH indexes on required
columns .distinct query execution time was not reduced


Query taken around 7 minutes time to execute with BTREE indexes & HASH
indexes on required columns


SO please help in reducing the distinct query execution time

Regards

Durgamahesh Manne


On Wed, Sep 19, 2018 at 7:21 PM Durgamahesh Manne 
wrote:

> Hi
> Respected postgres community members
>
> I have created BRIN index on few columns of the table without any issues.
> But i am unable to create BRIN index on one column of the table as i got
> error listed below
>
>
> [local]:6263 postgres@huawei=# CREATE INDEX brin_idx on huawei using brin
> ("dFetch");
> ERROR:  data type boolean has no default operator class for access method
> "brin"
> HINT:  You must specify an operator class for the index or define a
> default operator class for the data type.
>
>  below is the column description:
> Column datatype   collationnullable   defaultstorage
>
>  dFetchboolean false
>   plain
>
>
>
> so please help in creating of the BRIN index on above column of the table .
>
>
>
> Regards
>
> Durgamahesh Manne
>


Re: *Regarding brin_index on required column of the table

2018-09-19 Thread Andreas Kretschmer




Am 19.09.2018 um 16:43 schrieb Durgamahesh Manne:



On Wed, Sep 19, 2018 at 8:02 PM Andreas Kretschmer 
mailto:andr...@a-kretschmer.de>> wrote:




Am 19.09.2018 um 15:51 schrieb Durgamahesh Manne:
> I have created BRIN index on few columns of the table without any
> issues. But i am unable to create BRIN index on one column of the
> table as i got error listed below
>
>
> [local]:6263 postgres@huawei=# CREATE INDEX brin_idx on huawei
using
> brin ("dFetch");
> ERROR:  data type boolean has no default operator class for access
> method "brin"
> HINT:  You must specify an operator class for the index or define a
> default operator class for the data type.

honestly, a BRIN-Index on a bool-column doesn't make much sense.
What do
you want to achive? Maybe a partial index with a where-condition
on that
column makes much more sense.


Regards, Andreas

-- 
2ndQuadrant - The PostgreSQL Support Company.

www.2ndQuadrant.com 



Hi


I want to execute distinct query at less possible time

for that reason ,Even i have already tried with BTREE indexes & HASH 
indexes on required columns .distinct query execution time was not reduced


select  distinct sub_head."vchSubmittersCode" ,rec."vchFileName" , 
rec."vchCusipFundIDSubFundID" , rec."vchFundUnitPrice"  ,  
sub_head."vchValuationDate" ,rec."vchAdvisorLabel" from  "table1" rec 
join  "table2" sub_head on 
rec."vchSubmittersCode"=sub_head."vchSubmittersCode" where 
rec."bFetch"=false and sub_head."bFetch"=false ;


Query taken around 7 minutes time to execute with BTREE indexes & HASH 
indexes on required columns




try an index like

create index idx_t1 on table1 ("vchSubmittersCode") where "bFetch"=false
and
create index idx_t2 on table2 ("vchSubmittersCode") where "bFetch"=false

and check if the plan changed and the indexes are in use. You can use 
create index concurrently to prevent lockings.




Regards, Andreas

--
2ndQuadrant - The PostgreSQL Support Company.
www.2ndQuadrant.com




Re: *Regarding brin_index on required column of the table

2018-09-19 Thread Durgamahesh Manne
On Wed, Sep 19, 2018 at 8:02 PM Andreas Kretschmer 
wrote:

>
>
> Am 19.09.2018 um 15:51 schrieb Durgamahesh Manne:
> > I have created BRIN index on few columns of the table without any
> > issues. But i am unable to create BRIN index on one column of the
> > table as i got error listed below
> >
> >
> > [local]:6263 postgres@huawei=# CREATE INDEX brin_idx on huawei using
> > brin ("dFetch");
> > ERROR:  data type boolean has no default operator class for access
> > method "brin"
> > HINT:  You must specify an operator class for the index or define a
> > default operator class for the data type.
>
> honestly, a BRIN-Index on a bool-column doesn't make much sense. What do
> you want to achive? Maybe a partial index with a where-condition on that
> column makes much more sense.
>
>
> Regards, Andreas
>
> --
> 2ndQuadrant - The PostgreSQL Support Company.
> www.2ndQuadrant.com
>
>
>
Hi


I want to execute distinct query at less possible time

for that reason ,Even i have already tried with BTREE indexes & HASH
indexes on required columns .distinct query execution time was not reduced

select  distinct sub_head."vchSubmittersCode" ,rec."vchFileName" ,
rec."vchCusipFundIDSubFundID" , rec."vchFundUnitPrice"  ,
sub_head."vchValuationDate" ,rec."vchAdvisorLabel" from  "table1" rec join
"table2" sub_head on rec."vchSubmittersCode"=sub_head."vchSubmittersCode"
where  rec."bFetch"=false and sub_head."bFetch"=false ;

Query taken around 7 minutes time to execute with BTREE indexes & HASH
indexes on required columns



Regards

Durgamahesh Manne


Re: *Regarding brin_index on required column of the table

2018-09-19 Thread Andreas Kretschmer




Am 19.09.2018 um 15:51 schrieb Durgamahesh Manne:
I have created BRIN index on few columns of the table without any 
issues. But i am unable to create BRIN index on one column of the 
table as i got error listed below



[local]:6263 postgres@huawei=# CREATE INDEX brin_idx on huawei using 
brin ("dFetch");
ERROR:  data type boolean has no default operator class for access 
method "brin"
HINT:  You must specify an operator class for the index or define a 
default operator class for the data type.


honestly, a BRIN-Index on a bool-column doesn't make much sense. What do 
you want to achive? Maybe a partial index with a where-condition on that 
column makes much more sense.



Regards, Andreas

--
2ndQuadrant - The PostgreSQL Support Company.
www.2ndQuadrant.com




Re: Which is the most stable PostgreSQL version yet present for CentOS 7?

2018-09-19 Thread Andreas Kretschmer




Am 19.09.2018 um 16:08 schrieb Raghavendra Rao J S V:

Hi All,

Which is the most stable PostgreSQL version yet present for CentOS 7?



the latest supported minor version.



Regards, Andreas

--
2ndQuadrant - The PostgreSQL Support Company.
www.2ndQuadrant.com




Re: Regrading brin_index on required column of the table

2018-09-19 Thread Durgamahesh Manne
On Wed, Sep 19, 2018 at 7:41 PM Igor Neyman  wrote:

>
>
> *From:* Durgamahesh Manne [mailto:maheshpostgr...@gmail.com]
> *Sent:* Wednesday, September 19, 2018 10:04 AM
> *To:* Igor Neyman 
> *Subject:* Re: Regrading brin_index on required column of the table
>
> On Wed, Sep 19, 2018 at 7:19 PM Igor Neyman 
> wrote:
>
>
>
> *From:* Durgamahesh Manne [mailto:maheshpostgr...@gmail.com]
> *Sent:* Wednesday, September 19, 2018 9:43 AM
> *To:* PostgreSQL mailing lists 
> *Subject:* Regrading brin_index on required column of the table
>
> Hi
>
> Respected postgres community members
>
>
>
> I have created BRIN index on few columns of the table without any issues.
> But i am unable to create BRIN index on one column of the table as i got
> error listed below
>
>
>
>
>
> [local]:6263 postgres@huawei=# CREATE INDEX brin_idx on huawei using brin
> ("dFetch");
>
> ERROR:  data type boolean has no default operator class for access method
> "brin"
>
> HINT:  You must specify an operator class for the index or define a
> default operator class for the data type.
>
>
>
>  below is the column description:
>
> Column datatype   collationnullable   defaultstorage
>
>
>
>  dFetchboolean false
>   plain
>
>
>
>
>
>
>
> so please help in creating of the BRIN index on above column of the table .
>
>
>
>
>
>
>
> Regards
>
>
>
> Durgamahesh Manne
>
>
>
> Why would you want BRIN index on Boolean-type column?
>
> What kind of interval will you specify?
>
>
>
> Regards,
>
> Igor Neyman
>
>
>
>
>
>
>
>
>
>  Hi
>
>
>
>
>
>  I have complex query like for ex  select  distinct
> sub_head."vchSubmittersCode" ,rec."vchFileName" ,
> rec."vchCusipFundIDSubFundID" , rec."vchFundUnitPrice"  ,
> sub_head."vchValuationDate" ,rec."vchAdvisorLabel" from  "table1" rec join
> "table2" sub_head on rec."vchSubmittersCode"=sub_head."vchSubmittersCode"
> where  rec."bFetch"=false and sub_head."bFetch"=false ;
>
>
>
>
>
> Query taken around 7 minutes time to execute without indexes on required
> columns
>
>
>
>  SO  i need to execute this distinct query at less time by creating
> indexes on required columns of the tables
>
>
>
> i have created brin indexes on vchsubmitterscode of two tables
>
>
>
> i am not able to create brin indexes on bfetch tables as i got a error
> ERROR:  data type boolean has no default operator class for access method
> "brin"
>
> HINT:  You must specify an operator class for the index or define a
> default operator class for the data type.
>
>
>
>
>
> so please help in creating of the BRIN index on above column of the table
> as i need to reduce the query execution time
>
>
>
>
>
> Regards
>
>
>
> Durgamahesh Manne
>
> Again, BRIN indexes are not design to work on Boolean columns. If you want
> to index Boolean column, just create regular BTREE index.
>
> Regards,
>
> Igor
>
>
>
>
>

 Hi

I have already tried with BTREE indexes & HASH indexes on required columns
.but distinct query execution time was not reduced


Query taken around 7 minutes time to execute with BTREE indexes & HASH
indexes on required columns


Regards

Durgamahesh Manne


Which is the most stable PostgreSQL version yet present for CentOS 7?

2018-09-19 Thread Raghavendra Rao J S V
Hi All,

Which is the most stable PostgreSQL version yet present for CentOS 7?

-- 
Regards,
Raghavendra Rao J S V
Mobile- 8861161425


Re: Converting to number with given format

2018-09-19 Thread Adrian Klaver

On 9/19/18 6:33 AM, Gabriel Furstenheim Milerud wrote:

Sorry,
So basically what I'm trying to achieve is the following. There is an 
input file from the user and a configuration describing what is being 
inserted. For example, he might have Last activity which is '-MM-DD 
HH:mi:ss' and Join date which is only '-MM-DD' because there is no 
associated timing. For dates this works perfectly and it is possible to 
configure what the input from the user will be. Think it is as a 
dropdown where the user says, this is the kind of data that I have.


Maybe that is not possible with numbers? To say in a format something 
like "my numbers have comma as decimal separator and no thousands 
separators" or "my numbers are point separated and have comma as 
thousands separator"


Yeah that is a problem because it depends on the locale information in 
the database you are entering the data:


show lc_numeric;
 lc_numeric

 en_US

 select to_number('10.000,00', '9D00');
 to_number
---
 10.00

select to_number('10.000,00', '9.00');
 to_number
---
 10.00


set lc_numeric = 'de_DE';
SET

select to_number('10.000,00', '9D00');
 to_number
---
   1.0

select to_number('10.000,00', '9.00');
 to_number
---
 10.00

D and G(group separator) work using the locale information set in the 
database. I know of no way to pass the information in with the format 
string. Off the top of my head I would say that this conversion would 
need to be done at point of input. Have user select their decimal and 
group separators and then convert to a universal format.





Nice thing of having a string for the format is that I can use it as a 
parameter for a prepared statement.


Thanks




--
Adrian Klaver
adrian.kla...@aklaver.com



Re: Pgbouncer and postgres

2018-09-19 Thread Fabio Pardi


On 19/09/18 15:34, Adrian Klaver wrote:
> On 9/19/18 5:40 AM, ncontu wrote:
>> Hi Fabio,
>> It used to work before, even without installing updates.
>
> Exactly, the suspicion is that something in the updates changed the behavior 
> of your system.
>
Yes, that's the suspicion. Or at least was..

I tried to update all the available packages available as of today for 
Centos7-OS and Centos7-updates hosted at:


http://ftp.nluug.nl/ftp/pub/os/Linux/distr/CentOS/7/os/x86_64

and

http://ftp.nluug.nl/ftp/pub/os/Linux/distr/CentOS/7/updates/x86_64/


With an up to date system, I m still able to use pgbouncer.

For the records, I m also posting the log lines showing up when pgbouncer is 
asked to start:


2018-09-19 15:49:42.574 9979 DEBUG parse_ini_file: 'verbose' = '3' ok:1
2018-09-19 15:49:42.575 9979 DEBUG loading auth_file: "/etc/pgbouncer/users.txt"
2018-09-19 15:49:42.576 9979 NOISE event: 136, SBuf: 200, PgSocket: 408, IOBuf: 
4108
2018-09-19 15:49:42.577 9979 LOG File descriptor limit: 1024 (H:4096), 
max_client_conn: 100, max fds possible: 140
2018-09-19 15:49:42.577 9979 DEBUG pktbuf_dynamic(128): 0x82a790
2018-09-19 15:49:42.577 9979 DEBUG make_room(0x82a790, 4): realloc newlen=256
2018-09-19 15:49:42.577 9979 DEBUG pktbuf_dynamic(128): 0x82a970
2018-09-19 15:49:42.577 9979 NOISE connect(4, unix:/tmp/.s.PGSQL.6543) = No 
such file or directory
2018-09-19 15:49:42.577 9979 NOISE safe_close(4) = 0
2018-09-19 15:49:42.578 9981 DEBUG adns_create_context: c-ares 1.10.0
2018-09-19 15:49:42.578 9981 DEBUG add_listen: 0.0.0.0:6543
2018-09-19 15:49:42.578 9981 NOISE old TCP_DEFER_ACCEPT on 7 = 0
2018-09-19 15:49:42.578 9981 NOISE install TCP_DEFER_ACCEPT on 7
2018-09-19 15:49:42.578 9981 LOG listening on 0.0.0.0:6543
2018-09-19 15:49:42.578 9981 DEBUG add_listen: ::/6543
2018-09-19 15:49:42.578 9981 NOISE old TCP_DEFER_ACCEPT on 8 = 0
2018-09-19 15:49:42.578 9981 NOISE install TCP_DEFER_ACCEPT on 8
2018-09-19 15:49:42.578 9981 LOG listening on ::/6543
2018-09-19 15:49:42.578 9981 DEBUG add_listen: unix:/tmp/.s.PGSQL.6543
2018-09-19 15:49:42.579 9981 LOG listening on unix:/tmp/.s.PGSQL.6543
2018-09-19 15:49:42.579 9981 LOG process up: pgbouncer 1.8.1, libevent 
2.0.21-stable (epoll), adns: c-ares 1.10.0, tls: OpenSSL 1.0.2k-fips  26 Jan 
2017


and this part shows up when the user connects:

psql -h /tmp -p 6543 -U someuser mydb


2018-09-19 16:02:12.125 10457 NOISE C-0x1391120: 
(nodb)/(nouser)@unix(10465):6543 pkt='!' len=77
2018-09-19 16:02:12.125 10457 DEBUG C-0x1391120: 
(nodb)/(nouser)@unix(10465):6543 got var: user=someuser
2018-09-19 16:02:12.125 10457 DEBUG C-0x1391120: 
(nodb)/(nouser)@unix(10465):6543 got var: database=mydb
2018-09-19 16:02:12.125 10457 DEBUG C-0x1391120: 
(nodb)/(nouser)@unix(10465):6543 using application_name: psql
2018-09-19 16:02:12.125 10457 DEBUG C-0x1391120: 
(nodb)/(nouser)@unix(10465):6543 got var: client_encoding=UTF8
2018-09-19 16:02:12.125 10457 NOISE safe_send(10, 13) = 13
2018-09-19 16:02:12.125 10457 NOISE resync: done=77, parse=77, recv=77
2018-09-19 16:02:12.125 10457 NOISE resync: done=0, parse=0, recv=0
2018-09-19 16:02:12.125 10457 NOISE safe_recv(10, 4096) = 0
2018-09-19 16:02:12.126 10457 NOISE safe_close(10) = 0
2018-09-19 16:02:19.094 10457 NOISE safe_accept(9) = 10 (unix:)
2018-09-19 16:02:19.094 10457 NOISE new fd from accept=10
2018-09-19 16:02:19.094 10457 NOISE unix peer uid: 0
2018-09-19 16:02:19.094 10457 DEBUG C-0x1391120: 
(nodb)/(nouser)@unix(10470):6543 P: got connection: unix->unix
2018-09-19 16:02:19.094 10457 NOISE safe_accept(9) = Resource temporarily 
unavailable
2018-09-19 16:02:19.094 10457 NOISE resync: done=0, parse=0, recv=0
2018-09-19 16:02:19.094 10457 NOISE safe_recv(10, 4096) = 77
2018-09-19 16:02:19.094 10457 NOISE C-0x1391120: 
(nodb)/(nouser)@unix(10470):6543 pkt='!' len=77
2018-09-19 16:02:19.094 10457 DEBUG C-0x1391120: 
(nodb)/(nouser)@unix(10470):6543 got var: user=someuser
2018-09-19 16:02:19.094 10457 DEBUG C-0x1391120: 
(nodb)/(nouser)@unix(10470):6543 got var: database=mydb
2018-09-19 16:02:19.094 10457 DEBUG C-0x1391120: 
(nodb)/(nouser)@unix(10470):6543 using application_name: psql
2018-09-19 16:02:19.094 10457 DEBUG C-0x1391120: 
(nodb)/(nouser)@unix(10470):6543 got var: client_encoding=UTF8
2018-09-19 16:02:19.094 10457 NOISE safe_send(10, 13) = 13
2018-09-19 16:02:19.094 10457 NOISE resync: done=77, parse=77, recv=77
2018-09-19 16:02:19.094 10457 NOISE resync: done=0, parse=0, recv=0
2018-09-19 16:02:19.094 10457 NOISE safe_recv(10, 4096) = 0
2018-09-19 16:02:19.095 10457 NOISE safe_close(10) = 0



after providing the password, connection works as usual.

As mentioned earlier by Adrian, the offending line is probably:

2018-09-17 12:21:48.917 88424 WARNING tune_socket(13) failed: Operation not 
supported


>>
>> I tried installing it from source, from git repo. Can't find the RPM, do you
>> have any link for centos7?
>
> I believe Fabio is talking about the Postgres community repo:
>
> https://yum.postgresql.org/
>


Re: Code of Conduct

2018-09-19 Thread Julian Paul

On 18/09/18 20:27, Dave Page wrote:
The PostgreSQL Core team are pleased to announce that following a long 
consultation process, the project’s Code of Conduct (CoC) has now been 
finalised and published at https://www.postgresql.org/about/policies/coc/.


Please take time to read and understand theCoC, which is intended to 
ensure that PostgreSQL remains an open and enjoyable project for anyone 
to join and participate in.


A Code of Conduct Committee has been formed to handle any complaints. 
This consists of the following volunteers:


- Stacey Haysler (Chair)
-LætitiaAvrot
- Vik Fearing
- Jonathan Katz
- Ilya Kosmodemiansky

We would like to extend our thanks and gratitude to Stacey Haysler for 
her patience and expertise in helping develop the Code of Conduct, 
forming the committee and guiding the work to completion.


--
Dave Page
PostgreSQL Core Team
http://www.postgresql.org/



It's overly long and convoluted.

"inclusivity" Is a ideologue buzzword of particular individuals that 
offer very little value apart from excessive policing of speech and 
behaviour assumed to be a problem where none exist.


"Personal attacks and negative comments on personal characteristics are 
unacceptable, and will not be permitted. Examples of personal 
characteristics include, but are not limited to age, race, national 
origin or ancestry, religion, gender, or sexual orientation."


So just leaving it at "Personal attacks" and ending it there won't do 
obviously. I'm a big advocate of people sorting out there own personal 
disputes in private but...


"further personal attacks (public or *private*);"

...lets assume people don't have the maturity for that and make it all 
public.


"may be considered offensive by fellow members" - Purely subjective and 
irrelevant to a piece of community software.


There is much more in this CoC that is concerning and appears to follow 
the same methodology to be nothing more than a green light to those who 
have made their way within the inner hierarchy to run it like a overly 
politicized dictatorship.


I'm not sure if there is likely to be a large concerning number of 
people that are likely to violate this CoC. However, it is written in a 
such a way that will open it up to heavy handed abuse.


The fact that this CoC made it this far to be actually published is 
concerning and IMO alludes to requests for feedback to not be taken 
seriously. In fact I'm somewhat certain of this.


I assumed this was a open community with a large number of voluntary 
members. Remember this is a piece of software most end users don't know 
or even should care about.


K.I.S.S. That's my feedback.

Regards, Julian.



*Regarding brin_index on required column of the table

2018-09-19 Thread Durgamahesh Manne
Hi
Respected postgres community members

I have created BRIN index on few columns of the table without any issues.
But i am unable to create BRIN index on one column of the table as i got
error listed below


[local]:6263 postgres@huawei=# CREATE INDEX brin_idx on huawei using brin
("dFetch");
ERROR:  data type boolean has no default operator class for access method
"brin"
HINT:  You must specify an operator class for the index or define a default
operator class for the data type.

 below is the column description:
Column datatype   collationnullable   defaultstorage

 dFetchboolean false
plain



so please help in creating of the BRIN index on above column of the table .



Regards

Durgamahesh Manne


RE: Regrading brin_index on required column of the table

2018-09-19 Thread Igor Neyman

From: Durgamahesh Manne [mailto:maheshpostgr...@gmail.com]
Sent: Wednesday, September 19, 2018 9:43 AM
To: PostgreSQL mailing lists 
Subject: Regrading brin_index on required column of the table


WARNING: This email originated from outside of Perceptron! Please be mindful of 
PHISHING and MALWARE risks.
Hi
Respected postgres community members

I have created BRIN index on few columns of the table without any issues. But i 
am unable to create BRIN index on one column of the table as i got error listed 
below


[local]:6263 postgres@huawei=# CREATE INDEX brin_idx on huawei using brin 
("dFetch");
ERROR:  data type boolean has no default operator class for access method "brin"
HINT:  You must specify an operator class for the index or define a default 
operator class for the data type.

 below is the column description:
Column datatype   collationnullable   defaultstorage

 dFetchboolean false
plain



so please help in creating of the BRIN index on above column of the table .



Regards

Durgamahesh Manne

Why would you want BRIN index on Boolean-type column?
What kind of interval will you specify?

Regards,
Igor Neyman




Regrading brin_index on required column of the table

2018-09-19 Thread Durgamahesh Manne
Hi
Respected postgres community members

I have created BRIN index on few columns of the table without any issues.
But i am unable to create BRIN index on one column of the table as i got
error listed below


[local]:6263 postgres@huawei=# CREATE INDEX brin_idx on huawei using brin
("dFetch");
ERROR:  data type boolean has no default operator class for access method
"brin"
HINT:  You must specify an operator class for the index or define a default
operator class for the data type.

 below is the column description:
Column datatype   collationnullable   defaultstorage

 dFetchboolean false
plain



so please help in creating of the BRIN index on above column of the table .



Regards

Durgamahesh Manne


Re: Pgbouncer and postgres

2018-09-19 Thread Adrian Klaver

On 9/19/18 5:40 AM, ncontu wrote:

Hi Fabio,
It used to work before, even without installing updates.


Exactly, the suspicion is that something in the updates changed the 
behavior of your system.




I got two interfaces : private IP and localhost

Selinux is disabled.
I tried installing it from source, from git repo. Can't find the RPM, do you
have any link for centos7?


I believe Fabio is talking about the Postgres community repo:

https://yum.postgresql.org/

This would be a repo change if you are currently using the CentOS repos.




I tried both /etc/init.d and command line, same issue.
Tried with a new user called pgbouncer, same issue

This is the result of lsof :

[root@cmd-dev1 /]# lsof -n | grep 6543
postmaste  80762   postgres   10r FIFO0,9
0t0 665436 pipe
postmaste  80762   postgres   11w FIFO0,9
0t0 665436 pipe

Thanks




--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html





--
Adrian Klaver
adrian.kla...@aklaver.com



Re: Converting to number with given format

2018-09-19 Thread Gabriel Furstenheim Milerud
Sorry,
So basically what I'm trying to achieve is the following. There is an input
file from the user and a configuration describing what is being inserted.
For example, he might have Last activity which is '-MM-DD HH:mi:ss' and
Join date which is only '-MM-DD' because there is no associated timing.
For dates this works perfectly and it is possible to configure what the
input from the user will be. Think it is as a dropdown where the user says,
this is the kind of data that I have.

Maybe that is not possible with numbers? To say in a format something like
"my numbers have comma as decimal separator and no thousands separators" or
"my numbers are point separated and have comma as thousands separator"

Nice thing of having a string for the format is that I can use it as a
parameter for a prepared statement.

Thanks



On Wed, 19 Sep 2018 at 15:22, Adrian Klaver 
wrote:

> On 9/19/18 6:11 AM, Gabriel Furstenheim Milerud wrote:
> > I'm not completely sure that that actually works
> >
> > SELECT to_number('9,134','9V3') =9
>
> SELECT (to_number('9,134', '9')/1000)::numeric(4,3);
>   numeric
> -
> 9.134
>
> >
> > It's true when it should be false (it should be 9.134). Also it is
> > completely dependent on the number of digits. So for example:
> >
> > SELECT to_number('19,134','9V3')
> >
> > Is 1, not 19.134 or even 19
>
> We probably ought to back this question up and ask what is you want to
> achieve in general?
>
>
> >
> > On Wed, 19 Sep 2018 at 14:57, Adrian Klaver  > > wrote:
> >
> > On 9/19/18 5:38 AM, Gabriel Furstenheim Milerud wrote:
> >  > Hello,
> >  > I'd like to convert a string number to a number being able to
> > provide
> >  > the custom format.
> >  > With dates it works perfectly fine, so that I can do:
> >  >
> >  > SELECT to_date('18 09 10', 'YY MM DD')
> >  >
> >  > Is there something similar with numbers?
> >  >
> >  > SELECT to_number('9,000',some_format) =9;
> >
> >SELECT to_number('9,000', '9V3')::int;
> >to_number
> > ---
> >9
> >
> >  > SELECT to_number('9,000',another_format) =9000;
> >
> > SELECT to_number('9,000', '9');
> >to_number
> > ---
> > 9000
> >
> >  >
> >  > It is not clear to me what some_format should be and what
> > another_format
> >  > should be so that those selects are equal.
> >  >
> >  > I've read the documentation but I can't find a similar example. In
> >  > stackoverflow they don't provide a solution either:
> >  >
> >
> https://stackoverflow.com/questions/18882942/postgresql-convert-a-string-with-commas-into-an-integer
> >  >
> >  > Thanks
> >  > Gabriel Fürstenheim
> >
> >
> > --
> > Adrian Klaver
> > adrian.kla...@aklaver.com 
> >
>
>
> --
> Adrian Klaver
> adrian.kla...@aklaver.com
>


Re: Converting to number with given format

2018-09-19 Thread Adrian Klaver

On 9/19/18 6:11 AM, Gabriel Furstenheim Milerud wrote:

I'm not completely sure that that actually works

SELECT to_number('9,134','9V3') =9


SELECT (to_number('9,134', '9')/1000)::numeric(4,3);
 numeric
-
   9.134



It's true when it should be false (it should be 9.134). Also it is 
completely dependent on the number of digits. So for example:


SELECT to_number('19,134','9V3')

Is 1, not 19.134 or even 19


We probably ought to back this question up and ask what is you want to 
achieve in general?





On Wed, 19 Sep 2018 at 14:57, Adrian Klaver > wrote:


On 9/19/18 5:38 AM, Gabriel Furstenheim Milerud wrote:
 > Hello,
 > I'd like to convert a string number to a number being able to
provide
 > the custom format.
 > With dates it works perfectly fine, so that I can do:
 >
 > SELECT to_date('18 09 10', 'YY MM DD')
 >
 > Is there something similar with numbers?
 >
 > SELECT to_number('9,000',some_format) =9;

   SELECT to_number('9,000', '9V3')::int;
   to_number
---
           9

 > SELECT to_number('9,000',another_format) =9000;

SELECT to_number('9,000', '9');
   to_number
---
        9000

 >
 > It is not clear to me what some_format should be and what
another_format
 > should be so that those selects are equal.
 >
 > I've read the documentation but I can't find a similar example. In
 > stackoverflow they don't provide a solution either:
 >

https://stackoverflow.com/questions/18882942/postgresql-convert-a-string-with-commas-into-an-integer
 >
 > Thanks
 > Gabriel Fürstenheim


-- 
Adrian Klaver

adrian.kla...@aklaver.com 




--
Adrian Klaver
adrian.kla...@aklaver.com



Re: Code of Conduct plan

2018-09-19 Thread ERR ORR
I see a CoC as an infiltration of the PostgreSQL community which has worked
OK since at least 10 years.
The project owners have let their care slacken.
I request that the project owners EXPEL/EXCOMMUNICATE ALL those who are
advancing what can only be seen as an instrument for harassing members of a
to-date peaceful and cordial community.

THROW THESE LEFTIST BULLIES OUT‼️

Dimitri Maziuk  schrieb am Mo., 17. Sep. 2018, 19:21:

> On 09/17/2018 10:39 AM, Chris Travers wrote:
> > On Mon, Sep 17, 2018 at 5:28 PM Joshua D. Drake 
> > wrote:
> ...
> >> My feedback is that those two sentences provide an overarching authority
> >> that .Org does not have the right to enforce
> ...
> > Fascinating that this would, on its face, not apply to a harassment
> > campaign carried out over twitter, but it would apply to a few comments
> > made over drinks at a bar.
>
> There is a flip side: if you have written standards, you can be held
> liable for not enforcing them. Potentially including enforcement of
> twitbook AUP on the list subscribers who also have a slackogger account.
>
> --
> Dimitri Maziuk
> Programmer/sysadmin
> BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu
>
>


Re: Converting to number with given format

2018-09-19 Thread Gabriel Furstenheim Milerud
I'm not completely sure that that actually works

SELECT to_number('9,134', '9V3') = 9

It's true when it should be false (it should be 9.134). Also it is
completely dependent on the number of digits. So for example:

SELECT to_number('19,134', '9V3')

Is 1, not 19.134 or even 19

On Wed, 19 Sep 2018 at 14:57, Adrian Klaver 
wrote:

> On 9/19/18 5:38 AM, Gabriel Furstenheim Milerud wrote:
> > Hello,
> > I'd like to convert a string number to a number being able to provide
> > the custom format.
> > With dates it works perfectly fine, so that I can do:
> >
> > SELECT to_date('18 09 10', 'YY MM DD')
> >
> > Is there something similar with numbers?
> >
> > SELECT to_number('9,000',some_format) =9;
>
>   SELECT to_number('9,000', '9V3')::int;
>   to_number
> ---
>   9
>
> > SELECT to_number('9,000',another_format) =9000;
>
> SELECT to_number('9,000', '9');
>   to_number
> ---
>9000
>
> >
> > It is not clear to me what some_format should be and what another_format
> > should be so that those selects are equal.
> >
> > I've read the documentation but I can't find a similar example. In
> > stackoverflow they don't provide a solution either:
> >
> https://stackoverflow.com/questions/18882942/postgresql-convert-a-string-with-commas-into-an-integer
> >
> > Thanks
> > Gabriel Fürstenheim
>
>
> --
> Adrian Klaver
> adrian.kla...@aklaver.com
>


postgres_fdw chooses remote index scan too rarely

2018-09-19 Thread Jeremy Finzel
First of all, my local system which has postgres_fdw installed is this
version:
PostgreSQL 9.6.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.9.3, 64-bit

Here are my server configurations (I have tweaked these with no improvement
to my issue):

   - fetch_size=100
   - fdw_startup_cost=1000
   - fdw_tuple_cost=10
   - use_remote_estimate=true

I am seeing some really odd behavior and I'm not sure how I can most easily
help our users to write queries that actually hit an index scan on the
remote server.  In one example, I have:

   - a temp table with 33 rows
   - text instead of integer data type - which the remote table's data type
   is
   - it is freshly analyzed

Joining to the table, doing id IN (list), or doing EXISTS all yield a full
remote table scan:

select *
from remote.customers c
inner join abc t on t.customer_id::int=c.customer_id;

select *
from remote.customers c
where c.customer_id in (SELECT customer_id::int FROM abc);

select *
from remote.customers c
where exists (SELECT 1 FROM abc WHERE customer_id::int = c.customer_id);

 QUERY PLAN
-
 Hash Join  (cost=1002.47..1170208178867.64 rows=5851034 width=3113)
   Hash Cond: (c.customer_id = (abc.customer_id)::integer)
   ->  Foreign Scan on customers c  (cost=1000.43..1170208089344.77
rows=11702069 width=902)
   ->  Hash  (cost=1.69..1.69 rows=28 width=7)
 ->  HashAggregate  (cost=1.41..1.69 rows=28 width=7)
   Group Key: (abc.customer_id)::integer
   ->  Seq Scan on abc  (cost=0.00..1.33 rows=33 width=7)
(7 rows)

However, I can get the index scan 2 ways:

   - converting the temp table data type to int
   - keeping the data type as is, but adding DISTINCT to the IN list

Neither of these make any sense to me because the planner knows there are
only 33 rows in the temp table.  It should always do an index scan.  And
why should converting the data type to int be any different than casting it
to int?  I understand the planner stats on that field are not for an
integer, but it's still only 33 rows.

So these 2 versions get a good plan and actually run very quickly:

select *
from remote.customers c
where c.customer_id in (SELECT DISTINCT customer_id::int FROM abc);

WITH distinctified AS (SELECT DISTINCT customer_id::int FROM abc)

select *
from remote.customers c
INNER JOIN distinctified t on t.customer_id::int=c.customer_id;

  QUERY PLAN
---
 Nested Loop  (cost=1002.03..5628140.32 rows=5851034 width=3113)
   ->  HashAggregate  (cost=1.58..2.00 rows=28 width=4)
 Group Key: (abc.customer_id)::integer
 ->  Seq Scan on abc  (cost=0.00..1.50 rows=33 width=4)
   ->  Foreign Scan on customers c  (cost=1000.45..201004.91 rows=2
width=902)
(5 rows)


Likewise if I alter the type it works without any special treatment:

ALTER TABLE abc ALTER COLUMN customer_id TYPE int USING customer_id::INT;
ANALYZE abc;

EXPLAIN
select *
from remote.customers c
inner join abc t using (customer_id);

  QUERY PLAN
---
 Nested Loop  (cost=1000.45..6633164.02 rows=1930841 width=3194)
   ->  Seq Scan on abc t  (cost=0.00..1.33 rows=33 width=85)
   ->  Foreign Scan on customers c  (cost=1000.45..201004.91 rows=2
width=902)
(3 rows)

Any insight appreciated!

Thanks,
Jeremy


Re: Converting to number with given format

2018-09-19 Thread Adrian Klaver

On 9/19/18 5:38 AM, Gabriel Furstenheim Milerud wrote:

Hello,
I'd like to convert a string number to a number being able to provide 
the custom format.

With dates it works perfectly fine, so that I can do:

SELECT to_date('18 09 10', 'YY MM DD')

Is there something similar with numbers?

SELECT to_number('9,000',some_format) =9;


 SELECT to_number('9,000', '9V3')::int;
 to_number
---
 9


SELECT to_number('9,000',another_format) =9000;


SELECT to_number('9,000', '9');
 to_number
---
  9000



It is not clear to me what some_format should be and what another_format 
should be so that those selects are equal.


I've read the documentation but I can't find a similar example. In 
stackoverflow they don't provide a solution either: 
https://stackoverflow.com/questions/18882942/postgresql-convert-a-string-with-commas-into-an-integer


Thanks
Gabriel Fürstenheim



--
Adrian Klaver
adrian.kla...@aklaver.com



Re: Pgbouncer and postgres

2018-09-19 Thread ncontu
Hi Fabio,
It used to work before, even without installing updates.

I got two interfaces : private IP and localhost

Selinux is disabled.
I tried installing it from source, from git repo. Can't find the RPM, do you
have any link for centos7?

I tried both /etc/init.d and command line, same issue.
Tried with a new user called pgbouncer, same issue 

This is the result of lsof : 

[root@cmd-dev1 /]# lsof -n | grep 6543
postmaste  80762   postgres   10r FIFO0,9   
0t0 665436 pipe
postmaste  80762   postgres   11w FIFO0,9   
0t0 665436 pipe

Thanks




--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html



Converting to number with given format

2018-09-19 Thread Gabriel Furstenheim Milerud
Hello,
I'd like to convert a string number to a number being able to provide the
custom format.
With dates it works perfectly fine, so that I can do:

SELECT to_date('18 09 10', 'YY MM DD')

Is there something similar with numbers?

  SELECT to_number('9,000', some_format) = 9;
  SELECT to_number('9,000', another_format) = 9000;

It is not clear to me what some_format should be and what another_format
should be so that those selects are equal.

I've read the documentation but I can't find a similar example. In
stackoverflow they don't provide a solution either:
https://stackoverflow.com/questions/18882942/postgresql-convert-a-string-with-commas-into-an-integer

Thanks
Gabriel Fürstenheim


Re: how to know whether query data from memory after pg_prewarm

2018-09-19 Thread Cédric Villemain
Le 19/09/2018 à 05:29, Thomas Munro a écrit :
> On Wed, Sep 19, 2018 at 1:35 PM jimmy  wrote:
>> I use select pg_prewarm('table1','read','main')  to load data of table1 into 
>> the memory.
>> when I use select count(1) from table1 group by aa to query data.
>> I find the speed of query is not fast, I wonder whether it query data from 
>> memory.
>> And it is slower than Oracle, both of Oracle and Postgresql has same table 
>> and count of data.
>> when pg_prewarm use 'read' mode,  the data is put into the OS cache, how to 
>> examine the table which is pg_prewarmed into the OS cache .
>> I know pg_buffercache ,but it just examine the table in the shared buffer of 
>> Postgresql, not the table in the OS cache.
> 
> This is a quick and dirty hack, but it might do what you want:
> 
> https://github.com/macdice/pgdata_mincore
> 
> Tested on FreeBSD, not sure how well it'll travel.

You can use pgfincore extension for that purpose, and more.

https://github.com/klando/pgfincore/blob/master/README.md


-- 
Cédric Villemain +33 (0)6 20 30 22 52
http://2ndQuadrant.fr/
PostgreSQL: Support 24x7 - Développement, Expertise et Formation



Re: how to know whether query data from memory after pg_prewarm

2018-09-19 Thread Fabio Pardi
@Thomas, this tool looks very interesting!

@Jimmy:

Back to the question,you might approach the problem from a different 
perspective..

If you run a query 2 consecutive times, from the secondon, you should be at 
'full speed'.

Therefore if the first run takes X seconds but the consecutive runs take only a 
fraction of it, then you have probably cached all the data.

It might be as simple as that. Butalsotake into account:

- What is written above is true when the size of the table fits in RAM
- No other activity is going on. If you have other activity going on on the 
disk, it will pollute your results
- If you read from disk, you will see read activity on the data disk, given 
that your are graphing it. If is cached then it does not read from disk.
- Running the query with 'explain' will tell you in detail what is going on. 
(Maybe you forgot to create an index on Postgres and is there on Oracle?)
- If you are doing sortsand the data does not fit on work_mem then you are 
making use of disk space, slowing down operations


regards,

fabio pardi


On 19/09/18 05:29, Thomas Munro wrote:
> On Wed, Sep 19, 2018 at 1:35 PM jimmy  wrote:
>> I use select pg_prewarm('table1','read','main')  to load data of table1 into 
>> the memory.
>> when I use select count(1) from table1 group by aa to query data.
>> I find the speed of query is not fast, I wonder whether it query data from 
>> memory.
>> And it is slower than Oracle, both of Oracle and Postgresql has same table 
>> and count of data.
>> when pg_prewarm use 'read' mode,  the data is put into the OS cache, how to 
>> examine the table which is pg_prewarmed into the OS cache .
>> I know pg_buffercache ,but it just examine the table in the shared buffer of 
>> Postgresql, not the table in the OS cache.
> This is a quick and dirty hack, but it might do what you want:
>
> https://github.com/macdice/pgdata_mincore
>
> Tested on FreeBSD, not sure how well it'll travel.
>



Replicate Tables from SAP (DB2/HANA) to PostgreSQL

2018-09-19 Thread Thomas Güttler

Hi,

is it possible to replicate some tables from SAP to PostgreSQL?

At the moment there are two underlaying database systems.

Some run DB2 and some run SAP-HANA.

In my case it would be nice, if it would be possible to replicate
only some rows, not all.

The replication should be unidirectional. The data in PostgreSQL
is only needed for reading, not for inserts/updates.

Regards,
  Thomas Güttler

--
Thomas Guettler http://www.thomas-guettler.de/
I am looking for feedback: https://github.com/guettli/programming-guidelines