dbTalk Databases Forums  

Postgresql for Dummies?

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss Postgresql for Dummies? in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Alexandre Ricciardi
 
Posts: n/a

Default Configuration problem - 10-13-2004 , 02:28 AM






Hi all,

I have a problem to connect to my database localy from jdbc,
in postgresql.conf i allow tcp/ip connection,
in pg_hba.conf i have the following lines :
local all trust
host all all 127.0.0.1 255.255.255.255 trust

i don't get where i am wrong in my configuration

Thanks for help

regards

Alexandre

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


Reply With Quote
  #12  
Old   
Alexandre Ricciardi
 
Posts: n/a

Default Re: Configuration problem - 10-13-2004 , 05:10 AM






Alexandre Ricciardi wrote:

Quote:
Hi all,

I have a problem to connect to my database localy from jdbc,
in postgresql.conf i allow tcp/ip connection,
in pg_hba.conf i have the following lines :
local all trust
host all all 127.0.0.1 255.255.255.255 trust

i don't get where i am wrong in my configuration

Thanks for help

regards

Alexandre

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


in postgresql.conf i have "tcpip_socket = true",
but i must start pgsql with "/usr/bin/postmaster -p 5432 -i -D
/var/lib/pgsql/data",
the init.d script does not allow tcp/ip connections perhaps my script is
not good ???



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly



Reply With Quote
  #13  
Old   
Nikki
 
Posts: n/a

Default Re: Postgresql for Dummies? - 10-13-2004 , 09:26 AM



In article <416C27F2.50004 (AT) mountainmeasurement (DOT) com>, Daniel Lerch
<daniel (AT) mountainmeasurement (DOT) com> wrote:

Quote:
I need to learn how to work with PostgreSQL for work, but I am
*completely* unfamiliar with the program, almost completely unfamiliar
with databases (I've only worked with very basic databases in MS
Access), and relateively unfamiliar with using non-GUI programs.

In other words, I need a 'Postgresql for Dummies' book - something that
will start at the most basic level. The books I've seen out there on
Amazon.com and other places all seem to be aimed at developers, though.
Where can I go to get a basic, basic, BASIC tutorial/guidebook for
learning PostgreSQL?

Thanks,

Daniel Lerch
Portland, Oregon

Hi Daniel

I'm a recent starter, and have the O'Reilly 'Practical Postgresql'.
However, I must say I found that a daunting task to start with. So my
advice would be: Get the book, beause you're going to need it, but
don't start with it; it'll come into its own when you're using it as a
reference. So first, check the postgresql site documentation, and look
out for tutorials, AND go googling for other postgresql tutorials. That
go me started, because it is EXTREMELY easy to get started - it's just
that the books don't make it look easy! The complexity is in getting
the data out and 'operating' on it! It's really easy to set up a
database and get data into it.

I'll say that I am reasonably familiar with command line work, as a
Linux user. If you need that, it may be a good idea to get used to that
without tyring to learn postgresql at the same time.

If you were a Dummy, you wouldn't be choosing to use postgresql!

Good Luck, and Holler again if you need good solid amateur advice in
plain English.

Nikki


Reply With Quote
  #14  
Old   
Tom Lane
 
Posts: n/a

Default Re: Configuration problem - 10-13-2004 , 09:29 AM



Alexandre Ricciardi <alexandre.ricciardi (AT) free (DOT) fr> writes:
Quote:
in postgresql.conf i have "tcpip_socket = true",
but i must start pgsql with "/usr/bin/postmaster -p 5432 -i -D
/var/lib/pgsql/data",
the init.d script does not allow tcp/ip connections perhaps my script is
not good ???
You sure you're editing the right copy of postgresql.conf? Putting that
in the config file should definitely have the same effect as saying -i
on the command line.

One way to make this mistake is if the init script is specifying a
different data directory (-D) than you're doing by hand.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match



Reply With Quote
  #15  
Old   
Andreas
 
Posts: n/a

Default Re: possible to access a Linux box db from a Windows box - 10-13-2004 , 09:36 AM



Hi Daniel,
I'm a novice too but allready for some time
Sorry for the long rant.


Daniel Lerch wrote:

Quote:
It occured to me that I might have an easier time learning PostgreSQL
if I start off with a GUI instead of just command line.
But I access the database over our LAN -- I'm on a Windows 2000 box,
and the psql database is on a Linux box. I've been accessing it by
running PuTTY.

So, my question is - is there a GUI program I can run off my Windows
2000 box that will allow me to access myt psql database on the Linux
box? Or do I have no choice but run the GUI on the Linux box?

First you've got to understand what PostgreSQL does.
It stores data in a sensible way and provides a query inteface. This
interface can't be accessed directly by mere humans.
Compare it to the JET database engine that MSAccess uses. JET is there
in the background and you probaply never heared of it though it is
actually a separate piece of software.

There are 2 type of actions that you need a client for.
1) database maintenance
* creating/dropping databases, tables, users
* making backups
* vacuuming the database
2) data maintenance
* editing, deleting records
* select and combine records for analysis or export to other programs

The clients are as a rule only good at one type of task.

We need client-tools like psql or PGAdmin that actually know how to talk
in the DB server's language. Next to allways this talking happens over a
LAN or at least over the LAN mechanisms in your local computer as if the
server were on a remote box.
So don't worry about the LAN. You just have to tell Postgres to listen
to the LAN and allow remote connections.
To do this you need to be the DB administrator.

Another possibility is to use ODBC to access Postgres by a standardized
interface. You will then need an ODBC driver for Postgres on your
Windows computer. With it Windows can connect many programs to PG
without them actually knowing what database they are talking to. They
just need to know ODBC.
Here we get MS-Access, Excel, and others back into the game. Access can
link to tables that are stored in PG and you can edit them in Access
with some restrictions.
You can't create or alter tables in a visual way. Though it is possible
with SQL commands that you send the server from withing Access which
shouldn't be your problem at first.
Access is nice if your tables are all created in the way you need them
and you'll just search, edit and delete records.

Someone mentioned phpPGAdmin. It resembles PGAdmin but needs a running
webserver with installed PHP. That'd add a lott more complexity to your
learning, I'd say. phpPGAdmin is surely nice if the PG is on a secure
server that doesn't allow connections from your box but the provider let
a www-server connect where you can put own PHP scripts.

Learning SQL is the way to go and it can be rather easy, too.
Often it is even easier than using a GUI for the managing stuff like
creating tables.
I suppose you used Access to store data in so you probaply know how to
create a table in Access. It's a good number of chosing combo-box values
and checking check-boxes.
In SQL you do:
CREATE TABLE tab1 (
tab1_id int4 not null,
name varchar(100),
adress varchar(200,
PRIMARY KEY (tab1_id)
);

You could type this directly into psql's command line but that isn't
convenient.
Use your favourite editor and store the command in the file "tab1.sql".
Then run it on the putty command line through psql.
psql daniels_database < tab1.sql

If you are allowed to access the servers drive from your computer by a
networkdrive then you could use any windows texteditor you like.

To learn the syntax you can look it up in postres' manual or you can try
to mouseclick what you want in PGAdmin3. PGAdmin3 shows what SQL
command it used. There you can watch a "professional" at work, but it
does all in the most formalistic way without omitting defaults and other
decorations.

I'd advise to
0) Get your PG server up and allow LAN connections
1) start with PGAdmin3 and the PG manual that is included into
PGAdmin3, too.
2) Rather sooner than later, I'd move to the editor + psql way.
3) After creating the db tables you can settle back to MS-Access over
ODBC to search and edit data if Access is available in your production
environment.
4) before you put important stuff into the db learn how to
automatically make regular backups with pg_dump & cron
5) in a production environment you'll need indices on foreign key
collumns to speed things up.

after you get a grip on that, you can procede to the aspects that lift
PostgreSQL over Access like
* stored procedures in PG's own language
* triggers
* object inheritance

Books on database theory are important in some way but they tend to
demotivate by utter dullness.
It's often like starting to learn how to ride a car by studying how to
mine for iron ore.
Btw. database theory, SQL and managing a PostgreSQL server are 3
different topics that only overlap a bit.

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings



Reply With Quote
  #16  
Old   
Kumar S
 
Posts: n/a

Default How many rows can postgresql can sustain - 10-13-2004 , 11:14 AM



Dear group,
I am wondering how many rows of data can postgresql
efficiently deal with in comparision to Oracle that
can deal with millions and millions of rows (I was
told this fact by my senior).

One of my table has 8876216 rows that look like:
affy_id | exp_id | exp_chip_id | affy_x | affy_y |
affy_mean | affy_stdv | affy_npixels
---------+--------+-------------+--------+--------+-----------+-----------+--------------
8676216 | | 58 | 249 | 159 |
527.5 | 92.3 | 36



max
---------
8876216
(1 row)


Is there any upper limit where depending on number of
rows one can say that table (database) is crossing
limits or really bulky.

-Kumar.



_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match


Reply With Quote
  #17  
Old   
Bruno Wolff III
 
Posts: n/a

Default Re: How many rows can postgresql can sustain - 10-13-2004 , 11:31 AM



Please don't start new threads by replying to old ones. This makes the archives
less usable and will cause some people that might have been able to help you
to miss your message.

On Wed, Oct 13, 2004 at 09:14:11 -0700,
Kumar S <ps_postgres (AT) yahoo (DOT) com> wrote:
Quote:
Dear group,
I am wondering how many rows of data can postgresql
efficiently deal with in comparision to Oracle that
can deal with millions and millions of rows (I was
told this fact by my senior).
In general Postgres isn't going to have a problem with tables with extremely
large numbers of rows. There may be certain queries that run slower in
postgres than in oracle (in particular certain aggregates) or other databases.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Reply With Quote
  #18  
Old   
Oliver Fromme
 
Posts: n/a

Default Re: How many rows can postgresql can sustain - 10-13-2004 , 11:38 AM




Kumar S wrote:
Quote:
I am wondering how many rows of data can postgresql
efficiently deal with in comparision to Oracle that
can deal with millions and millions of rows (I was
told this fact by my senior).

One of my table has 8876216 rows that look like:
[...]
Two weeks ago I fed the German telephone book of 2002 into
a PostgreSQL database (for testing purposes). It was about
36 million rows and 8 GByte of data. Of course, the import
took a while, but there were no problems at all. I expect
PostgreSQL to cope with much more data than that.

Best regards
Oliver

--
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"Clear perl code is better than unclear awk code; but NOTHING
comes close to unclear perl code" (taken from comp.lang.awk FAQ)

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Reply With Quote
  #19  
Old   
Daniel Lerch
 
Posts: n/a

Default connecting with pgAdmin II - 10-13-2004 , 12:49 PM



OK, I figured out my version problems and am now running pgAdmin II on
my Windows XP box to connect to my psql 7.2 database on my Linux box.
Can't quite get it to connect, though; I'm getting this error message:

"No pg_hba.conf entry for host 192.168.2.102, user bbontempo, database
daniel".

(yes, user name and database name exist and are correct, assuming it
wants the username/password for accessing the server itself, and the
name of an existing psql database)

I _think_ this error message means I need to get into the pg_hba.conf
file and create that entry (and I think pg_hba.conf is supposed to be in
the 'pgdata' directory). Unfortunately, I can find neither pg_hba.conf
(a 'whereis pg_hba.conf' gives me nothing) nor pgdata.

The help files in pgadmin II assume I know my way around Linux commands,
which I don't. So I'm stuck. Help!

=)
-d



---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
  #20  
Old   
Tom Lane
 
Posts: n/a

Default Re: connecting with pgAdmin II - 10-13-2004 , 01:12 PM



Daniel Lerch <daniel (AT) mountainmeasurement (DOT) com> writes:
Quote:
I _think_ this error message means I need to get into the pg_hba.conf
file and create that entry (and I think pg_hba.conf is supposed to be in
the 'pgdata' directory). Unfortunately, I can find neither pg_hba.conf
(a 'whereis pg_hba.conf' gives me nothing) nor pgdata.
Most likely PGDATA is /var/lib/pgsql/data ... to make sure, look at the
init script (probably /etc/init.d/postgresql). Or you could try
ps auxww | grep postmaster
and see whether the data directory was specified with a -D switch on the
postmaster's command line.

Don't forget you need to SIGHUP or restart the postmaster after editing
its configuration files. ("pg_ctl reload" or "service postgresql
reload" usually work for sending SIGHUP conveniently.)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.