[GENERAL] aggregate planning with partitions

2007-03-06 Thread Jonathan Ellis
I have a table, "connection_events", partitioned via inheritance on a column "logtime." I'm running 8.2. Mostly the partitioning works pretty well. I have noticed though that the query select max(logtime) from connection_events always uses seq_scan across all partitions, which is painful. (Re

[GENERAL] forcing compression of text field

2006-12-11 Thread Jonathan Ellis
gives about 50% savings), but is there a way to force pg's own compression before I resort to this? -- Jonathan Ellis http://spyced.blogspot.com ---(end of broadcast)--- TIP 6: explain analyze is your friend

[GENERAL] Re: Find out when a table was last changed ?

2001-03-02 Thread Jonathan Ellis
Better yet, define a trigger so you and/or other programmers don't have to worry about including that field in every update. -Jonathan - Original Message - From: Anand Raman <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 27, 2001 8:28 PM Subject: Re: Find out when a

Re: [GENERAL] ERD on the cheap?

2000-12-13 Thread Jonathan Ellis
> I putting together a small (10 tables) postgresgl database for a non-profit > organization, and would like to use an entity relationship diagram > tool. They would like to be maintain it in the future, using a tool that > preferably runs on a Windows client. Are there any decent tools availabl

Re: [GENERAL] Oracle-compatible lpad/rpad behavior

2000-12-08 Thread Jonathan Ellis
> Returns not empty string but NULL: The two are equivalent in Oracle. Try select 'a' || null || 'b' from dual and compare it to postgres. -Jonathan

[GENERAL] Re: [SQL] Requests for Development

2000-11-17 Thread Jonathan Ellis
> > Part of this document will be on how to port Oracle PL/SQL to > > Postgres' PL/SQL and PL/Tcl. > > Excellent. Now we need someone to do the MySQL version... ? MySQL doesn't have stored procedures AFAIK. -Jonathan

Re: [GENERAL] Stupid SQL Question:

2000-11-14 Thread Jonathan Ellis
> Adding a WHERE clause to the query doesn't work for example: > > SELECT outcome,count(outcome) from safety > GROUP BY outcome > WHERE InjDate='2000-11'14'; A WHERE clause must come before a GROUP BY clause. Also note that if you are using a table with the row defined as datetime instead of dat

[GENERAL] How do you call one pltcl procedure from another?

2000-11-07 Thread Jonathan Ellis
I defined a procedure CREATE FUNCTION meta_class (varchar) RETURNS varchar AS ' ... ' LANGUAGE 'pltcl'; This works fine. But when I want to call it from another tcl procedure I get errors: bf2=# CREATE FUNCTION foo (varchar) RETURNS varchar AS ' return [meta_class $1] ' LANGUAGE 'pltcl'; b

[GENERAL] how do you call one pltcl function from another?

2000-11-07 Thread Jonathan Ellis
I tried mailing this last week, but I think it didn't get sent: I defined a procedure CREATE FUNCTION meta_class (varchar) RETURNS varchar AS ' ... ' LANGUAGE 'pltcl'; This works fine. But when I want to call it from another tcl procedure I get errors: bf2=# CREATE FUNCTION foo (varchar) RETUR

[GENERAL] Bug in how nulls are handled by plpgsql?

2000-11-06 Thread Jonathan Ellis
bf2=# create function foo (varchar, varchar) returns varchar as ' begin return $1; end; ' language 'plpgsql'; bf2'# bf2'# bf2'# bf2'# CREATE bf2=# bf2=# select foo('asdf', null) from dual; foo - (1 row) Even though the function foo never references the null, apparently postgres thinks,

[GENERAL] psql defaults file?

2000-11-01 Thread Jonathan Ellis
I couldn't find anything in the man page about this -- does psql check for ~/.psql or anything so I don't have to manually --pset pager=off every time I run it? If there is such a file, what is the format for specifying options? -Jonathan