Re: [SQL] How to store a password encripted in a user defined table
On 3/1/07, Eugenio Flores <[EMAIL PROTECTED]> wrote: Hello, I wonder if somebody knows how to store passwords in a column that is part of a user defined table. Assuming that your passwords are application specific use a sha1 or md5 algorithm (depending on how sensitive your data is) and store that in a varchar or char field. When the user authenticates the password gets hashed in the app and compared against the stored hash. Cheers, Andrej ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [SQL] How to store a password encripted in a user defined table
Thanks Andrej. But how can I use such algoritms in postgresql? arey they defined in a function that I can call? Or, do I have to code one of those algorithm to use it in my application? - Mensaje original De: Andrej Ricnik-Bay <[EMAIL PROTECTED]> Para: Eugenio Flores <[EMAIL PROTECTED]>; PostgreSQL Enviado: jueves, 1 de marzo, 2007 0:21:06 Asunto: Re: [SQL] How to store a password encripted in a user defined table On 3/1/07, Eugenio Flores <[EMAIL PROTECTED]> wrote: > Hello, I wonder if somebody knows how to store passwords in a > column that is part of a user defined table. Assuming that your passwords are application specific use a sha1 or md5 algorithm (depending on how sensitive your data is) and store that in a varchar or char field. When the user authenticates the password gets hashed in the app and compared against the stored hash. Cheers, Andrej ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match ___ Do You Yahoo!? La mejor conexión a Internet y 2GB extra a tu correo por $100 al mes. http://net.yahoo.com.mx
Re: [SQL] How to union table without union statement?
calendarw wrote: Hi, I am using the following query now, but the time is too slow. could anyone can help me? CREATE OR REPLACE VIEW alllogview AS ((( SELECT alarmdtl.tagname, a_alarmtbl.occurtime, a_alarmtbl.restoretime, a_alarmtbl.ack, alarmdtl.alarmtype, alarmdtl.alarmmsg1, alarmdtl.alarmmsg2, alarmdtl.alarmloc FROM a_alarmtbl, alarmdtl WHERE a_alarmtbl.tagname::text = alarmdtl.tagname::text UNION ALL SELECT alarmdtl.tagname, b_alarmtbl.occurtime, b_alarmtbl.restoretime, b_alarmtbl.ack, alarmdtl.alarmtype, alarmdtl.alarmmsg1, alarmdtl.alarmmsg2, alarmdtl.alarmloc FROM b_alarmtbl, alarmdtl WHERE b_alarmtbl.tagname::text = alarmdtl.tagname::text) UNION ALL SELECT alarmdtl.tagname, c_alarmtbl.occurtime, c_alarmtbl.restoretime, c_alarmtbl.ack, alarmdtl.alarmtype, alarmdtl.alarmmsg1, alarmdtl.alarmmsg2, alarmdtl.alarmloc FROM c_alarmtbl, alarmdtl WHERE c_alarmtbl.tagname::text = alarmdtl.tagname::text) UNION ALL SELECT alarmdtl.tagname, d_alarmtbl.occurtime, d_alarmtbl.restoretime, d_alarmtbl.ack, alarmdtl.alarmtype, alarmdtl.alarmmsg1, alarmdtl.alarmmsg2, alarmdtl.alarmloc FROM d_alarmtbl, alarmdtl WHERE d_alarmtbl.tagname::text = alarmdtl.tagname::text) UNION ALL SELECT alarmdtl.tagname, e_alarmtbl.occurtime, e_alarmtbl.restoretime, e_alarmtbl.ack, alarmdtl.alarmtype, alarmdtl.alarmmsg1, alarmdtl.alarmmsg2, alarmdtl.alarmloc FROM e_alarmtbl, alarmdtl WHERE e_alarmtbl.tagname::text = alarmdtl.tagname::text) UNION ALL SELECT alarmdtl.tagname, f_alarmtbl.occurtime, f_alarmtbl.restoretime, f_alarmtbl.ack, alarmdtl.alarmtype, alarmdtl.alarmmsg1, alarmdtl.alarmmsg2, alarmdtl.alarmloc FROM f_alarmtbl, alarmdtl WHERE f_alarmtbl.tagname::text = alarmdtl.tagname::text) UNION ALL SELECT alarmdtl.tagname, g_alarmtbl.occurtime, g_alarmtbl.restoretime, g_alarmtbl.ack, alarmdtl.alarmtype, alarmdtl.alarmmsg1, alarmdtl.alarmmsg2, alarmdtl.alarmloc FROM g_alarmtbl, alarmdtl WHERE g_alarmtbl.tagname::text = alarmdtl.tagname::text) UNION ALL SELECT alarmdtl.tagname, h_alarmtbl.occurtime, h_alarmtbl.restoretime, h_alarmtbl.ack, alarmdtl.alarmtype, alarmdtl.alarmmsg1, alarmdtl.alarmmsg2, alarmdtl.alarmloc FROM h_alarmtbl, alarmdtl WHERE h_alarmtbl.tagname::text = alarmdtl.tagname::text) UNION ALL SELECT alarmdtl.tagname, i_alarmtbl.occurtime, i_alarmtbl.restoretime, i_alarmtbl.ack, alarmdtl.alarmtype, alarmdtl.alarmmsg1, alarmdtl.alarmmsg2, alarmdtl.alarmloc FROM i_alarmtbl, alarmdtl WHERE i_alarmtbl.tagname::text = alarmdtl.tagname::text ORDER BY 1; Have you done an EXPLAIN on the query? Is there an index on the tagname columns? If so does the EXPLAIN show them being used? How many rows do you have in each table (roughly)? Have you considered other structure options like partitioning? Is there a real need to have these tables separate? or could you have them all in one table with an column to identify the source of the log entry? On 2/28/07, Hiltibidal, Robert <[EMAIL PROTECTED]> wrote: Can you provide a schema? -- *From:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *On Behalf Of *calendarw *Sent:* Wednesday, February 28, 2007 4:33 AM *To:* pgsql-sql@postgresql.org *Subject:* [SQL] How to union table without union statement? Hi, I need to combine 10 tables which contain same table structure and join an "other table" to show the latest 200 record, I am join the "other table" first and using union statement to select all record now but the collection time is super slow, how can I improve the collection speed? Thanks. -- Jr. P calendarw PRIVILEGED AND CONFIDENTIAL This email transmission contains privileged and confidential information intended only for the use of the individual or entity named above. If the reader of the email is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any use, dissemination or copying of this email transmission is strictly prohibited by the sender. If you have received this transmission in error, please delete the email and immediately notify the sender via the email return address or mailto:[EMAIL PROTECTED] Thank you. -- Shane Ambler [EMAIL PROTECTED] Get Sheeky @ http://Sheeky.Biz ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [SQL] How to store a password encripted in a user defined table
Andrej Ricnik-Bay wrote: On 3/1/07, Eugenio Flores <[EMAIL PROTECTED]> wrote: Hello, I wonder if somebody knows how to store passwords in a column that is part of a user defined table. Assuming that your passwords are application specific use a sha1 or md5 algorithm (depending on how sensitive your data is) and store that in a varchar or char field. When the user authenticates the password gets hashed in the app and compared against the stored hash. If you want the server to take care of it look at pgcrypto - you will find it in the contrib folder of the source distro. This doesn't give you an encrypted data type (but you could set that up if you wish) it will give you functions that you can use. Of course that would mean they get sent through the client connection as clear text unless you are using an SSL client connection. -- Shane Ambler [EMAIL PROTECTED] Get Sheeky @ http://Sheeky.Biz ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [SQL] How to store a password encripted in a user defined table
MD5 is built-in to PostgreSQL. It is what PostgreSQL itself uses to hash passwords. For example: select md5('this is my password'); md5 -- 210d53992dff432ec1b1a9698af9da16 (1 row) On Mar 1, 2007, at 6:06 AM, Eugenio Flores wrote: Thanks Andrej. But how can I use such algoritms in postgresql? arey they defined in a function that I can call? Or, do I have to code one of those algorithm to use it in my application? John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [SQL] How to store a password encripted in a user definedtable
Maybe a little example - create a table with two columns: username and password (eg. tbl_users) - in a secure environment (thus not over the internet) insert records into the table INSERT INTO tbl_users(username, password) VALUES ('John', md5('johnspassword')) - make a website with a login page (= a form with two fields: frm_username and frm_password) - let a javascript md5 function hash the password before sending the form field values to the webserver that way the password doensn't go over the internet in an unprotected way - let your webserver (eg with php) compare the received password (= hashed) with the one in tbl_users select count(*) from tbl_users where username = [value from frm_username] and password = [value from frm_password] if the password is ok then count will be 1 - the user has been authenticated and can go on now you can start a session in your website, etc etc if count was 0 you should resent the login form with a notice "wrong password" >>> John DeSoi <[EMAIL PROTECTED]> 2007-03-01 14:25 >>> MD5 is built-in to PostgreSQL. It is what PostgreSQL itself uses to hash passwords. For example: select md5('this is my password'); md5 -- 210d53992dff432ec1b1a9698af9da16 (1 row) On Mar 1, 2007, at 6:06 AM, Eugenio Flores wrote: > Thanks Andrej. But how can I use such algoritms in postgresql? arey > they defined in a function that I can call? > > Or, do I have to code one of those algorithm to use it in my > application? John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [SQL] How to store a password encripted in a user defined table
John, That was what I was looking for for a long time. Now I will change my teller password account to md5. Could someone suggest me how to change all passwords (PLAIN) to md5 ? My real best regards Ezequias 2007/3/1, John DeSoi <[EMAIL PROTECTED]>: MD5 is built-in to PostgreSQL. It is what PostgreSQL itself uses to hash passwords. For example: select md5('this is my password'); md5 -- 210d53992dff432ec1b1a9698af9da16 (1 row) On Mar 1, 2007, at 6:06 AM, Eugenio Flores wrote: > Thanks Andrej. But how can I use such algoritms in postgresql? arey > they defined in a function that I can call? > > Or, do I have to code one of those algorithm to use it in my > application? John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Atenciosamente (Sincerely) Ezequias Rodrigues da Rocha =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- A pior das democracias ainda é melhor do que a melhor das ditaduras The worst of democracies is still better than the better of dictatorships http://ezequiasrocha.blogspot.com/ ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [SQL] How to store a password encripted in a user definedtable
update yourtable set passwordfield = md5(passwordfield) watch out: md5 is irreversable! you can't "un_md5" >>> "Ezequias Rodrigues da Rocha" <[EMAIL PROTECTED]> 2007-03-01 15:08 >>> John, That was what I was looking for for a long time. Now I will change my teller password account to md5. Could someone suggest me how to change all passwords (PLAIN) to md5 ? My real best regards Ezequias 2007/3/1, John DeSoi <[EMAIL PROTECTED]>: > MD5 is built-in to PostgreSQL. It is what PostgreSQL itself uses to > hash passwords. For example: > > select md5('this is my password'); > > md5 > -- > 210d53992dff432ec1b1a9698af9da16 > (1 row) > > > > On Mar 1, 2007, at 6:06 AM, Eugenio Flores wrote: > > > Thanks Andrej. But how can I use such algoritms in postgresql? arey > > they defined in a function that I can call? > > > > Or, do I have to code one of those algorithm to use it in my > > application? > > > > John DeSoi, Ph.D. > http://pgedit.com/ > Power Tools for PostgreSQL > > > ---(end of broadcast)--- > TIP 9: In versions below 8.0, the planner will ignore your desire to >choose an index scan if your joining column's datatypes do not >match > -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Atenciosamente (Sincerely) Ezequias Rodrigues da Rocha =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- A pior das democracias ainda é melhor do que a melhor das ditaduras The worst of democracies is still better than the better of dictatorships http://ezequiasrocha.blogspot.com/ ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [SQL] How to store a password encripted in a user definedtable
I know it. Thank you so much. Ezequias Grettings from Brazil. 2007/3/1, Bart Degryse <[EMAIL PROTECTED]>: update yourtable set passwordfield = md5(passwordfield) watch out: md5 is irreversable! you can't "un_md5" >>> "Ezequias Rodrigues da Rocha" <[EMAIL PROTECTED]> 2007-03-01 15:08 >>> John, That was what I was looking for for a long time. Now I will change my teller password account to md5. Could someone suggest me how to change all passwords (PLAIN) to md5 ? My real best regards Ezequias 2007/3/1, John DeSoi <[EMAIL PROTECTED]>: > MD5 is built-in to PostgreSQL. It is what PostgreSQL itself uses to > hash passwords. For example: > > select md5('this is my password'); > > md5 > -- > 210d53992dff432ec1b1a9698af9da16 > (1 row) > > > > On Mar 1, 2007, at 6:06 AM, Eugenio Flores wrote: > > > Thanks Andrej. But how can I use such algoritms in postgresql? arey > > they defined in a function that I can call? > > > > Or, do I have to code one of those algorithm to use it in my > > application? > > > > John DeSoi, Ph.D. > http://pgedit.com/ > Power Tools for PostgreSQL > > > ---(end of broadcast)--- > TIP 9: In versions below 8.0, the planner will ignore your desire to >choose an index scan if your joining column's datatypes do not >match > ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [SQL] How to store a password encripted in a user definedtable
Just another thing. Why md5 function return a different string from user role of postgresql ? It allways put an md5 string concated with another sequence of string. Why does it occurs ? Ezequias 2007/3/1, Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]>: I know it. Thank you so much. Ezequias Grettings from Brazil. 2007/3/1, Bart Degryse <[EMAIL PROTECTED]>: > > > update yourtable set passwordfield = md5(passwordfield) > > watch out: md5 is irreversable! you can't "un_md5" > > > >>> "Ezequias Rodrigues da Rocha" <[EMAIL PROTECTED]> 2007-03-01 > 15:08 >>> > > John, > > That was what I was looking for for a long time. > > Now I will change my teller password account to md5. > > Could someone suggest me how to change all passwords (PLAIN) to md5 ? > > My real best regards > Ezequias > > 2007/3/1, John DeSoi <[EMAIL PROTECTED]>: > > MD5 is built-in to PostgreSQL. It is what PostgreSQL itself uses to > > hash passwords. For example: > > > > select md5('this is my password'); > > > > md5 > > -- > > 210d53992dff432ec1b1a9698af9da16 > > (1 row) > > > > > > > > On Mar 1, 2007, at 6:06 AM, Eugenio Flores wrote: > > > > > Thanks Andrej. But how can I use such algoritms in postgresql? arey > > > they defined in a function that I can call? > > > > > > Or, do I have to code one of those algorithm to use it in my > > > application? > > > > > > > > John DeSoi, Ph.D. > > http://pgedit.com/ > > Power Tools for PostgreSQL > > > > > > ---(end of > broadcast)--- > > TIP 9: In versions below 8.0, the planner will ignore your desire to > >choose an index scan if your joining column's datatypes do not > >match > > -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Atenciosamente (Sincerely) Ezequias Rodrigues da Rocha =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- A pior das democracias ainda é melhor do que a melhor das ditaduras The worst of democracies is still better than the better of dictatorships http://ezequiasrocha.blogspot.com/ ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
Re: [SQL] How to store a password encripted in a userdefinedtable
It doesn't do that for me. I've tried it on three different databases (of two different versions) as three different users and the result is always the same (as it should be): select USER, md5('password') current_usermd5 bigdbuser 5f4dcc3b5aa765d61d8327deb882cf99 current_usermd5 bigdbsys5f4dcc3b5aa765d61d8327deb882cf99 current_usermd5 logstocksys 5f4dcc3b5aa765d61d8327deb882cf99 Show us some statements. >>> "Ezequias Rodrigues da Rocha" <[EMAIL PROTECTED]> 2007-03-01 16:02 >>> Just another thing. Why md5 function return a different string from user role of postgresql ? It allways put an md5 string concated with another sequence of string. Why does it occurs ? Ezequias 2007/3/1, Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]>: > I know it. Thank you so much. > > Ezequias > Grettings from Brazil. > > 2007/3/1, Bart Degryse <[EMAIL PROTECTED]>: > > > > > > update yourtable set passwordfield = md5(passwordfield) > > > > watch out: md5 is irreversable! you can't "un_md5" > > > > > > >>> "Ezequias Rodrigues da Rocha" <[EMAIL PROTECTED]> 2007-03-01 > > 15:08 >>> > > > > John, > > > > That was what I was looking for for a long time. > > > > Now I will change my teller password account to md5. > > > > Could someone suggest me how to change all passwords (PLAIN) to md5 ? > > > > My real best regards > > Ezequias > > > > 2007/3/1, John DeSoi <[EMAIL PROTECTED]>: > > > MD5 is built-in to PostgreSQL. It is what PostgreSQL itself uses to > > > hash passwords. For example: > > > > > > select md5('this is my password'); > > > > > > md5 > > > -- > > > 210d53992dff432ec1b1a9698af9da16 > > > (1 row) > > > > > > > > > > > > On Mar 1, 2007, at 6:06 AM, Eugenio Flores wrote: > > > > > > > Thanks Andrej. But how can I use such algoritms in postgresql? arey > > > > they defined in a function that I can call? > > > > > > > > Or, do I have to code one of those algorithm to use it in my > > > > application? > > > > > > > > > > > > John DeSoi, Ph.D. > > > http://pgedit.com/ > > > Power Tools for PostgreSQL > > > > > > > > > ---(end of > > broadcast)--- > > > TIP 9: In versions below 8.0, the planner will ignore your desire to > > >choose an index scan if your joining column's datatypes do not > > >match > > > > -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Atenciosamente (Sincerely) Ezequias Rodrigues da Rocha =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- A pior das democracias ainda é melhor do que a melhor das ditaduras The worst of democracies is still better than the better of dictatorships http://ezequiasrocha.blogspot.com/
Re: [SQL] pg_dump inquiry
Karthikeyan Sundaram escreveu: Hi, I have to dump only 10 tables out of 100 tables. In the pg_dump utility given by postgres there is an option called -t followed by table name. In that option, if I give more than 1 table, it's not accepting. How can I get the dump in one stroke for all the 10 tables? Please advise. http://www.postgresql.org/docs/8.2/interactive/app-pgdump.html "Multiple tables can be selected by writing multiple -t switches. Also, the table parameter is interpreted as a pattern according to the same rules used by psql's \d commands (see Patterns), so multiple tables can also be selected by writing wildcard characters in the pattern." []s Osvaldo ___ Yahoo! Mail - Sempre a melhor opção para você! Experimente já e veja as novidades. http://br.yahoo.com/mailbeta/tudonovo/ ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Re: [SQL] pg_dump inquiry
On Thu, 2007-03-01 at 12:30 -0300, Osvaldo Rosario Kussama wrote: > http://www.postgresql.org/docs/8.2/interactive/app-pgdump.html > "Multiple tables can be selected by writing multiple -t switches. Also, > the table parameter is interpreted as a pattern according to the same > rules used by psql's \d commands (see Patterns), so multiple tables can > also be selected by writing wildcard characters in the pattern." But note that this is a new feature in 8.2. In 8.1 and earlier, multiple -t switches will only get you the last one specified. Joe ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [SQL] How to store a password encripted in a userdefinedtable
I am just passing the database owner password (postgresql autentication) to the statement: Select md5('the password I have in my mind') and compare with the password pgAdmin3 shows me. They are completely different. Ezequias 2007/3/1, Bart Degryse <[EMAIL PROTECTED]>: It doesn't do that for me. I've tried it on three different databases (of two different versions) as three different users and the result is always the same (as it should be): select USER, md5('password') current_usermd5 bigdbuser 5f4dcc3b5aa765d61d8327deb882cf99 current_usermd5 bigdbsys5f4dcc3b5aa765d61d8327deb882cf99 current_usermd5 logstocksys 5f4dcc3b5aa765d61d8327deb882cf99 Show us some statements. >>> "Ezequias Rodrigues da Rocha" <[EMAIL PROTECTED]> 2007-03-01 16:02 >>> Just another thing. Why md5 function return a different string from user role of postgresql ? It allways put an md5 string concated with another sequence of string. Why does it occurs ? Ezequias 2007/3/1, Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]>: > I know it. Thank you so much. > > Ezequias > Grettings from Brazil. > > 2007/3/1, Bart Degryse <[EMAIL PROTECTED]>: > > > > > > update yourtable set passwordfield = md5(passwordfield) > > > > watch out: md5 is irreversable! you can't "un_md5" > > > > > > >>> "Ezequias Rodrigues da Rocha" <[EMAIL PROTECTED]> 2007-03-01 > > 15:08 >>> > > > > John, > > > > That was what I was looking for for a long time. > > > > Now I will change my teller password account to md5. > > > > Could someone suggest me how to change all passwords (PLAIN) to md5 ? > > > > My real best regards > > Ezequias > > > > 2007/3/1, John DeSoi <[EMAIL PROTECTED]>: > > > MD5 is built-in to PostgreSQL. It is what PostgreSQL itself uses to > > > hash passwords. For example: > > > > > > select md5('this is my password'); > > > > > > md5 > > > -- > > > 210d53992dff432ec1b1a9698af9da16 > > > (1 row) > > > > > > > > > > > > On Mar 1, 2007, at 6:06 AM, Eugenio Flores wrote: > > > > > > > Thanks Andrej. But how can I use such algoritms in postgresql? arey > > > > they defined in a function that I can call? > > > > > > > > Or, do I have to code one of those algorithm to use it in my > > > > application? > > > > > > > > > > > > John DeSoi, Ph.D. > > > http://pgedit.com/ > > > Power Tools for PostgreSQL > > > > > > > > > ---(end of > > broadcast)--- > > > TIP 9: In versions below 8.0, the planner will ignore your desire to > > >choose an index scan if your joining column's datatypes do not > > >match > > > > -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Atenciosamente (Sincerely) Ezequias Rodrigues da Rocha =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- A pior das democracias ainda é melhor do que a melhor das ditaduras The worst of democracies is still better than the better of dictatorships http://ezequiasrocha.blogspot.com/ -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Atenciosamente (Sincerely) Ezequias Rodrigues da Rocha =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- A pior das democracias ainda é melhor do que a melhor das ditaduras The worst of democracies is still better than the better of dictatorships http://ezequiasrocha.blogspot.com/ ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [SQL] How to store a password encripted in a userdefinedtable
Ezequias Rodrigues da Rocha wrote: I am just passing the database owner password (postgresql autentication) to the statement: Select md5('the password I have in my mind') and compare with the password pgAdmin3 shows me. They are completely different. Try SELECT 'md5'||md5('the password I have in my mind'||'userlogin'); Ezequias 2007/3/1, Bart Degryse <[EMAIL PROTECTED]>: It doesn't do that for me. I've tried it on three different databases (of two different versions) as three different users and the result is always the same (as it should be): select USER, md5('password') current_usermd5 bigdbuser 5f4dcc3b5aa765d61d8327deb882cf99 current_usermd5 bigdbsys5f4dcc3b5aa765d61d8327deb882cf99 current_usermd5 logstocksys 5f4dcc3b5aa765d61d8327deb882cf99 Show us some statements. >>> "Ezequias Rodrigues da Rocha" <[EMAIL PROTECTED]> 2007-03-01 16:02 >>> Just another thing. Why md5 function return a different string from user role of postgresql ? It allways put an md5 string concated with another sequence of string. Why does it occurs ? Ezequias 2007/3/1, Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]>: > I know it. Thank you so much. > > Ezequias > Grettings from Brazil. > > 2007/3/1, Bart Degryse <[EMAIL PROTECTED]>: > > > > > > update yourtable set passwordfield = md5(passwordfield) > > > > watch out: md5 is irreversable! you can't "un_md5" > > > > > > >>> "Ezequias Rodrigues da Rocha" <[EMAIL PROTECTED]> 2007-03-01 > > 15:08 >>> > > > > John, > > > > That was what I was looking for for a long time. > > > > Now I will change my teller password account to md5. > > > > Could someone suggest me how to change all passwords (PLAIN) to md5 ? > > > > My real best regards > > Ezequias > > > > 2007/3/1, John DeSoi <[EMAIL PROTECTED]>: > > > MD5 is built-in to PostgreSQL. It is what PostgreSQL itself uses to > > > hash passwords. For example: > > > > > > select md5('this is my password'); > > > > > > md5 > > > -- > > > 210d53992dff432ec1b1a9698af9da16 > > > (1 row) > > > > > > > > > > > > On Mar 1, 2007, at 6:06 AM, Eugenio Flores wrote: > > > > > > > Thanks Andrej. But how can I use such algoritms in postgresql? arey > > > > they defined in a function that I can call? > > > > > > > > Or, do I have to code one of those algorithm to use it in my > > > > application? > > > > > > > > > > > > John DeSoi, Ph.D. > > > http://pgedit.com/ > > > Power Tools for PostgreSQL > > > > > > > > > ---(end of > > broadcast)--- > > > TIP 9: In versions below 8.0, the planner will ignore your desire to > > >choose an index scan if your joining column's datatypes do not > > >match > > > > -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Atenciosamente (Sincerely) Ezequias Rodrigues da Rocha =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- A pior das democracias ainda é melhor do que a melhor das ditaduras The worst of democracies is still better than the better of dictatorships http://ezequiasrocha.blogspot.com/ -- Shane Ambler [EMAIL PROTECTED] Get Sheeky @ http://Sheeky.Biz ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [SQL] How to store a password encripted in a userdefinedtable
On Thursday 01 March 2007 8:53 am, Ezequias Rodrigues da Rocha wrote: > I am just passing the database owner password (postgresql > autentication) to the statement: > > Select md5('the password I have in my mind') and compare with the > password pgAdmin3 shows me. > > They are completely different. > > Ezequias > Try select md5('password'||'user') The generated hash is a combination of the password and the user name. -- Adrian Klaver [EMAIL PROTECTED] ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [SQL] How to store a password encripted in a userdefinedtable
Perfect ! That's it. Another information I doesn't have. Great to be part of this list. Thank you Adrian 2007/3/1, Adrian Klaver <[EMAIL PROTECTED]>: On Thursday 01 March 2007 8:53 am, Ezequias Rodrigues da Rocha wrote: > I am just passing the database owner password (postgresql > autentication) to the statement: > > Select md5('the password I have in my mind') and compare with the > password pgAdmin3 shows me. > > They are completely different. > > Ezequias > Try select md5('password'||'user') The generated hash is a combination of the password and the user name. -- Adrian Klaver [EMAIL PROTECTED] -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Atenciosamente (Sincerely) Ezequias Rodrigues da Rocha =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- A pior das democracias ainda é melhor do que a melhor das ditaduras The worst of democracies is still better than the better of dictatorships http://ezequiasrocha.blogspot.com/ ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
Re: [SQL] How to store a password encripted in a user defined table
Thanks for your anwers. They have been very useful. Thanks again. - Mensaje original De: John DeSoi <[EMAIL PROTECTED]> Para: Eugenio Flores <[EMAIL PROTECTED]> CC: Andrej Ricnik-Bay <[EMAIL PROTECTED]>; PostgreSQL Enviado: jueves, 1 de marzo, 2007 5:25:28 Asunto: Re: [SQL] How to store a password encripted in a user defined table MD5 is built-in to PostgreSQL. It is what PostgreSQL itself uses to hash passwords. For example: select md5('this is my password'); md5 -- 210d53992dff432ec1b1a9698af9da16 (1 row) On Mar 1, 2007, at 6:06 AM, Eugenio Flores wrote: > Thanks Andrej. But how can I use such algoritms in postgresql? arey > they defined in a function that I can call? > > Or, do I have to code one of those algorithm to use it in my > application? John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match ___ Do You Yahoo!? La mejor conexión a Internet y 2GB extra a tu correo por $100 al mes. http://net.yahoo.com.mx
Re: [SQL] [ADMIN] pg_dump error
"Karthikeyan Sundaram" <[EMAIL PROTECTED]> writes: >Thanks for your reply. No, I recently installed (fresh installation) > from scratch. Well, your pg_dump seems to be finding an older version of libpq.so from somewhere. Check for a pre-existing postgresql package. regards, tom lane ---(end of broadcast)--- TIP 6: explain analyze is your friend