Re: [SQL] [NOVICE] Functional index problems. (Was: Many joins: monthly summaries S-L--O--W)

2003-10-22 Thread Josh Berkus
Michael, > My final thought would be to continue using "functional index", noting > that operators are a special class of function. Out of the above > description of "value expression", I believe only functions and > operators are allowed as expressions in the CREATE INDEX syntax, > correct? (

Re: [SQL] Query planner: current_* vs. explicit date

2003-10-22 Thread Tom Lane
Josh Berkus <[EMAIL PROTECTED]> writes: >> I'd guess that the planner doesn't know what current_date::timestamp is >> ahead of time, so it chooses a seq scan. > Yes, this is a known problem. There was a single-query workaround, but I > can't remember it right now. Right; the problem from the p

Re: [SQL] Expressional Indexes

2003-10-22 Thread Peter Eisentraut
Tom Lane writes: > Mainly that "expressional" is a made-up word. At least it's better than "functional index", because I had always wondered where the dysfunctional indexes went. :) I like "expression index". -- Peter Eisentraut [EMAIL PROTECTED] ---(end of broadcas

Re: [SQL] Expressional Indexes

2003-10-22 Thread Bruce Momjian
Josh Berkus wrote: > Tom, > > > Mainly that "expressional" is a made-up word. > > So? We're in the tech biz, Tom. New-coined words are expected. And that > way nobody will expect it to mean something else, since we made it up. > -- H. Dumpty, Q.E.D. > > > I have been considering using "ca

Re: [SQL] Query planner: current_* vs. explicit date

2003-10-22 Thread Josh Berkus
Scott, Chris, > I'd guess that the planner doesn't know what current_date::timestamp is > ahead of time, so it chooses a seq scan. Yes, this is a known problem. There was a single-query workaround, but I can't remember it right now. -- -Josh Berkus Aglio Database Solutions San Francisco

Re: [SQL] Expressional Indexes

2003-10-22 Thread Josh Berkus
Tom, > Mainly that "expressional" is a made-up word. So? We're in the tech biz, Tom. New-coined words are expected. And that way nobody will expect it to mean something else, since we made it up. -- H. Dumpty, Q.E.D. > I have been considering using "calculated index" or "computed index" >

Re: [SQL] Expressional Indexes

2003-10-22 Thread Josh Berkus
Tom, Jumping lists, NOVICE is unlikely to have an opinion about this. > I'm not particularly happy with the phrase "expressional index", and > would like to think of something else to use before the 7.4 docs go > final. Any ideas? Hmmm ... well, actually, I like "Expressional Indexes". What's

Re: [SQL] Query planner: current_* vs. explicit date

2003-10-22 Thread scott.marlowe
I'd guess that the planner doesn't know what current_date::timestamp is ahead of time, so it chooses a seq scan. On Wed, 22 Oct 2003, Chris Gamache wrote: > PsotgreSQL 7.2.4: > > Query planner is behaving strangely. It operates differently for explicit dates > and derived dates... any ideas on

Re: [SQL] Expressional Indexes

2003-10-22 Thread Tom Lane
Josh Berkus <[EMAIL PROTECTED]> writes: >> I'm not particularly happy with the phrase "expressional index", and >> would like to think of something else to use before the 7.4 docs go >> final. Any ideas? > Hmmm ... well, actually, I like "Expressional Indexes". What's wrong > with it? Mainly t

[SQL] Query planner: current_* vs. explicit date

2003-10-22 Thread Chris Gamache
PsotgreSQL 7.2.4: Query planner is behaving strangely. It operates differently for explicit dates and derived dates... any ideas on why? ( and why I might not have noticed this before... ) CREATE TABLE trans_table ( id serial, user_name varchar(50), trans_type varchar(50), trans_data v

Re: [SQL] see a current query

2003-10-22 Thread Rod Taylor
On Wed, 2003-10-22 at 05:26, sad wrote: > Hello > > i'am logged in as superuser (pgsql) > trying to > SELECT * FROM pg_stat_activity; > and seeing NULLs instead of current_query column& You need to change the stats settings in postgresql.conf. By default the current query is not enabled as it d

Re: [SQL] Timestamp

2003-10-22 Thread Theodore Petrosky
Check this out http://www.postgresql.org/docs/7.3/static/functions-formatting.html to_char(departure, 'MM-DD- HH24:MI:SS') as newformatdeparture Ted --- Abdul Wahab Dahalan <[EMAIL PROTECTED]> wrote: > Hi ! > In my database I've a field "departure" with > timestamp without time zone >

[SQL] see a current query

2003-10-22 Thread sad
Hello i'am logged in as superuser (pgsql) trying to SELECT * FROM pg_stat_activity; and seeing NULLs instead of current_query column& What is it? ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [SQL] Timestamp

2003-10-22 Thread achill
On Wed, 22 Oct 2003, Abdul Wahab Dahalan wrote: > Hi ! > In my database I've a field "departure" with timestamp without time zone > data type. > eg : > departure > 2003-11-01 14:29:46 Maybe SET DateStyle TO 'German' ; SELECT replace(departure,'.','-') from ; is close to what you want, but be

Re: [SQL] Timestamp

2003-10-22 Thread Tomasz Myrta
Dnia 2003-10-22 10:02, Użytkownik Abdul Wahab Dahalan napisał: Hi ! In my database I've a field "departure" with timestamp without time zone data type. eg : departure 2003-11-01 14:29:46 Now I want to select it as in this format 01-11-2003 14:29:46 How should I do it?. You can find it in docume

[SQL] Timestamp

2003-10-22 Thread Abdul Wahab Dahalan
Hi ! In my database I've a field "departure" with timestamp without time zone data type. eg : departure 2003-11-01 14:29:46 Now I want to select it as in this format 01-11-2003 14:29:46 How should I do it?. Thank you for any help. ---(end of broadcast)--