[SQL]
Hi, I have a database which has been set to encoding UTF-8. I have a table in this database in which i store the details of all the registered users. I am using PL/PGSQL and using one function i am entering the values into the database. There is one column for entering the passwords of all registered users. I want to store these passwords in an encrypted manner in the table. Can i encrypt the password in the stored procedure and will i not loose any data by entering the passwords in an encrytped manner. Thanks in advance, Regards, deepthi ---(end of broadcast)--- TIP 8: explain analyze is your friend
Re: [SQL]
Deepthi Darshan wrote: Hi, I have a database which has been set to encoding UTF-8. I have a table in this database in which i store the details of all the registered users. I am using PL/PGSQL and using one function i am entering the values into the database. There is one column for entering the passwords of all registered users. I want to store these passwords in an encrypted manner in the table. Can i encrypt the password in the stored procedure and will i not loose any data by entering the passwords in an encrytped manner. There are a range of encryption functions available in contrib/pgcrypto in the source distribution. Some encryption is one-way (so you can't recover the original password, just confirm a provided password matches it). Other encryption is two-way, but you usually have a separate key to encrypt the passwords then. -- Richard Huxton Archonet Ltd ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
[SQL] calling JAVA UDF through trigger
Hello I want to write a trigger on a table. In the trigger I want to call Java method and pass some data from the table(on which trigger is set) as parameters to this method. Can I do this in postgreSQL and if yes how? Example would be helpful :) Thanks Swati -- " Darkest Hour Of The Night Comes Before Dawn " Swati <[EMAIL PROTECTED]> - Disclaimer: The contents of this message are confidential and intended to the addressee at the specified e-mail address only. Its contents may not be copied or disclosed to anyone other than the intended recipient. If this e-mail is received in error, please contact Vertex Software Pvt. Ltd immediately on +91 20 4041500 with details of the sender and addressee and delete the e-mail. Vertex Software Pvt. Ltd accepts no responsibility in the event that the onward transmission, opening or use of this message and/or any attachments adversely affects the recipient's systems or data. It is the recipient's responsibility to carry out such virus and other checks as the recipient considers appropriate. - ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
[SQL] Calendar Function
Dear All, How to create Calendar Function or Query. I would like to display date form -mm-dd to -mm-dd or display date in one Month e.g: date 2005-01-01 2005-01-02 2005-01-03 2005-01-04 2005-01-05 2005-01-06 2005-01-07 2005-01-08 2005-01-09 2005-01-10 2005-01-11 2005-01-12 2005-01-13 2005-01-14 2005-01-15 2005-01-16 2005-01-17 2005-01-18 2005-01-19 2005-01-20 2005-01-21 2005-01-22 2005-01-23 2005-01-24 2005-01-25 2005-01-26 2005-01-27 2005-01-28 2005-01-29 2005-01-30 2005-01-31
[SQL] error: cast the timestam expression
When I execute this: "insert into comments ( date_posted ) (select date_published from xyz )" I get : "ERROR: column "date_posted" is of type timestamp without time zone but expression is of type text HINT: You will need to rewrite or cast the expression." Both dates are of type timesamp! I searched how to cast, and can't find it. What is the syntax to cast a timestamp to a timestamp? tia, .V ---(end of broadcast)--- TIP 8: explain analyze is your friend
Re: [SQL] error: cast the timestam expression
On Jan 28, 2005, at 23:55, friendVU admin wrote: When I execute this: "insert into comments ( date_posted ) (select date_published from xyz )" I get : "ERROR: column "date_posted" is of type timestamp without time zone but expression is of type text HINT: You will need to rewrite or cast the expression." Both dates are of type timesamp! Could you post the output to \d xyz and \d comments from psql? Michael Glaesemann grzm myrealbox com ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [SQL] Calendar Function
maybe somthing like this:
CREATE OR REPLACE FUNCTION calendar (DATE, DATE) RETURNS SETOF DATE
LANGUAGE 'plpgsql' AS '
DECLARE
v_from ALIAS FOR $1;
v_to ALIAS FOR $2;
v_current DATE DEFAULT v_from;
BEGIN
WHILE (v_current<=v_to) LOOP
RETURN NEXT v_current;
v_current:=v_current+1;
END LOOP;
RETURN;
END;
';
test it:
SELECT * FROM calendar('2005-01-01', '2005-01-31');
Muhyiddin A.M Hayat wrote:
Dear All,
How to create Calendar Function or
Query. I would like to display date form -mm-dd to -mm-dd or
display date in one Month
e.g:
date
2005-01-01
2005-01-02
2005-01-03
2005-01-04
2005-01-05
2005-01-06
2005-01-07
2005-01-08
2005-01-09
2005-01-10
2005-01-11
2005-01-12
2005-01-13
2005-01-14
2005-01-15
2005-01-16
2005-01-17
2005-01-18
2005-01-19
2005-01-20
2005-01-21
2005-01-22
2005-01-23
2005-01-24
2005-01-25
2005-01-26
2005-01-27
2005-01-28
2005-01-29
2005-01-30
2005-01-31
[SQL] plpgsql select into with multiple target variables
The docs say: The result of a SELECT command yielding multiple columns (but only one row) can be assigned to a record variable, row-type variable, or list of scalar variables. This is done by: SELECT INTO target select_expressions FROM ...; where target can be a record variable, a row variable, or a comma-separated list of simple variables and record/row fields. The select_expressions and the remainder of the command are the same as in regular SQL. So, I'm trying to do the "list of scalar variables" target, but I can't get the syntax right. Something like SELECT into varx, vary, varz, colx, coly, colz, FROM I've tried parens and various other things but no luck. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [SQL] plpgsql select into with multiple target variables
Try removing the comma after varz SELECT into varx, vary, varz, colx, coly, colz, FROM I've tried parens and various other things but no luck. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [SQL] error: cast the timestam expression
friendVU admin <[EMAIL PROTECTED]> writes: > When I execute this: > "insert into comments > ( > date_posted > ) > (select date_published > from xyz > )" > I get : > "ERROR: column "date_posted" is of type timestamp without time zone but > expression is of type text > HINT: You will need to rewrite or cast the expression." > Both dates are of type timesamp! I don't think so. Let's see the definitions of the comments and xyz tables (\d in psql will do). regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
