Database Reference
In-Depth Information
How it works...
Many people ask questions, such as "How can this be free?", "Are you sure I don't have to pay
someone?", or "Who gives this stuff away for nothing?"
Open source applications such as PostgreSQL work on a community basis, where many
contributors perform tasks that make the whole process work. For many of those people, their
involvement is professional, rather a hobby, and they can do this because there is generally a
great value for both contributors and their employers alike.
You might not believe it. You don't have to because It Just Works.
There's more...
Remember that PostgreSQL is more than just the core software. There is a huge range of
websites offering add-ons, extensions, and tools for PostgreSQL. You'll also find an army
of bloggers describing useful tricks and discoveries that will help you in your work.
And, there is a range of professional companies able to offer you help when you need it.
Connecting to PostgreSQL server
How do we access PostgreSQL?
Connecting to the database is most people's first experience of PostgreSQL, so we want to
make it a good one. So, let's do it, and fix any problems we have along the way. Remember
that a connection needs to be made securely, so there may be some hoops for us to jump
through to ensure that the data we wish to access is secure.
Before we can execute commands against the database, we need to connect to the database
server, giving us a session.
Sessions are designed to be long-lived, so you connect once, perform many requests, and
then eventually disconnect. There is a small overhead during connection. That may become
noticeable if you connect/disconnect repeatedly, so you may wish to investigate the use of
connection pools. Connection pools allow pre-connected sessions to be served quickly to you
when you wish to reconnect.
Getting ready
First, catch your database. If you don't know where it is, we'll probably have difficulty accessing
it. There may be more than one, and you'll need to know the right database
to access, and have the authority to connect to it.
 
Search WWH ::




Custom Search