Re: [GENERAL] Wacky query plan, why?

2003-07-25 Thread Maksim Likharev
Yes I see, no words about FROM cause in SQL92/99, but it seems like Postgres supports that. So bottom line: insted of update prod.t_results set fan = a.fullname, fin=i.fullname from prod.t_results r inner join prod.t_agn a on r.faid = a.aid inner join prod.t_inv i on r.fiid = i

Re: [GENERAL] Using YY-MM-DD date input

2003-07-25 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > But we lose functionality that can't possibily be used in 2003 because > > 03-01-01 doesn't identify 03 as a year. > > This argument is specious. You could equally well use it to justify > removing our support for dd-mm-yy and mm-dd-

Re: [GENERAL] Using YY-MM-DD date input

2003-07-25 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > But we lose functionality that can't possibily be used in 2003 because > 03-01-01 doesn't identify 03 as a year. This argument is specious. You could equally well use it to justify removing our support for dd-mm-yy and mm-dd-yy, because those aren't uni

Re: [GENERAL] Using YY-MM-DD date input

2003-07-25 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > It would be nice to specify the input and output formats independently. > > They are independent now. > > > I think we can sort of do that now, but it isn't clear. When format is > > Postgres, US/European control whether month is fi

Re: [GENERAL] Using YY-MM-DD date input

2003-07-25 Thread Ron Johnson
On Fri, 2003-07-25 at 18:55, Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > It would be nice to specify the input and output formats independently. [snip] > that I'm outvoted on that point). The point I'm trying to make is that > we need to extend input DateStyle so that this appr

Re: [GENERAL] Wacky query plan, why?

2003-07-25 Thread Stephan Szabo
On Fri, 25 Jul 2003, Maksim Likharev wrote: > My be I too spoiled by MS SQL Server, but does'nt > syntax: > > update prod.t_results set expdate=e.termdate from > work.termdate e, prod.t_results r where e.docid=r.docid; > or > update prod.t_results set expdate=e.termdate from > work.ter

Re: [GENERAL] Wacky query plan, why?

2003-07-25 Thread Mike Mascari
Maksim Likharev wrote: > My be I too spoiled by MS SQL Server, but does'nt > syntax: > > update prod.t_results set expdate=e.termdate from > work.termdate e, prod.t_results r where e.docid=r.docid; > or > update prod.t_results set expdate=e.termdate from > work.termdate e inner join

Re: [GENERAL] Using YY-MM-DD date input

2003-07-25 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > It would be nice to specify the input and output formats independently. They are independent now. > I think we can sort of do that now, but it isn't clear. When format is > Postgres, US/European control whether month is first in input and > output. Wh

Re: [GENERAL] Function index qeustion

2003-07-25 Thread Tom Lane
Jonathan Bartlett <[EMAIL PROTECTED]> writes: > 1) If you have an index on a cacheable function, does PostgreSQL use the > index instead of calculating the results? Not in general --- only for an indexscan lookup. > 2) How does PostgreSQL know when to recompute the function? Never. That's what

Re: [GENERAL] Wacky query plan, why?

2003-07-25 Thread Maksim Likharev
My be I too spoiled by MS SQL Server, but does'nt syntax: update prod.t_results set expdate=e.termdate from work.termdate e, prod.t_results r where e.docid=r.docid; or update prod.t_results set expdate=e.termdate from work.termdate e inner join prod.t_results r on e.docid=r.docid;

Re: [GENERAL] Wacky query plan, why?

2003-07-25 Thread Stephan Szabo
On Fri, 25 Jul 2003, Maksim Likharev wrote: > I have 2 queries, one is never returns, like explain shows 677195846.00 > cost > and another doing the same job works ( cost 6072.00 ) > > I do not understand one thing, why query number one, generates so > unbelievably > screwed up plan? > > why

[GENERAL] Function index qeustion

2003-07-25 Thread Jonathan Bartlett
Questions: 1) If you have an index on a cacheable function, does PostgreSQL use the index instead of calculating the results? 2) How does PostgreSQL know when to recompute the function? Jon On Fri, 25 Jul 2003, Elielson Fontanezi wrote: > Thanks a lot! > > The complete solution is here! > > 1s

RES: [GENERAL] ERROR: DefineIndex: index function must be marked iscachable

2003-07-25 Thread Elielson Fontanezi
Thanks a lot! The complete solution is here! 1st. The function wich substitute the trunc() function CREATE OR REPLACE FUNCTION func_cod_secretaria(INTEGER) RETURNS INTEGER AS ' DECLARE v_nr_proponente ALIAS FOR $1; BEGIN return TRUNC(v_nr_proponente/10,0)*10; END; '

Re: [GENERAL] ERROR: DefineIndex: index function must be marked

2003-07-25 Thread Stephan Szabo
On Fri, 25 Jul 2003, Elielson Fontanezi wrote: > Who can help me on that? > > First of all, my envoronment is: > Linux netlab142.prodam 2.4.8-26mdk #1 Sun Sep 23 17:06:39 CEST 2001 > i686 unknown > pg_ctl (PostgreSQL) 7.2. You should definately move to the highest 7.2 rel

[GENERAL] ERROR: DefineIndex: index function must be marked iscachable

2003-07-25 Thread Elielson Fontanezi
Hi!       Who can help me on that?       First of all, my envoronment is:     Linux netlab142.prodam 2.4.8-26mdk #1 Sun Sep 23 17:06:39 CEST 2001 i686 unknown    pg_ctl (PostgreSQL) 7.2.       Problem: ERROR:  DefineIndex: index function must be marked iscachable by executing:   c

Re: [GENERAL] Query analyse

2003-07-25 Thread Tom Lane
Stephan Szabo <[EMAIL PROTECTED]> writes: > You're probably ending up with different plans since in one case it has > a plain column reference and in the other it has a marginally complicated > expression in the join condition. Yeah. 7.3 and before cannot do merge or hash joins on conditions that

RES: [GENERAL] [SQL] ERROR: DefineIndex: index function must be marked iscachable

2003-07-25 Thread Elielson Fontanezi
Oh sorry! Linux netlab142.prodam 2.4.8-26mdk #1 Sun Sep 23 17:06:39 CEST 2001 i686 unknown pg_ctl (PostgreSQL) 7.2.1 -Mensagem original- De: Stephan Szabo [mailto:[EMAIL PROTECTED] Enviada em: sexta-feira, 25 de julho de 2003 16:25 Para: Elielson Fontanezi Cc: pgsql-genera

Re: [GENERAL] [SQL] ERROR: DefineIndex: index function must be

2003-07-25 Thread Stephan Szabo
On Fri, 25 Jul 2003, Stephan Szabo wrote: > On Fri, 25 Jul 2003, Elielson Fontanezi wrote: > > > What can I do in this case? > > I could not found anything about iscachable. > > > > > > postgres$ cat in.sql > > create index bt_proposta_f01 on proposta > > using btree (func_cod_secretaria(n

Re: [GENERAL] [SQL] ERROR: DefineIndex: index function must be marked iscachable

2003-07-25 Thread Stephan Szabo
On Fri, 25 Jul 2003, Elielson Fontanezi wrote: > What can I do in this case? > I could not found anything about iscachable. > > postgres$ cat in.sql > create index bt_proposta_f01 on proposta > using btree (func_cod_secretaria(nr_proponente)); > > postgres$ psql -d escola -f in.sql > psq

[GENERAL] ERROR: DefineIndex: index function must be marked iscachable

2003-07-25 Thread Elielson Fontanezi
Hi all!       What can I do in this case?     I could not found anything about iscachable.   postgres$ cat in.sqlcreate index bt_proposta_f01 on propostausing btree (func_cod_secretaria(nr_proponente)); postgres$ psql -d escola -f in.sqlpsql:in.sql:2: ERROR:  DefineIndex: index function m

Re: [GENERAL] Query analyse

2003-07-25 Thread Dmitry Tkach
The first query is able to use the index on nr_proponente, because the condition involves that column directly, the second query is not, because the index only contains the values of nt_proponente, not results of trunc(..)/ Try replacing that condition with something like pa.nr_proponente B

Re: [GENERAL] Can I turn the case sensitive off

2003-07-25 Thread Terence Chang
This is exactly what I was doing. I use PostgreSQL Manager Pro. The tool covert all my column name and table name in the double quote. So I have all my column/table/function created in upper case (Oracle habit). Now, I have to quote all of them. I should stay with psql, I guess. :-) Thanks! At le

Re: [GENERAL] Can I turn the case sensitive off

2003-07-25 Thread Tom Lane
Ron Johnson <[EMAIL PROTECTED]> writes: > On Fri, 2003-07-25 at 07:28, Andrew Sullivan wrote: >> The docs have it in a footnote: >> http://candle.pha.pa.us/main/writings/pgsql/sgml/sql-syntax.html#FTN.AEN1031 >> >> PostgreSQL's approach is backwards from the standard. > Is there any firm discu

Re: [GENERAL] Solaris, Postgresql and Problems

2003-07-25 Thread Doug McNaught
Errol Neal <[EMAIL PROTECTED]> writes: > After making this change, and increasing the max number of buffers to > 128 and the max number of connections to 64, I rebooted my > system. Things come up fine, Postgres seems happy, but shortly after > the Postgres server dies or terminates with nothing

Re: [GENERAL] How to encrypt data in Postgresql

2003-07-25 Thread Richard Welty
On Fri, 25 Jul 2003 09:33:30 -0400 "Reuben D. Budiardja" <[EMAIL PROTECTED]> wrote: > I think if you encrypt MD5 before storing it into the table, then there > is no > way to retrieve the corresponding clear text right? since MD5 is one-way > encryption.. yes, but normally when doing passwords,

Re: [GENERAL] Hardware selection

2003-07-25 Thread Ron Johnson
On Fri, 2003-07-25 at 07:42, [EMAIL PROTECTED] wrote: > As mentioned previously I have a large text database with upwards of > 40GB of data and 8 million tuples. > > The time has come to buy some real hardware for it. > > Having read around the subject online I see the general idea is to get >

Re: [GENERAL] Can I turn the case sensitive off

2003-07-25 Thread Reuben D. Budiardja
On Friday 25 July 2003 02:37 am, Thomas Kellerer wrote: > Terence Chang schrieb: > > I am still getting the error. would this matter with 7.3.3 on windows > > with cygwin? > > From my experience I'd never user quotes at any place (neither during > creation of the table nor in the SELECT, UPDATE st

Re: [GENERAL] Which file belongs to which database?

2003-07-25 Thread Tom Lane
Thomas Kellerer <[EMAIL PROTECTED]> writes: > Shridhar Daithankar schrieb: >> You can just find the oid of the object from catalog and search for that >> file. That's the principle. > That easy ? :-) Actually you must look at pg_class.relfilenode; this is initially the same as oid, but there are

Re: [GENERAL] How to encrypt data in Postgresql

2003-07-25 Thread Reuben D. Budiardja
On Thursday 24 July 2003 02:59 pm, Franco Bruno Borghesi wrote: > You must install pgcrypto (its in your contrib/pgcrypto directory). > > Then, the functions crypt and gen_salt will become available. > > As an example, to insert a new user (peter) with an encrypted password > (1234) you can do: > I

[GENERAL] Solaris, Postgresql and Problems

2003-07-25 Thread Errol Neal
Hi All, I have posted this before, but have not yet got any resolutions on it. I am hoping someone with experience can help me out. I am running Postgresql 7.3.2 on Solaris 5.9. I am trying to increase the number of max connections for postgresql but it but I am having some issue. After reading

Re: [GENERAL] Can I turn the case sensitive off

2003-07-25 Thread Ron Johnson
On Fri, 2003-07-25 at 07:28, Andrew Sullivan wrote: > On Thu, Jul 24, 2003 at 04:34:26PM -0700, Terence Chang wrote: > > All: > > > > I don't remember I even seen a document saying PostgreSQL are case > > sensitive. I just figure out that my column name are case > > The docs have it in a footnote

[GENERAL] Hardware selection

2003-07-25 Thread psql-mail
As mentioned previously I have a large text database with upwards of 40GB of data and 8 million tuples. The time has come to buy some real hardware for it. Having read around the subject online I see the general idea is to get as much memory and the fastest I/O possible. The buget for the serv

Re: [GENERAL] Can I turn the case sensitive off

2003-07-25 Thread Andrew Sullivan
On Thu, Jul 24, 2003 at 04:34:26PM -0700, Terence Chang wrote: > All: > > I don't remember I even seen a document saying PostgreSQL are case > sensitive. I just figure out that my column name are case The docs have it in a footnote: http://candle.pha.pa.us/main/writings/pgsql/sgml/sql-syntax.htm

[GENERAL] plPython and restricted execution issues

2003-07-25 Thread JX
Hi. I've made a small stored procedure un PL/python. This procedure retrieve python code from a row then execute it and calls a predefined function. Alls works well while no others functions are defined and called in the row retrieved code; I mean when I define the row retrieved co

Re: [GENERAL] Which file belongs to which database?

2003-07-25 Thread Thomas Kellerer
Shridhar Daithankar schrieb: On 25 Jul 2003 at 8:45, Thomas Kellerer wrote: just out of curiosity: how can I find out which files in the PG_DATA directory belong to which database/table? There is a contrib module oid2name. Use that. You can just find the oid of the object from catalog and search

Re: [GENERAL] Which file belongs to which database?

2003-07-25 Thread Karsten Hilbert
> just out of curiosity: how can I find out which files in the PG_DATA > directory belong to which database/table? > > I have looked through the documentation of the system catalogs, but couldn't you should also look through the mailing list archives... Karsten -- GPG key ID E4071346 @ wwwkeys

Re: [GENERAL] Which file belongs to which database?

2003-07-25 Thread Shridhar Daithankar
On 25 Jul 2003 at 8:45, Thomas Kellerer wrote: > just out of curiosity: how can I find out which files in the PG_DATA directory > belong to which database/table? There is a contrib module oid2name. Use that. You can just find the oid of the object from catalog and search for that file. That's t