[GENERAL] pl/pgsql trigger function - compare *most* columns in NEW vs. OLD

2014-12-18 Thread Mike Blackwell
Is there a simple notation for comparing most columns in the new and old records in a pl/pgsql trigger function? Something like (new.b, new.c, new.d) = (old.b, old.c, old.d) works to compare all the columns except 'a', but is fragile in that it needs to be updated any time a column is added to t

Re: [GENERAL] SSL Certificates in Windows 7 & Postgres 9.3

2014-12-18 Thread Adrian Klaver
On 12/17/2014 10:14 PM, harpagornis wrote: I am developing a Windows desktop application so the client is the desktop application. Depending on the installation, the app will be running in single user mode, with the server and client both on only one machine, using 127.0.0.1. In that type of in

Re: [GENERAL] SSL Certificates in Windows 7 & Postgres 9.3

2014-12-18 Thread harpagornis
Thank you all. You have given me a lot to digest for my project. -- View this message in context: http://postgresql.nabble.com/SSL-Certificates-in-Windows-7-Postgres-9-3-tp5830749p5831358.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general m

Re: [GENERAL] pg_dump

2014-12-18 Thread Ramesh T
Please let me know what happend inside ..? On Wednesday, December 17, 2014, Ramesh T wrote: > > I'm installed pgadmin 3 on windows I'm trying to connect server.the server > is on Linux.now I'm trying pgdump from windows from using putty connected > to Linux Postgres server..also last mail I sent

Re: [GENERAL] pg_dump

2014-12-18 Thread Ramesh T
problem solved, C:\Program Files\pgadmin\bin>pg_dump -U postgres host -p port -C -f c:\bb\db_1 db_2 then to import i used psql On Wed, Dec 17, 2014 at 10:44 AM, Ramesh T wrote: > > Please let me know what happend inside ..? > > > On Wednesday, December 17, 2014, Ramesh T > wrote: > >> >> I'm i

[GENERAL] Building debug version with MSVC 2013 for 64bit: No _d postfix on dll and lib files...

2014-12-18 Thread Zuiderhoek, Jeroen
Hello, Some time ago, I posted the question below. Unfortunately I didn't get any response. Could it be that I should better post this question to one of the other pgsql lists, and then which one...? Thanks, Jeroen From: Zuiderhoek, Jeroen [mailto:jeroen.zuiderh...@hitt.nl] Sent: Wednesday, N

Re: [GENERAL] pg_dump

2014-12-18 Thread Ramesh T
I'm installed pgadmin 3 on windows I'm trying to connect server.the server is on Linux.now I'm trying pgdump from windows from using putty connected to Linux Postgres server..also last mail I sent trying from windows local c:\... :) On Wednesday, December 17, 2014, Adrian Klaver wrote: > On 12/16

[GENERAL] Postgresql 9.2, Memoy cache usage.

2014-12-18 Thread Cristian Iturrieta
Dear pgadmin-general, pgadmin-performance, I have the following query: What could be due to a single query sql one day run fast and another slow. The database has massive loads overnight and the next day serves datawarehouse. This causes the first query is slower by having to go find all the

Re: [GENERAL] pl/pgsql trigger function - compare *most* columns in NEW vs. OLD

2014-12-18 Thread Merlin Moncure
On Thu, Dec 18, 2014 at 12:16 PM, Mike Blackwell wrote: > Is there a simple notation for comparing most columns in the new and old > records in a pl/pgsql trigger function? Something like > > (new.b, new.c, new.d) = (old.b, old.c, old.d) > > works to compare all the columns except 'a', but is fra

[GENERAL] Combining two queries

2014-12-18 Thread Robert DiFalco
I have a table called friends with a user_id and a friend_id (both of these relate to an id in a users table). For each friend relationship there are two rows. There are currently ONLY reciprocal relationships. So if user ids 1 and 2 are friends there will be two rows (1,2) and (2,1). For 2 arbit

Re: [GENERAL] Combining two queries

2014-12-18 Thread David G Johnston
Robert DiFalco wrote > For 2 arbitrary ids, I need a query to get two pieced of data: >* Are the two users friends? This seems easy...ROW(u_id, f_id) = ROW(n1, n2) >* How many friends do the two users have in common. SELECT f_id FROM [...] WHERE u_id = n1 INTERSECT SELECT f_id FROM [...

Re: [GENERAL] Combining two queries

2014-12-18 Thread Patrick Krecker
On Thu, Dec 18, 2014 at 12:10 PM, Robert DiFalco wrote: > I have a table called friends with a user_id and a friend_id (both of these > relate to an id in a users table). > > For each friend relationship there are two rows. There are currently ONLY > reciprocal relationships. So if user ids 1 and

Re: [GENERAL] Combining two queries

2014-12-18 Thread John McKown
On Thu, Dec 18, 2014 at 2:10 PM, Robert DiFalco wrote: > I have a table called friends with a user_id and a friend_id (both of > these relate to an id in a users table). > > For each friend relationship there are two rows. There are currently ONLY > reciprocal relationships. So if user ids 1 and

Re: [GENERAL] Combining two queries

2014-12-18 Thread John McKown
Wow, I sure went overboard with the "friendship chain" thought. I don't know where I got the idea that was your question. On Thu, Dec 18, 2014 at 3:46 PM, John McKown wrote: > > On Thu, Dec 18, 2014 at 2:10 PM, Robert DiFalco > wrote: > >> I have a table called friends with a user_id and a frien

Re: [GENERAL] Combining two queries

2014-12-18 Thread Robert DiFalco
Is the intersect any better than what I originally showed? On the ROW approach, I'm not sure where the context for that is coming from since it may not be in the intersection. Consider n1 and n2 are NOT friends but they have >0 mutual friends between them. On Thu, Dec 18, 2014 at 1:29 PM, David G

Re: [GENERAL] Combining two queries

2014-12-18 Thread David Johnston
On Thu, Dec 18, 2014 at 3:02 PM, Robert DiFalco wrote: > Is the intersect any better than what I originally showed? On the ROW > approach, I'm not sure where the context for that is coming from since it > may not be in the intersection. Consider n1 and n2 are NOT friends but they > have >0 mutual

Re: [GENERAL] Combining two queries

2014-12-18 Thread Patrick Krecker
On Thu, Dec 18, 2014 at 1:57 PM, Robert DiFalco wrote: > Thanks! So how would I combine them so that I would get a single row with > the mutual friend count and isFriends for a given pair of users? I can't > figure out how to modify what you've posted so that it gives the results > like the compou

Re: [GENERAL] Combining two queries

2014-12-18 Thread Robert DiFalco
The INNER JOIN to itself with a count turns out to have a lower cost query plan than the INTERSECT approach. On the ROW approach, it also seems to take longer than the simple EXISTS query. But I suppose I can put both of those into CTEs for convenience. I guess I was just hoping there was a lower c

[GENERAL] can you please share sample Postgres config file to enable max logging with syslog support?

2014-12-18 Thread M Tarkeshwar Rao
Hello friends, can you please share sample Postgres config file to enable max logging with syslog support? Actually we are facing some issues. We need to enable maximum logging. Regards Tarkeshwar