Objective: using psql of postgrasql : It is an PostgreSQL interactive terminal program, called psql.

If you like to choose try plsql.exe, console than using pgaAdminIII.exe application, especially in window's 8 environment there is not terminal window like Unix to start plsql.

In window's environment, if you did not create a variable, the command line tool will not recon psql.exe.

And it differs from the helpline as show below

http://www.postgresql.org/docs/9.3/static/tutorial-accessdb.html

 

In this workstation M9W8 (windows 8 ), I installed two versions of PostgreSQL
Run as an administer: Opens a command window:

command : psql -U postgres -h localhost postgres the password i used "postgre_manas9

Test a script

Script;

SELECT datname FROM pg_database WHERE datistemplate = false;

 

Switch  to another database: ignore the warnning

postgres=# connect pgsdemo1

More querying

 
Calling a stored function

-- Function: cfcal(numeric)

-- DROP FUNCTION cfcal(numeric);

CREATE OR REPLACE FUNCTION cfcal(i numeric)
RETURNS numeric AS
$BODY$
DECLARE
temp1 numeric ;
BEGIN
/*select cfcal(i+40) INTO temp1;*/
RETURN (i * 9/5) + 32 ;

END;

$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION cfcal(numeric)
OWNER TO postgres;
 

all tables in the current db