Re: [GENERAL] Postgres intermittent connection errors: psql.bin: could not connect to server: Cannot assign requested address

2017-05-15 Thread Tom Lane
Vamsi Patchipulusu writes: > Error: psql.bin: could not connect to server: Cannot assign > requested address > Is the server running on host "abchost.corp.xyz.com" > (xxx.xxx.xxx.xxx) and accepting > TCP/IP connections on port 5432? Googling suggests that this could oc

Re: [GENERAL] Postgres intermittent connection errors: psql.bin: could not connect to server: Cannot assign requested address

2017-05-15 Thread David G. Johnston
On Monday, May 15, 2017, Vamsi Patchipulusu wrote: > > Error: psql.bin: could not connect to server: Cannot assign > requested address > > Is the server running on host "abchost.corp.xyz.com" > (xxx.xxx.xxx.xxx) and accepting > > TCP/IP connections on port 5432? > > Jmete

Re: [GENERAL] Text value within composite function result not quoted

2017-05-15 Thread Tom Lane
Guyren Howe writes: > Thanks. This is… inconvenient. I see nothing about an option to force quoting > of strings. Is there no such option? If not, I suggest that it would be a > useful addition. Force-quoting the elements would not move the goalposts all that much concerning parse-ability of co

Re: [GENERAL] Help: Installing 9.6 breaks local connections to 9.2 on Centos 6.9

2017-05-15 Thread Ken Tanzer
On Mon, May 15, 2017 at 4:45 PM, Adrian Klaver wrote: > On 05/15/2017 01:40 PM, Ken Tanzer wrote: > > > >> But let me ask, is there a big warning about this somewhere I missed? >> Can the 9.2 updates do something to fix this, or at least create a warning >> or an RPMNEW file? I'm happy this is a

[GENERAL] Postgres intermittent connection errors: psql.bin: could not connect to server: Cannot assign requested address

2017-05-15 Thread Vamsi Patchipulusu
Hi All, We are receiving below intermittent connection error during performance testing on postgres. Thanks in advance for any suggestion or pointers on how we can troubleshoot this issue. Error: psql.bin: could not connect to server: Cannot assign requested address Is the se

Re: [GENERAL] Text value within composite function result not quoted

2017-05-15 Thread David G. Johnston
On Monday, May 15, 2017, Tom Lane wrote: > Guyren Howe > writes: > > ... get this result: > > (200,{},Works!) > > This is the textual representation of the result I get in psql and Ruby. > Note that the textual final value is not quoted. > > I imagine I can work out a way to deal with this, but t

Re: [GENERAL] Text value within composite function result not quoted

2017-05-15 Thread Guyren Howe
> On May 15, 2017, at 21:36 , Tom Lane wrote: > >> ... get this result: >> (200,{},Works!) >> This is the textual representation of the result I get in psql and Ruby. >> Note that the textual final value is not quoted. >> I imagine I can work out a way to deal with this, but this is not the mos

Re: [GENERAL] Text value within composite function result not quoted

2017-05-15 Thread Tom Lane
Guyren Howe writes: > ... get this result: > (200,{},Works!) > This is the textual representation of the result I get in psql and Ruby. Note > that the textual final value is not quoted. > I imagine I can work out a way to deal with this, but this is not the most > felicitous way of representing

[GENERAL] Text value within composite function result not quoted

2017-05-15 Thread Guyren Howe
Define a couple of types: CREATE TYPE request_in AS ( path text[], args jsonb, server text, port smallint, headers jsonb, body bytea, type_requested text[] ); CREATE TYPE request_out AS ( status smallint, headers jsonb,

Re: [GENERAL] Help: Installing 9.6 breaks local connections to 9.2 on Centos 6.9

2017-05-15 Thread Adrian Klaver
On 05/15/2017 01:40 PM, Ken Tanzer wrote: But let me ask, is there a big warning about this somewhere I missed? Can the 9.2 updates do something to fix this, or at least create a warning or an RPMNEW file? I'm happy this is a cloud server and that I worked on a copy. However, in differen

Re: [GENERAL] Add NAMEDATALEN to PG_CONFIG?

2017-05-15 Thread Tom Lane
Andy Johnson writes: > Is there a way to find NAMEDATALEN in a > database, other than looking at the > source? select typlen from pg_type where typname = 'name'; > If not could it be added to the > PG_CONFIG eventually? Seems like it would only make sense to do that if we supported configuri

Re: [GENERAL] union all taking years - PG 9.6

2017-05-15 Thread David G. Johnston
On Mon, May 15, 2017 at 4:21 PM, Patrick B wrote: > Hi guys. > > I have two tables, where 'tableA' is the old and 'tableC' is the new one. > I say "new/old" because we are migrating the data from tableA to tableC > soon. > > I created a view selecting from both tables, with a UNION ALL between >

Re: [GENERAL] Add NAMEDATALEN to PG_CONFIG?

2017-05-15 Thread Adrian Klaver
On 05/15/2017 04:27 PM, Andy Johnson wrote: Is there a way to find NAMEDATALEN in a database, other than looking at the source? If not could it be added to the PG_CONFIG eventually? Andy Johnson https://www.postgresql.org/docs/9.6/static/runtime-config-preset.html "max_identifier_length (in

Re: [GENERAL] union all taking years - PG 9.6

2017-05-15 Thread Adrian Klaver
On 05/15/2017 04:21 PM, Patrick B wrote: Hi guys. I have two tables, where 'tableA' is the old and 'tableC' is the new one. I say "new/old" because we are migrating the data from tableA to tableC soon. I created a view selecting from both tables, with a UNION ALL between them. When selectin

[GENERAL] Add NAMEDATALEN to PG_CONFIG?

2017-05-15 Thread Andy Johnson
Is there a way to find NAMEDATALEN in a database, other than looking at the source? If not could it be added to the PG_CONFIG eventually? Andy Johnson

[GENERAL] union all taking years - PG 9.6

2017-05-15 Thread Patrick B
Hi guys. I have two tables, where 'tableA' is the old and 'tableC' is the new one. I say "new/old" because we are migrating the data from tableA to tableC soon. I created a view selecting from both tables, with a UNION ALL between them. When selecting from that view, it's really slow. I can't eve

Re: [GENERAL] Insert performance and disk usage in JSON vs JSONB

2017-05-15 Thread Thomas Kellerer
Ronny Abraham schrieb am 15.05.2017 um 19:25: 4. Insert 10,000 rows to JSON, execution time (sec): 122.855001211 5. Insert 10,000 rows to JSONB, execution time (sec): 122.128999233 What’s interesting is that inserting to JSONB is slightly faster than inserting to JSON. A difference in 0.7

Re: [GENERAL] Insert performance and disk usage in JSON vs JSONB

2017-05-15 Thread Merlin Moncure
On Mon, May 15, 2017 at 12:02 PM, Ronny Abraham wrote: > 4. Insert 10,000 rows to JSON, execution time (sec): > 5. Insert 10,000 rows to JSONB, execution time (sec): > > What’s interesting is that inserting to JSONB is slightly faster than > inserting to JSON. With those times, only explanation i

Re: [GENERAL] Help: Installing 9.6 breaks local connections to 9.2 on Centos 6.9

2017-05-15 Thread Devrim Gündüz
Hi, On Mon, 2017-05-15 at 16:34 -0400, Tom Lane wrote: > > bash-4.1$ /usr/pgsql-9.2/bin/psql -p 5432 > > psql: could not connect to server: Connection refused > >    Is the server running locally and accepting > >    connections on Unix domain socket > > "/var/run/postgresql/.s.PGSQL.5432

Re: [GENERAL] Help: Installing 9.6 breaks local connections to 9.2 on Centos 6.9

2017-05-15 Thread Ken Tanzer
> > >> Workarounds: >> >> * You can connect to 9.2 using /usr/pgsql-9.2/bin/psql command. It knows >> the >> old socket directory. >> > > That was where I was going until I saw this in the OP: > > bash-4.1$ /usr/pgsql-9.2/bin/psql -p 5432 > psql: could not connect to server: Connection refused >

Re: [GENERAL] Insert performance and disk usage in JSON vs JSONB

2017-05-15 Thread Ronny Abraham
Thank you, I updated my test to insert 10,000 rows where each row has a JSON or JSONB with 100 keys (I do not have a use case of 1000), here are the results: 7. Insert 10,000 rows to JSON (100 items in each row), execution time (sec): 119.411994457 8. Insert 10,000 rows to JSONB (100 items in e

Re: [GENERAL] Help: Installing 9.6 breaks local connections to 9.2 on Centos 6.9

2017-05-15 Thread Tom Lane
Adrian Klaver writes: > On 05/15/2017 01:10 PM, Devrim Gündüz wrote: >> * You can connect to 9.2 using /usr/pgsql-9.2/bin/psql command. It knows the >> old socket directory. > That was where I was going until I saw this in the OP: > bash-4.1$ /usr/pgsql-9.2/bin/psql -p 5432 > psql: could not con

Re: [GENERAL] Help: Installing 9.6 breaks local connections to 9.2 on Centos 6.9

2017-05-15 Thread Adrian Klaver
On 05/15/2017 01:10 PM, Devrim Gündüz wrote: Hi, On Mon, 2017-05-15 at 12:55 -0700, Ken Tanzer wrote: Hi. On a Centos 6.9 server (in the cloud with Rackspace), I'm wanting to install PGDG 9.6 alongside the already-running 9.2. After installing the 9.6 packages (and even before doing an initd

Re: [GENERAL] Help: Installing 9.6 breaks local connections to 9.2 on Centos 6.9

2017-05-15 Thread Devrim Gündüz
Hi, On Mon, 2017-05-15 at 12:55 -0700, Ken Tanzer wrote: > Hi.  On a Centos 6.9 server (in the cloud with Rackspace), I'm wanting to > install PGDG 9.6 alongside the already-running 9.2.  After installing the > 9.6 packages (and even before doing an initdb), I am no > longer able to make a local

Re: [GENERAL] Coditional join of query using PostgreSQL

2017-05-15 Thread Nick Dro
This is a join in a middle of query. How can I use dynamic SQL in the middle of query?ב מאי 15, 2017 20:26, David G. Johnston כתב:On Mon, May 15, 2017 at 10:02 AM, Nick Dro wrote: Hi, I'm new to postgresql and couldn't find answer to this situation anywhere. I asked this he

Re: [GENERAL] Help: Installing 9.6 breaks local connections to 9.2 on Centos 6.9

2017-05-15 Thread Tom Lane
Ken Tanzer writes: > Hi. On a Centos 6.9 server (in the cloud with Rackspace), I'm wanting to > install PGDG 9.6 alongside the already-running 9.2. After installing the > 9.6 packages (and even before doing an initdb), I am no > longer able to make a local connection to the 9.2 server. Instead

Re: [GENERAL] Help: Installing 9.6 breaks local connections to 9.2 on Centos 6.9

2017-05-15 Thread Justin Pryzby
On Mon, May 15, 2017 at 12:55:48PM -0700, Ken Tanzer wrote: > Hi. On a Centos 6.9 server (in the cloud with Rackspace), I'm wanting to > install PGDG 9.6 alongside the already-running 9.2. After installing the > 9.6 packages (and even before doing an initdb), I am no > longer able to make a local

[GENERAL] Help: Installing 9.6 breaks local connections to 9.2 on Centos 6.9

2017-05-15 Thread Ken Tanzer
Hi. On a Centos 6.9 server (in the cloud with Rackspace), I'm wanting to install PGDG 9.6 alongside the already-running 9.2. After installing the 9.6 packages (and even before doing an initdb), I am no longer able to make a local connection to the 9.2 server. Instead I get the message: psql: co

Re: [GENERAL] Coditional join of query using PostgreSQL

2017-05-15 Thread Alban Hertroys
> On 15 May 2017, at 19:02, Nick Dro wrote: > > Hi, > I'm new to postgresql and couldn't find answer to this situation anywhere. > I asked this here: > http://stackoverflow.com/questions/43984208/coditional-join-of-query-using-postgresql > > I hope there is a better solution rather than crea

Re: [GENERAL] Insert performance and disk usage in JSON vs JSONB

2017-05-15 Thread Dmitry Dolgov
On 15 May 2017 at 19:25, Ronny Abraham wrote: > > What’s interesting is that inserting to JSONB is slightly faster than inserting to JSON. > > Maybe that’s because my JSON has a flat structure (no nesting), or maybe I am doing something else wrong? I assume it's because your json documents (10 fi

Re: [GENERAL] Coditional join of query using PostgreSQL

2017-05-15 Thread Jack
This is a join in a middle of query. How can I do such thing? -- View this message in context: http://www.postgresql-archive.org/Coditional-join-of-query-using-PostgreSQL-tp5961718p5961726.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general m

Re: [GENERAL] Coditional join of query using PostgreSQL

2017-05-15 Thread David G. Johnston
On Mon, May 15, 2017 at 10:02 AM, Nick Dro wrote: > Hi, > I'm new to postgresql and couldn't find answer to this situation anywhere. > I asked this here: > http://stackoverflow.com/questions/43984208/coditional- > join-of-query-using-postgresql > > I hope there is a better solution rather than cr

Re: [GENERAL] Insert performance and disk usage in JSON vs JSONB

2017-05-15 Thread Ronny Abraham
Here are the attachments. From: Ronny Abraham Sent: Monday, May 15, 2017 1:03 PM To: 'pgsql-general@postgresql.org' Subject: Insert performance and disk usage in JSON vs JSONB Hello all, I am trying to decide whether to use JSON or JSONB to store my application data. From what I read so far ab

[GENERAL] Coditional join of query using PostgreSQL

2017-05-15 Thread Nick Dro
Hi, I'm new to postgresql and couldn't find answer to this situation anywhere. I asked this here: http://stackoverflow.com/questions/43984208/coditional-join-of-query-using-postgresqlI hope there is a better solution rather than creating two separated functions :(

[GENERAL] Insert performance and disk usage in JSON vs JSONB

2017-05-15 Thread Ronny Abraham
Hello all, I am trying to decide whether to use JSON or JSONB to store my application data. >From what I read so far about JSON vs JSONB: Performance - JSON is faster for inserts since it only odes JSON format verification, vs JSONB which

[GENERAL] Conditional join in function

2017-05-15 Thread Jack
Hi, I'm new to postgresql and couldn't find answer to this situation anywhere. I asked this here: http://stackoverflow.com/questions/43984208/coditional-join-of-query-using-postgresql I hope there is a better solution rather than creating two separated functions :( -- View this message in conte

[GENERAL] How to include BIGINT-column in RUM-index sorted by timestamp

2017-05-15 Thread Andreas Joseph Krogh
Hi PostgresPro (RUM-creators).   With the latest version of RUM: https://github.com/postgrespro/rum , one is able to store BIGINT as part of the index, it seems. I'm however not able to make a query use the index without the Filter-step.   This table is roughly like this: CREATE TABLE email_delive

Re: [GENERAL] Pattern Matching question - PG 9.6

2017-05-15 Thread matshyeq
^/testfile/client/[0-9]+/attachment/([0-9]{1,14}/master/$|unassigned/) Kind Regards ~Maciek On 15 May 2017 at 06:21, Patrick B wrote: > > > 2017-05-15 16:10 GMT+12:00 David G. Johnston : > >> On Sunday, May 14, 2017, Patrick B wrote: >> >>> >>> Demo: http://dbfiddle.uk/?rdbms=postgres_9.6&fiddl