Полезная информация

next up previous contents index
Next: Typing in the Query Up: Issuing Database Commands Previous: Starting a Session

Controlling a Session

Congratulations. You have successfully connected to the POSTGRESQL server. You can now issue commands, and receive replies from the server. Let's try one. Type SELECT USER; and press Enter (see figure [*]).

  
Figure: My first SQL query
\begin{figure}\begin{list}{}{
\setlength{\rightmargin}{\leftmargin}
\raggedrigh...
...{}-{}-{}-
\par postgres
\par (1~row)~\\
~\\
~test=>\end{list}\par
\end{figure}

If you make a mistake, just press backspace and retype.This should show your login name underneath the dashed line. In the example, the login name postgres is shown. The word getpgusername is a column label. The server is also reporting that it has returned one row of data. The line test=> tells you that the server is done and is waiting for your next database query.

Let's try another one. At the test=> prompt, type SELECT CURRENT_TIME; and press Enter. It should show the current time. Each time you execute the query, the server will report the current time to you.


 


Bruce Momjian
1999-11-21