Re: [GENERAL] Slow Query - PostgreSQL 9.2

2016-01-10 Thread Saulo Merlo
Thank you! "Limit (cost=1557.00..4743.08 rows=1 width=186) (actual time=0.053..0.053 rows=0 loops=1)"" -> Nested Loop Left Join (cost=1557.00..4743.08 rows=1 width=186) (actual time=0.050..0.050 rows=0 loops=1)""-> Nested Loop Left Join (cost=1038.00..2526.07 rows=1 width=154)

Re: [GENERAL] Slow Query - PostgreSQL 9.2

2016-01-10 Thread Vitaly Burovoy
On 1/10/16, Saulo Merlo wrote: > I've got a slow query.. I'd like to make it faster.. Make add an index? > Query: > SELECT j.clientid AS client_id, >ni.segment_index AS note_id, >f.inode_id AS file_id, >f.node_full_path AS filename, >

Re: [GENERAL] Slow Query - PostgreSQL 9.2

2016-01-10 Thread Vitaly Burovoy
On 1/10/16, Vitaly Burovoy wrote: > On 1/10/16, Saulo Merlo wrote: >> I've got a slow query.. I'd like to make it faster.. Make add an index? >> Query: >> SELECT >> <> >> FROM gorfs.nodes AS f >> <> >> WHERE f.file_data IS NOT NULL >> AND

Re: [GENERAL] Fwd: dblink_connect fails

2016-01-10 Thread James Sewell
Oops forgot to reply back to this one in the Christmas shutdown. It turned out in this (new) install on Windows Postgres was running as the Network Service user (??). This was causing the issue, changed to Postgres and I was all good. Cheers, James Sewell, Solutions Architect

Things to notice (was Re: [GENERAL] Code of Conduct: Is it time?, broken thread I hope)

2016-01-10 Thread Andrew Sullivan
Someone (never mind who, this isn't intended to be a blame-game message) wrote: > Am I, as a mere male […] :-) Even with the smiley, _this_ is the sort of thing that causes discussions to wander into hopeless weeds from which projects cannot emerge. I _know_ it is tempting to make this kind of

Re: [GENERAL] Using xmax to detect deleted rows

2016-01-10 Thread Jim Nasby
On 1/8/16 9:02 AM, Alvaro Herrera wrote: Meel Velliste wrote: I would like to use the "xmax" column to detect rows that have been recently deleted. Is it possible to get the deleted row versions with non-zero xmax to remain visible long enough that I could periodically check, say once an hour,

Re: [GENERAL] Trigger function interface

2016-01-10 Thread Jim Nasby
On 1/7/16 6:15 PM, Tatsuo Ishii wrote: On 1/6/16 7:03 PM, Tatsuo Ishii wrote: Is it possible to get the parse tree in a C trigger function which is invoked when DML (INSERT/UPDATE/DELETE against a view) is executed? Yes, it's in fcinfo->flinfo->fn_expr. Thanks for the info. But is this the

Re: [GENERAL] Recovery regression tests

2016-01-10 Thread Kharage, Suraj
Hello, > The in-core TAP tests and pgTap are two independent things, the latter being > an independent facility and the in-core TAP tests do not need it. > If you want to run them, simply install the perl module IPC::Run and add this > configure switch: --enable-tap-tests. That’s work for me.

[GENERAL] Slow Query - PostgreSQL 9.2

2016-01-10 Thread Saulo Merlo
I've got a slow query.. I'd like to make it faster.. Make add an index? Query: SELECT j.clientid AS client_id, ni.segment_index AS note_id, f.inode_id AS file_id, f.node_full_path AS filename, f.last_changed AS date_created, f.file_data AS main_binary,

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Oleg Bartunov
On Sun, Jan 10, 2016 at 9:44 PM, Regina Obe wrote: > > On 01/10/2016 08:07 AM, Bill Moran wrote: > > >> So, the purpose of a CoC is twofold: > >> > >> A) Define what "being excellent" means to this particular > >> community. > >> B) Provide a process for how to resolve things

Re: [GENERAL] Slow Query - PostgreSQL 9.2

2016-01-10 Thread Saulo Merlo
Hi Vitaly, Yep... gorfs.nodes is a view. And the schema is: gorfs.inode_segments So... CREATE INDEX index_name ON gorfs.inode_segments(st_ctime) Is that correct? It would be "st_ctime"? I've rewriten the query as well. Thank you for that! Thank youLucas > Date: Sun, 10 Jan 2016 21:23:01 -0800 >

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Michael Paquier
On Mon, Jan 11, 2016 at 3:13 PM, Oleg Bartunov wrote: > Some people don't understand all these issues with she/he, for example, we > in Russia are not really concern about this. This depends on how the language is built. For example in French I think it would matter (not

Re: [GENERAL] Slow Query - PostgreSQL 9.2

2016-01-10 Thread Vitaly Burovoy
On 1/10/16, Saulo Merlo wrote: > Hi Vitaly, > > Yep... gorfs.nodes is a view. > And the schema is: gorfs.inode_segments > So... CREATE INDEX index_name ON gorfs.inode_segments(st_ctime) > Is that correct? It would be "st_ctime"? If "inodes" is an alias for

Re: [GENERAL] Slow Query - PostgreSQL 9.2

2016-01-10 Thread Saulo Merlo
CREATE INDEX CONCURRENTLY index_name ON gorfs.inode_segments(st_ctime); ERROR: column "st_ctime" does not exist Look the error I've got Lucas > Date: Sun, 10 Jan 2016 22:43:21 -0800 > Subject: Re: [GENERAL] Slow Query - PostgreSQL 9.2 > From: vitaly.buro...@gmail.com > To: smerl...@outlook.com >

Re: [GENERAL] Slow Query - PostgreSQL 9.2

2016-01-10 Thread Vitaly Burovoy
On 1/10/16, Saulo Merlo wrote: > CREATE INDEX CONCURRENTLY index_name ON gorfs.inode_segments(st_ctime); > ERROR: column "st_ctime" does not exist > Look the error I've got > > Lucas > >> Date: Sun, 10 Jan 2016 22:43:21 -0800 >> Subject: Re: [GENERAL] Slow Query -

Re: [GENERAL] Slow Query - PostgreSQL 9.2

2016-01-10 Thread Saulo Merlo
gorgs.inode_segments: -- Table: gorfs.inode_segments -- DROP TABLE gorfs.inode_segments; CREATE TABLE gorfs.inode_segments( st_ino "gorfs"."ino_t" NOT NULL, -- Inode number the segment belongs to. alongside segment_index, it forms the table's primary key to ensure uniqueness per relevant scope

Re: [GENERAL] Slow Query - PostgreSQL 9.2

2016-01-10 Thread Vitaly Burovoy
On 1/10/16, Saulo Merlo wrote: > gorgs.inode_segments: > <> > > gorfs.nodes: > -- View: gorfs.nodes > -- DROP VIEW gorfs.nodes; > CREATE OR REPLACE VIEW gorfs.nodes AS > SELECT > <> > "t"."st_ctime" AS "last_changed", ... > <> >FROM "gorfs"."inode_segments" "p" >

Re: [GENERAL] Slow Query - PostgreSQL 9.2

2016-01-10 Thread Charles Clavadetscher
Hello > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Saulo Merlo > Sent: Montag, 11. Januar 2016 08:12 > To: Vitaly Burovoy > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL]

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Gavin Flower
On 10/01/16 22:55, John R Pierce wrote: On 1/9/2016 11:57 PM, Gavin Flower wrote: I was at the 2015 Australian Linux Conference (held in Auckland, NZ), when Sarah Sharp harangued Linus Torvalds for over 20 minutes. Linus remained calm and polite throughout, yet most people would have been

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Regina Obe
> I was at the 2015 Australian Linux Conference (held in Auckland, NZ), when Sarah Sharp harangued Linus Torvalds for over 20 minutes. Linus remained calm and polite throughout, yet most people would have been obviously annoyed within the first 5 minutes. As backround see: >

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread John R Pierce
On 1/9/2016 11:57 PM, Gavin Flower wrote: I was at the 2015 Australian Linux Conference (held in Auckland, NZ), when Sarah Sharp harangued Linus Torvalds for over 20 minutes. Linus remained calm and polite throughout, yet most people would have been obviously annoyed within the first 5

[GENERAL] Execute commands in single-user mode

2016-01-10 Thread Andreas Joseph Krogh
Hi all.   I'm planning to move all my pg_largeobject tables to separate tablespaces and to be able to do that I need to shuddown PG and start in single-user mode, like this:   postgres --single -O -D $PGDATA $DB_NAME   Then I have to execute the command: alter table pg_largeobject set tablespace

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread John R Pierce
On 1/9/2016 11:37 PM, Regina Obe wrote: Josh informed me you guys are thinking about a CoC. Let me start off by saying that I don't think you need one and in fact having one may be dangerous. I fear for your safety. indeed. I think this man said it best. https://youtu.be/PjVbypiUOHA?t=35s

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Andreas Joseph Krogh
På søndag 10. januar 2016 kl. 16:40:23, skrev Tom Lane >: Andreas Joseph Krogh writes: > I'm planning to move all my pg_largeobject tables to separate tablespaces and > to be able to do that I need to shuddown PG and start in

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Bill Moran
On Sun, 10 Jan 2016 07:36:23 -0800 "Joshua D. Drake" wrote: > Hey, > > For the record, my thoughts on a CoC are something like: > > 1. Be excellent to each other > 2. If you don't know what that means, leave > 3. If someone isn't being excellent please contact: XYZ > >

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Melvin Davidson
Well, you can't combine psql with the postgres startup, but you can issue subsequent commands from bash with the -c option: EG: postgres --single -O -D $PGDATA $DB_NAME # give postgres a few seconds to complete startup sleep 30 psql -U postgres -d your_database -c "alter table pg_largeobject set

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Melvin Davidson
Sorry, I've never used single user mode, but here is a better example #!/bin/bash echo "**CHANGING TABLESPACES**" gosu postgres postgres --single -O -D $PGDATA $DB_NAME<<- EOSQL alter table pg_largeobject set tablespace some_tablespace; EOSQL pg_ctl stop -d $PGDATA -m fast echo "" echo

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Tom Lane
Andreas Joseph Krogh writes: > I'm planning to move all my pg_largeobject tables to separate tablespaces and > to be able to do that I need to shuddown PG and start in single-user mode, > like > this: > postgres --single -O -D $PGDATA $DB_NAME > Then I have to execute the

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Joshua D. Drake
Hey, For the record, my thoughts on a CoC are something like: 1. Be excellent to each other 2. If you don't know what that means, leave 3. If someone isn't being excellent please contact: XYZ With XYZ being a committee that determines the ABCs. Or in other words something like this (without

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Andreas Joseph Krogh
På søndag 10. januar 2016 kl. 15:52:12, skrev Melvin Davidson < melvin6...@gmail.com >: Well, you can't combine psql with the postgres startup, but you can issue subsequent commands from bash with the -c option:   EG: postgres --single -O -D $PGDATA $DB_NAME #

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Tom Lane
Andreas Joseph Krogh writes: > På søndag 10. januar 2016 kl. 16:40:23, skrev Tom Lane >: > Andreas Joseph Krogh writes: >>> Then I have to execute the command: >>> alter table pg_largeobject set

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Andreas Joseph Krogh
På søndag 10. januar 2016 kl. 16:53:54, skrev Tom Lane >: Andreas Joseph Krogh writes: > P�� s��ndag 10. januar 2016 kl. 16:40:23, skrev Tom Lane >: > Andreas Joseph Krogh

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Joshua D. Drake
On 01/10/2016 08:07 AM, Bill Moran wrote: So, the purpose of a CoC is twofold: A) Define what "being excellent" means to this particular community. B) Provide a process for how to resolve things when "being excellent" doesn't happen. Without #1, nobody will want to do #2, as it's

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Regina Obe
> On 01/10/2016 08:07 AM, Bill Moran wrote: >> So, the purpose of a CoC is twofold: >> >> A) Define what "being excellent" means to this particular >> community. >> B) Provide a process for how to resolve things when "being >> excellent" doesn't happen. >> >> Without #1, nobody will want

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Gavin Flower
On 11/01/16 07:44, Regina Obe wrote: [...] This may come as a big shock to many of you, but as a contributor I don't care if you are racist, sexist, transphobic or whatever as long as you 1) Are helpful when I ask a question 2) Stick to the topic 3) Don't get into petty etiquettes like "Please

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Joshua D. Drake
On 01/10/2016 10:44 AM, Regina Obe wrote: JD This may come as a big shock to many of you, but as a contributor I don't care if you are racist, sexist, transphobic or whatever as long as you I think this is reasonable but my point is that we don't care if you are sexist (in terms of .Org).

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Andrew Sullivan
On Sun, Jan 10, 2016 at 01:44:37PM -0500, Regina Obe wrote: > 1) Are helpful when I ask a question > 2) Stick to the topic > 3) Don't get into petty etiquettes like "Please stop top posting" > and if you really need to - A polite we prefer top posting would do > > 4) Are sensitive to people on

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Tim Clarke
On 10/01/16 18:44, Regina Obe wrote: > > This may come as a big shock to many of you, but as a contributor > I don't care if you are racist, sexist, transphobic or whatever as long as > you > > 1) Are helpful when I ask a question > 2) Stick to the topic > 3) Don't get into petty etiquettes like

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Jim Nasby
On 1/10/16 10:01 AM, Andreas Joseph Krogh wrote: pg_largeobject being a system-relation does quite make sense to me, but that's another discussion. I know there has been some discussions in the past about making it a non system-relation but it never got anywhere AFAIK. BTW, there's some other

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Regina Obe
>> She won Red Hat Woman of the Year Award - >> https://www.redhat.com/en/about/women-in-open-source >> >> Sarah Sharp >> 2015 Community Award winner >> >> Am I the only one concerned about some of the women role models we have in >> FOSS? > Am I, as a mere male, entitled to have an opinion on

[GENERAL] Request - repeat value of \pset title during \watch interations

2016-01-10 Thread David G. Johnston
When executing a query using \watch in psql the first execution of the query includes "Title is [...]" when \pset title is in use. Subsequent executions do not. Once that first display goes off-screen the information in the title is no longer readily accessible. If using \watch for a

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Gavin Flower
On 10/01/16 21:31, Regina Obe wrote: I was at the 2015 Australian Linux Conference (held in Auckland, NZ), when Sarah Sharp harangued Linus Torvalds for over 20 minutes. Linus remained calm and polite throughout, yet most people would have been obviously annoyed within the first 5 minutes. As

Re: [GENERAL] COPY FROM STDIN

2016-01-10 Thread Jim Nasby
On 1/8/16 10:37 AM, Luke Coldiron wrote: On 1/6/16 9:45 PM, Luke Coldiron wrote: In the example above I'm not sure if I can use some sub struct of the SPIPlanPtr and hand it off to the DoCopy function as the CopyStmt or if I need to go about this entirely different. Any advice on the matter

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Andreas Joseph Krogh
På søndag 10. januar 2016 kl. 22:38:05, skrev Jim Nasby < jim.na...@bluetreble.com >: On 1/10/16 10:01 AM, Andreas Joseph Krogh wrote: > pg_largeobject being a system-relation does quite make sense to me, but > that's another discussion. I know there has been

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Adrian Klaver
On 01/10/2016 02:05 PM, Regina Obe wrote: Gavin, I once went out of my way to help someone with Mac. They were so Mac centric they did not realize that they were not giving us the right information to help them, but this was not obvious until later in the thread. I made some comment about

Re: [GENERAL] Large Binary Columns - Slow Query

2016-01-10 Thread Arjen Nienhuis
On Jan 10, 2016 21:50, "Saulo Merlo" wrote: > > The binary columns are large so I think that's why the query referencing them is slow. > > PostgreSQL 9.2 > > Is there a way to speed it up, maybe compression on transfer? Some indexes has millions of rows... > > Maybe create

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Scott Mead
On Sun, Jan 10, 2016 at 5:09 PM, Adrian Klaver wrote: > On 01/10/2016 02:05 PM, Regina Obe wrote: > >> Gavin, >> >>> I once went out of my way to help someone with Mac. They were so Mac >>> >> centric they did not realize that they were not giving us the right >>

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Regina Obe
> On 01/10/2016 10:44 AM, Regina Obe wrote: >>> JD >> >> This may come as a big shock to many of you, but as a contributor I >> don't care if you are racist, sexist, transphobic or whatever as long >> as you > I think this is reasonable but my point is that we don't care if you are sexist (in

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Regina Obe
Gavin, > I once went out of my way to help someone with Mac. They were so Mac centric they did not realize that they were not giving us the right information to help them, but this was not obvious until later in the thread. I made some comment about Linux - next moment they were accusing >

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-10 Thread Jim Nasby
On 1/10/16 10:07 AM, Bill Moran wrote: The fact that Postgres has not needed a CoC up till now is a testiment to the quality of the people in the community. However, if Postgres continues to be more popular, the number of people involved is going to increase. Simply as a factor of statistics,