Re: [GENERAL] How can I tell if pg_restore is running?

2014-06-10 Thread Martin French
My extension has a config table that is dumped by pg_dump and populated by pg_restore. However, this table has triggers on it that I would like not to do anything if the table is being populated by pg_restore. I want the triggers to operate only if the user is manipulating the table

Re: [GENERAL] Dump Database

2014-03-17 Thread Martin French
pgsql-general-ow...@postgresql.org wrote on 17/03/2014 12:50:20: From: José Pedro Santos zpsant...@hotmail.com To: Postgres Ajuda pgsql-general@postgresql.org, Date: 17/03/2014 12:56 Subject: [GENERAL] Dump Database Sent by: pgsql-general-ow...@postgresql.org Dear all, I'm trying to

[GENERAL] C Function Memory Management

2012-12-12 Thread Martin French
Ok, so just a (hopefully) quick question. I know that I should be using the Postgres function palloc in place of malloc, but what about realloc? Is there an equivalent? Thanks. = Romax Technology Limited Rutherford House Nottingham Science

Re: [GENERAL] C Function Memory Management

2012-12-12 Thread Martin French
Hi Pavel yes, repalloc Maybe I should've looked a little harder for that one! Ha Ha! I assume it's an exact functional copy of realloc, and see where I get with it! Many Thanks. = Romax Technology Limited Rutherford House Nottingham

Re: [GENERAL] C Function Memory Management

2012-12-12 Thread Martin French
One thing to know about it is that repalloc re-sizes the given chunk while keeping it in the same memory context it was originally allocated in (ie, CurrentMemoryContext doesn't matter). This may not matter much if you're only dealing with allocations that just live as long as the current

Re: [GENERAL] C Function Memory Management

2012-12-12 Thread Martin French
Usually I'd allocate the space in fcinfo-flinfo-fn_mcxt (which is a query-lifespan context) and keep a pointer to it in fcinfo-flinfo-fn_extra (which is a void * field that a C function can do what it pleases with). There are plenty of examples in the Postgres source code. If you are

Re: [GENERAL] Problem with aborting entire transactions on error

2012-12-10 Thread Martin French
if { no error during query } { do it } else { withdraw this one if { ROLLBACK_ON_ERROR } { rollback entire transaction } } I fear that this is no-where near as simple as it's been taken for, and without looking at the code, I would imagine that this would touch so many

Re: [GENERAL] remote connection refused

2012-11-19 Thread Martin French
Usually, after what you've already confirmed, it's likely to be one of the following: - check listen_address is set correctly in postgresql.conf. (try listen_address = * and restart postgres) - check port 5432 is open on iptables. (service iptables status, netstat -a | grep 5432) Cheers

Re: [GENERAL] Need psql send email

2012-09-20 Thread Martin French
Hi All,I am new to postgresql. I want to send email by using pl pgsql. I want to know how to set up the configurations for mail server.Can any one help me in solving this?. pavithra@gmail.com http://www.depesz.com/2012/06/13/how-to-send-mail-from-database/ Best regards,

Re: [GENERAL] Need psql send email

2012-09-20 Thread Martin French
The 1st one seems OK in a scary-from-a-security-standpoint kind of way. Agree, it needs to be weighed up and assessed from a security stand point I guess. The 2nd, not so much. See http://stackoverflow.com/questions/12002662/psql-trigger-send-email Imagine if the DNS goes wonky. Do

Re: [GENERAL] At what point does a big table start becoming too big?

2012-08-23 Thread Martin French
I have a table with 40 million rows and haven't had any performance issues yet. Are there any rules of thumb as to when a table starts getting too big? For example, maybe if the index size is 6x the amount of ram, if the table is 10% of total disk space, etc? -- My rule here is that a

Re: [GENERAL] At what point does a big table start becoming too big?

2012-08-23 Thread Martin French
I have a table with 40 million rows and haven't had any performance issues yet. Are there any rules of thumb as to when a table starts getting too big? For example, maybe if the index size is 6x the amount of ram, if the table is 10% of total disk space, etc?My rule here is

Re: [GENERAL] How to stop a query

2012-07-20 Thread Martin French
As Scott mentioned, kill -9 on a Postgres process is not a wise idea on a Postgres process.If you query is coming from another application, then terminating that application with a kill -9 *may* work, but is, as scott says, a last resortI tend to use kill -TERM (15) to disconnect the client, which