[GENERAL] Trigger to update table info

2013-08-12 Thread Arvind Singh
Hello friends, I have a table with the following structure Create table postablestatus ( tablename varchar(30) NOT NULL, updatetime timestamp, reccount int, size int, CONSTRAINT postablestatus_pkey PRIMARY KEY(tablenam

Re: [GENERAL] Pl/Python runtime overhead

2013-08-12 Thread Seref Arikan
Thanks for the confirmation Peter, I guess I'll take a good look at the existing implementations. All the best Seref On Fri, Aug 9, 2013 at 10:24 PM, Peter Eisentraut wrote: > On 8/7/13 10:43 AM, Seref Arikan wrote: > > When a pl/python based function is invoked, does it keep a python > > run

Re: [GENERAL] Trigger to update table info

2013-08-12 Thread raghu ram
On Mon, Aug 12, 2013 at 12:46 PM, Arvind Singh wrote: > Hello friends, > > I have a table with the following structure > > > Create table postablestatus > > ( > > tablename varchar(30) NOT NULL, > > updatetime timestamp, > > reccount int, > >

Re: [GENERAL] Replication delay

2013-08-12 Thread ascot.m...@gmail.com
Thanks so much. On 11 Aug 2013, at 9:50 PM, Michael Paquier wrote: > On Sun, Aug 11, 2013 at 5:51 AM, ascot.m...@gmail.com > wrote: >> Hi, >> >> I have a pair of PG servers, a master and a replica, all read-write queries >> are handled by the master, read-only ones are by the replica. >> >> F

Re: [GENERAL] Trigger to update table info

2013-08-12 Thread Jayadevan M
Hi, In case you are not keen on getting the latest and really accurate counts/size, you could just refer the views readily available - http://stackoverflow.com/questions/2596670/how-do-you-find-the-row-count-for-all-your-tables-in-postgres You won't get the updatetime, though. Regards, Jayadevan

Re: [GENERAL] plpgsql FOR LOOP CTE problem ?

2013-08-12 Thread Day, David
Tom, I feel chagrined, Your absolutely right and your explanation is quite good.. I see my other test case suffered from a similar logic error. Thanks for taking the time to look into it for me. Dave -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Friday, August 09,

[GENERAL] Question about using AggCheckCallContext in a C function

2013-08-12 Thread Matt Solnit
Hi everyone. A while back, I wrote a function to sum array contents (think 1-D matrix addition), and am using it in a custom SUM aggregate. Here's an example: CREATE TABLE foo (arr INT[]); INSERT INTO foo VALUES ('{1, 2, 3}'), ('{4, 5, 6}'); SELECT SUM(arr) FROM foo; sum - {5,7,9

Re: [GENERAL] Question about using AggCheckCallContext in a C function

2013-08-12 Thread Tom Lane
Matt Solnit writes: > After poring over the code in nodeAgg.c, and looking at the in8inc() > function, I think I know what the problem is: the typical use of > AggCheckCallContext() is not compatible with TOAST-able data types. That's nonsense. There are several standard aggregates that use tha

Re: [GENERAL] Question about using AggCheckCallContext in a C function

2013-08-12 Thread Matt Solnit
On Aug 12, 2013, at 11:53 AM, Tom Lane wrote: > Matt Solnit writes: >> After poring over the code in nodeAgg.c, and looking at the in8inc() >> function, I think I know what the problem is: the typical use of >> AggCheckCallContext() is not compatible with TOAST-able data types. > > That's non

Re: [GENERAL] Question about using AggCheckCallContext in a C function

2013-08-12 Thread Tom Lane
Matt Solnit writes: > 2. The function seems to work consistently when I do a SELECT > SUM(mycol) without any GROUP BY. It's only when I add grouping that > the failures happen. I'm not sure if this is a real clue or a red > herring. That isn't enormously surprising, since the memory management

[GENERAL] Why doesn't COPY support the HEADER options for tab-separated output?

2013-08-12 Thread Joe Van Dyk
Mostly just curious, as this is preventing me from using tab-separated output. I'd like there to be a header in my files. I have to use CSVs instead. Joe

Re: [GENERAL] Why doesn't COPY support the HEADER options for tab-separated output?

2013-08-12 Thread Bruce Momjian
On Mon, Aug 12, 2013 at 02:15:25PM -0700, Joe Van Dyk wrote: > Mostly just curious, as this is preventing me from using tab-separated output. > I'd like there to be a header in my files. I have to use CSVs instead. [ "this" means the fact that COPY doesn't support the HEADER option. ] We assume C

Re: [GENERAL] Why doesn't COPY support the HEADER options for tab-separated output?

2013-08-12 Thread Merlin Moncure
On Mon, Aug 12, 2013 at 4:21 PM, Bruce Momjian wrote: > On Mon, Aug 12, 2013 at 02:15:25PM -0700, Joe Van Dyk wrote: >> Mostly just curious, as this is preventing me from using tab-separated >> output. >> I'd like there to be a header in my files. I have to use CSVs instead. > > [ "this" means th

Re: [GENERAL] Why doesn't COPY support the HEADER options for tab-separated output?

2013-08-12 Thread Jeff Janes
On Mon, Aug 12, 2013 at 2:21 PM, Bruce Momjian wrote: > On Mon, Aug 12, 2013 at 02:15:25PM -0700, Joe Van Dyk wrote: >> Mostly just curious, as this is preventing me from using tab-separated >> output. >> I'd like there to be a header in my files. I have to use CSVs instead. > > [ "this" means th

Re: [GENERAL] Why doesn't COPY support the HEADER options for tab-separated output?

2013-08-12 Thread Bruce Momjian
On Mon, Aug 12, 2013 at 03:17:00PM -0700, Jeff Janes wrote: > On Mon, Aug 12, 2013 at 2:21 PM, Bruce Momjian wrote: > > On Mon, Aug 12, 2013 at 02:15:25PM -0700, Joe Van Dyk wrote: > >> Mostly just curious, as this is preventing me from using tab-separated > >> output. > >> I'd like there to be a

Re: [GENERAL] Why doesn't COPY support the HEADER options for tab-separated output?

2013-08-12 Thread Adrian Klaver
On 08/12/2013 02:15 PM, Joe Van Dyk wrote: Mostly just curious, as this is preventing me from using tab-separated output. I'd like there to be a header in my files. I have to use CSVs instead. I am not sure I understand. Do you mean you are converting the file to comma separated or that you ar

Re: [GENERAL] (SOLVED)How To Install Extension Via Script File?

2013-08-12 Thread Don Parris
On Sat, Aug 10, 2013 at 10:05 AM, Tom Lane wrote: > Chris Travers writes: > > As for whether UTF-8 is the default, it is in many cases, but I remember > > struggling with the fact that a few Linux distros still default to > > SQL-ASCII. Ultimately this is something of a packaging issue and the