Re: [SQL] SHA-1 vs MD5

2007-03-09 Thread Chad Wagner
On 3/9/07, Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> wrote: You are correct. My pg (8.1.3) Now what I do to remove it ? Just delete the functions ? There is usually an uninstall_pgcrypto.sql script you can run against the database. But 8.1 probably supports at least sha1, or you can

Re: [SQL] SHA-1 vs MD5

2007-03-09 Thread Chad Wagner
On 3/9/07, Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> wrote: Thank you so much for your information. I installed the pgCrypto. Now I have more than 40 functions (i believe all are from pgcrypto) but when I try to run your query: select encode(digest('blahblah', 'sha256'), 'hex'); I got th

Re: [SQL] SHA-1 vs MD5

2007-03-08 Thread Chad Wagner
On 3/8/07, Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> wrote: I really don't have the pgcrypto. It could be a nice alternative. Could you tell me the steps to install it ? This should help you out: http://www.postgresql.org/docs/8.2/static/external-extensions.html http://developer.postgr

Re: [SQL] SHA-1 vs MD5

2007-03-07 Thread Chad Wagner
On 3/7/07, Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> wrote: I know that there is a md5 internal function on postgresql, but I noticed that it isn't the more secure today. I would like to know if there is a SHA-1 function implemented yet of, if not, if the team has plan to introduce it on P

Re: [SQL] question on passing parameter in sql query

2007-02-07 Thread Chad Wagner
On 2/7/07, Karthikeyan Sundaram <[EMAIL PROTECTED]> wrote: I don't want to compare with Oracle and postgres. But I have a situation. I am using psql command line tool supplied by postgres. In Oracle I can say select * from emp where emp_id = &1 Oracle will ask: Enter a value

Re: [SQL] Conditional SQL Query

2007-01-11 Thread Chad Wagner
On 1/11/07, devil live <[EMAIL PROTECTED]> wrote: NOW : product_tree_template table is the default table for production ingredients of the PRODUCT but sometimes my customer using special product_tree table for some production_no how can I write a query to get right ingredients of a product bas

Re: [SQL] How to aggregates this data

2007-01-10 Thread Chad Wagner
By the way, if you want to include that "incomplete" week before 12/1 (incomplete because it doesn't have a data point for Monday) then you would do this: select s1.asx_code, s1.wdate AS date, s1.low, s1.high, s2.open, s3.close, s1.volume from (select asx_code, date_trunc('week', date) AS wdate,

Re: [SQL] How to aggregates this data

2007-01-10 Thread Chad Wagner
John, Sub-selects to the rescue. See below. select s1.asx_code, s1.bdate AS date, s1.low, s1.high, s2.open, s3.close, s1.volume from (select asx_code, date_trunc('week', date) AS bdate, max(date) AS edate, min(low) AS low, max(high) AS high, sum(volume) AS volume from sales_summaries