Re: [GENERAL] Question slow query

2017-01-16 Thread Patrick B
2017-01-12 16:48 GMT+13:00 Andreas Joseph Krogh : > På torsdag 12. januar 2017 kl. 03:15:59, skrev Patrick B < > patrickbake...@gmail.com>: > > Hi guys, > > I've got a slow query, running at 25 seconds. > > > -> Bitmap Heap Scan on ja_notes r_1103088 > (cost=234300.55.

Re: [GENERAL] Re: Are new connection/security features in order, given connection pooling?

2017-01-16 Thread Kevin Grittner
On Fri, Jan 13, 2017 at 7:39 PM, Karl Czajkowski wrote: > The concern was raised about the risk of the subsequent queries being > able to reverse the "set role" to subvert such authorization. Others > in the thread provided the common advice of parametric queries to > prevent query injection, but

Re: [GENERAL] raise notice question

2017-01-16 Thread Kevin Grittner
On Sat, Jan 14, 2017 at 11:15 AM, Tom Lane wrote: > ProPAAS DBA writes: >> Is it possible to execute a raise notice without the "Notice" keyword >> being part of the output > This is a matter for how your client code presents the message data. > So far as psql is concerned, the answer would be "

[GENERAL] Custom type column index - Postgres 9.1

2017-01-16 Thread Patrick B
Hi guys, I've got a custom data type column... The query I'm using its looking over 9 million rows. I've created a BTREE index but it didn't help on the speed. Is there any special index for custom types? Thanks Patrick

Re: [GENERAL] Custom type column index - Postgres 9.1

2017-01-16 Thread Lucas Possamai
2017-01-17 10:15 GMT+13:00 Patrick B : > Hi guys, > > I've got a custom data type column... The query I'm using its looking over > 9 million rows. > > I've created a BTREE index but it didn't help on the speed. Is there any > special index for custom types? > > Thanks > Patrick > I'm also looking

Re: [GENERAL] Custom type column index - Postgres 9.1

2017-01-16 Thread David G. Johnston
On Mon, Jan 16, 2017 at 2:48 PM, Lucas Possamai wrote: > 2017-01-17 10:15 GMT+13:00 Patrick B : > >> Hi guys, >> >> I've got a custom data type column... The query I'm using its looking >> over 9 million rows. >> >> I've created a BTREE index but it didn't help on the speed. Is there any >> speci

[GENERAL] 9.6.1: INSERT with PK as serial

2017-01-16 Thread Rich Shepard
I have a table with the primary key type of serial. The initial data load has 40 lines, and each has a value for every column including sequential integers from 1 through 40 for the data. When I try to read it in using 'psql -d -f ' I get a syntax error at the second word in the string that is

Re: [GENERAL] 9.6.1: INSERT with PK as serial

2017-01-16 Thread David Rowley
On 17 January 2017 at 12:44, Rich Shepard wrote: > I have a table with the primary key type of serial. The initial data load > has 40 lines, and each has a value for every column including sequential > integers from 1 through 40 for the data. When I try to read it in using > 'psql -d -f ' I get

Re: [GENERAL] 9.6.1: INSERT with PK as serial

2017-01-16 Thread Rich Shepard
On Tue, 17 Jan 2017, David Rowley wrote: You may have more luck getting an answer if you include the statement causing the problem. David, Here's an example: INSERT INTO companies VALUES (1,'AG Spray Inc.',,'PO Box 12129','Salem','OR','97309-0129','USA','503-371-7907','888-273-0937','i.

Re: [GENERAL] 9.6.1: INSERT with PK as serial

2017-01-16 Thread Tom Lane
Rich Shepard writes: >Here's an example: > INSERT INTO companies VALUES >(1,'AG Spray Inc.',,'PO Box > 12129','Salem','OR','97309-0129','USA','503-371-7907','888-273-0937','i...@agsprayinc.com',,'Chemicals','Opportunity'), > and the associated error message: > psql:companies.sql:1: ERR

Re: [GENERAL] 9.6.1: INSERT with PK as serial

2017-01-16 Thread Rich Shepard
On Mon, 16 Jan 2017, Tom Lane wrote: It looks like something deleted the quote marks. How are you entering this SQL command, exactly? Tom, I noticed that, too. Here's the first line: INSERT INTO companies ('comp_id','comp_name','addr1','addr2','city','comp_state','postcode','country','pho

Re: [GENERAL] 9.6.1: INSERT with PK as serial

2017-01-16 Thread John R Pierce
On 1/16/2017 4:30 PM, Rich Shepard wrote: I noticed that, too. Here's the first line: INSERT INTO companies ('comp_id','comp_name','addr1','addr2','city','comp_state','postcode','country','phone','fax','e_mail','url','industry','status','comment') VALUES (1,'AG Spray Inc.',' ','PO Box 12129

Re: [GENERAL] 9.6.1: INSERT with PK as serial

2017-01-16 Thread David Rowley
On 17 January 2017 at 13:30, Rich Shepard wrote: > INSERT INTO companies > ('comp_id','comp_name','addr1','addr2','city','comp_state','postcode','country','phone','fax','e_mail','url','industry','status','comment') > VALUES > (1,'AG Spray Inc.',' ','PO Box > 12129','Salem','OR','97309-0129','USA',

Re: [GENERAL] 9.6.1: INSERT with PK as serial

2017-01-16 Thread David G. Johnston
On Monday, January 16, 2017, Rich Shepard wrote: > On Mon, 16 Jan 2017, Tom Lane wrote: > > It looks like something deleted the quote marks. How are you entering >> this SQL command, exactly? >> > > Tom, > > I noticed that, too. Here's the first line: > > INSERT INTO companies > ('comp_id','co

Re: [GENERAL] 9.6.1: INSERT with PK as serial [FIXED]

2017-01-16 Thread Rich Shepard
On Mon, 16 Jan 2017, John R Pierce wrote: the above isn't valid postgresql, as field names need to be in "doublequotes" not 'singlequotes'. John, I thought I had changed them from single to double, yet missed seeing that I did not do so. Mea culpa! I know better than that. That fixed all

Re: [GENERAL] 9.6.1: INSERT with PK as serial

2017-01-16 Thread David G. Johnston
On Monday, January 16, 2017, Rich Shepard wrote: > I have a table with the primary key type of serial. The initial data load > has 40 lines, and each has a value for every column including sequential > integers from 1 through 40 for the data. > Without any special effort on your part the first

Re: [GENERAL] 9.6.1: INSERT with PK as serial

2017-01-16 Thread Rich Shepard
On Mon, 16 Jan 2017, David G. Johnston wrote: Without any special effort on your part the first 40 records you try to insert using the default sequence are now going to fail with duplicate key errors. David, Thank you. I added them while thrashing around looking for the source of the proble