Re: [GENERAL] pgadmin connection via tunnel and ubuntu user instead of postgres

2013-01-12 Thread Paul S
Adrian, I was thinking the same thing. I think if I come in via SSH as a postgres user, then it will work. I'll try that and post here on how it works. Thanks, Paul -Original Message- From: Adrian Klaver [mailto:adrian.kla...@gmail.com] Sent: Saturday, January 12, 2013 7:46 PM To: P

[GENERAL] Bug in PgAdmin 1.16.1

2013-01-12 Thread Edson Richter
Don't know if pgAdmin maintainer keep an eye in this list, but here I go: - Using pgAdmin 1.16.1 in Windows 7 x64 downloaded today 1) You alter a role, adding any information you want: when the properties page is open, pgAdmin automatically defines a expiration date on 1969/12/31. 2) You wan

Re: [GENERAL] Combining validation into main query

2013-01-12 Thread Adrian Klaver
On 01/12/2013 04:58 PM, Robert James wrote: Typically, my web application does some initial validation, then, if it passes, does the actual query. For both performance and simplicity, I'd like to combine these all into one trip to Postgres. Ideally, I'd like to do this in SQL. If that's not pos

Re: [GENERAL] Combining validation into main query

2013-01-12 Thread Serge Fonville
If you use EXISTS in the WHERE clause, you should come closer to what you want realised. For further help it would make it easier if you shared the whole queries and perhaps a more detailed description of the goal you are trying to accomplish. HTH Kind regards/met vriendelijke groet, Serge Fonvi

[GENERAL] Combining validation into main query

2013-01-12 Thread Robert James
Typically, my web application does some initial validation, then, if it passes, does the actual query. For both performance and simplicity, I'd like to combine these all into one trip to Postgres. Ideally, I'd like to do this in SQL. If that's not possible, I could use PL/pgsql, though I'm not ad

Re: [GENERAL] pgadmin connection via tunnel and ubuntu user instead of postgres

2013-01-12 Thread Serge Fonville
I believe the main problem in this situation is that you are trying to use a security context that only exists on the server you are trying to connect to, this is not available from a remote client. You need to setup a authentication method that does allow this, or specify credentials on connectin

Re: [GENERAL] pgadmin connection via tunnel and ubuntu user instead of postgres

2013-01-12 Thread Adrian Klaver
On 01/12/2013 04:29 PM, Paul S wrote: Thanks Adrian, I think I can work with that but it's just a little less optimal that I was hoping for. Logging in just like I do in SSH would have been much easier. Just had a thought. Could you not set up SSH keys for the postgres user and connect the

Re: [GENERAL] pgadmin connection via tunnel and ubuntu user instead of postgres

2013-01-12 Thread Adrian Klaver
On 01/12/2013 04:29 PM, Paul S wrote: Thanks Adrian, Right, the pg_hba.conf file is setup with the default settings. # Database administrative login by Unix domain socket local all postgrespeer # TYPE DATABASEUSERADDRESS

Re: [GENERAL] pgadmin connection via tunnel and ubuntu user instead of postgres

2013-01-12 Thread Paul S
Thanks Adrian, Right, the pg_hba.conf file is setup with the default settings. # Database administrative login by Unix domain socket local all postgrespeer # TYPE DATABASEUSERADDRESS METHOD # "local" is for Unix

Re: [GENERAL] pgadmin connection via tunnel and ubuntu user instead of postgres

2013-01-12 Thread Adrian Klaver
On 01/11/2013 09:31 PM, pasilveira wrote: Hello, I'm forced to log into a server via SSH and the ubuntu user via ssh keys. The ubuntu Postgres OS user has no password by default. When I log in via ssh, I log in via the ubuntu user, and then "sudo su - postgres" to then be able to execute "psql"

[GENERAL] pgadmin connection via tunnel and ubuntu user instead of postgres

2013-01-12 Thread pasilveira
Hello, I'm forced to log into a server via SSH and the ubuntu user via ssh keys. The ubuntu Postgres OS user has no password by default. When I log in via ssh, I log in via the ubuntu user, and then "sudo su - postgres" to then be able to execute "psql" to enter into postgres. This all works fi

Re: [GENERAL] syntax error in a trigger. can't find it.

2013-01-12 Thread Tom Lane
"Rhys A.D. Stewart" writes: > I must be very tired, very hungry or both. I'm getting a syntax error in > the last line with the 'END;' But am clearly not seeing what the error is. > Any help would be appreciated. I think you need to change ELSE IF to ELSEIF. As written you need two END IF lines

Re: [GENERAL] syntax error in a trigger. can't find it.

2013-01-12 Thread Rhys A.D. Stewart
Found it, had ELSE IF instead of elsif..very from the indicated error. On Sat, Jan 12, 2013 at 5:10 PM, Rhys A.D. Stewart wrote: > Greetings, > > I must be very tired, very hungry or both. I'm getting a syntax error in > the last line with the 'END;' But am clearly not seeing what the error

[GENERAL] syntax error in a trigger. can't find it.

2013-01-12 Thread Rhys A.D. Stewart
Greetings, I must be very tired, very hungry or both. I'm getting a syntax error in the last line with the 'END;' But am clearly not seeing what the error is. Any help would be appreciated. create or replace function dev.rqst_insrt() returns trigger as $_$

Re: [GENERAL] changes "during checkpointing"

2013-01-12 Thread Jeff Janes
On Fri, Jan 11, 2013 at 1:04 PM, Sahagian, David wrote: > In regards to 9.1.x, I would like to learn some details of the nature of > “checkpointing” > > === Question 1 === > > - page 123 is dirty > > - "checkpointing" starts > > - page 123 gets written to disk, as part of this checkpoint > > - pag

Re: [GENERAL] reducing number of ANDs speeds up query

2013-01-12 Thread Alban Hertroys
On 12 January 2013 12:41, T. E. Lawrence wrote: > Hi and thank you for your notes! > > > You really ought to include the output of EXPLAIN ANALYZE in cases such > as these (if it doesn't already point you to the culprit). > > I'll do so, it takes quite long... > > > Most likely you'll find that t

Re: [GENERAL] reducing number of ANDs speeds up query

2013-01-12 Thread Tony Theodore
On 12/01/2013, at 12:47 PM, T. E. Lawrence wrote: > Hello, > > I have a pretty standard query with two tables: > > SELECT table_a.id FROM table_a a, table_b b WHERE ... AND ... AND b.value=...; > > With the last "AND b.value=..." the query is extremely slow (did not wait for > it to end, but

Re: [GENERAL] reducing number of ANDs speeds up query

2013-01-12 Thread T. E. Lawrence
Hi and thank you! On 12.01.2013, at 11:52, Eduardo Morras wrote: >> With the last "AND b.value=..." the query is extremely slow (did not wait >> for it to end, but more than a minute), because the value column is not >> indexed (contains items longer than 8K). > > You can construct your own h

Re: [GENERAL] reducing number of ANDs speeds up query

2013-01-12 Thread T. E. Lawrence
Hi and thank you for your notes! > You really ought to include the output of EXPLAIN ANALYZE in cases such as > these (if it doesn't already point you to the culprit). I'll do so, it takes quite long... > Most likely you'll find that the last condition added a sequential scan to > the query pl

Re: [GENERAL] reducing number of ANDs speeds up query

2013-01-12 Thread T. E. Lawrence
On 12.01.2013, at 07:10, Amit kapila wrote: > You can try once with below query: > Select * from (SELECT a.id,b.value FROM table_a a, table_b b WHERE ... AND > ... ) X where X.value=...; > > If this doesn't work can you send the Explain .. output for both queries(the > query you are using and t

Re: [GENERAL] reducing number of ANDs speeds up query

2013-01-12 Thread Eduardo Morras
On Sat, 12 Jan 2013 02:47:26 +0100 "T. E. Lawrence" wrote: > Hello, > > I have a pretty standard query with two tables: > > SELECT table_a.id FROM table_a a, table_b b WHERE ... AND ... AND b.value=...; > > With the last "AND b.value=..." the query is extremely slow (did not wait for > it to

Re: [GENERAL] reducing number of ANDs speeds up query

2013-01-12 Thread Alban Hertroys
You really ought to include the output of EXPLAIN ANALYZE in cases such as these (if it doesn't already point you to the culprit). Most likely you'll find that the last condition added a sequential scan to the query plan, which can have several causes/reasons. Are the estimated #rows close to the