Jython is great
Oracle 9i skills and DB2
XP and SQL
Respecting SQL
Jython zxJDBC rocks!
« Omni Important
» PostgreSQL on Mandrake 9.1 with Java
PostgreSQL is my choice for a SQL database while using Linux. If you are in a big hurry to get PostgreSQL going in your shiny new Mandrake Linux 9.1 machine, here is how to do it quickly.
These notes don’t address security or backup and restore. I explain how to start the database server, create a user and database, create a table in the database, add some data and query it back.
Things to note: vsbabu is my login in this machine - toshiba. Wherever you see vsbabu, you need to use your login.
1 [vsbabu@toshiba vsbabu]$ su - root 2 password: <enter root password here> 3 [root@toshiba root]# /etc/rc.d/init.d/postgresql restart 4 [ OK ] 5 Starting postgresql service: [ OK ] 6 [root@toshiba root]# su - postgres 7 -bash-2.05b$ createuser vsbabu 8 Shall the new user be allowed to create databases? (y/n) y 9 Shall the new user be allowed to create more new users? (y/n) n 10 CREATE USER 11 -bash-2.05b$ createdb vsbabu 12 CREATE DATABASE 13 -bash-2.05b$ exit 14 [root@toshiba root]# exit 15 [vsbabu@toshiba vsbabu]$ psql 16 Welcome to psql 7.3.2, the PostgreSQL interactive terminal. 17 18 Type: \copyright for distribution terms 19 \h for help with SQL commands 20 \? for help on internal slash commands 21 \g or terminate with semicolon to execute query 22 \q to quit 23 24 vsbabu=> create table states (state_code varchar(2) primary key, state_name varchar(30) not null); 25 CREATE TABLE 26 vsbabu=> insert into states(state_code, state_name) values ('VA','Virgina'); 27 INSERT 16981 1 28 vsbabu=> insert into states(state_code, state_name) values ('MD','Maryland'); 29 INSERT 16982 1 30 vsbabu=> select * from states; 31 state_code | state_name 32 ------------+---------- 33 VA | Virgina 34 MD | Maryland 35 (2 rows) 36 37 vsbabu=> \q 38 [vsbabu@toshiba vsbabu]$
Now, you are all set to explore PostgreSQL documentation, learn some SQL and try out your database.
Hi
thanks a million for your instruction. I tryed to run it sincs 20 houres without a result. After i found your site i takes me 10 minutes. Easy to follow what to do. Well done.
stefan
Hello, and thanks for this quick guide, I'm a newbie in PostgreSQL and it helped me to know how to start.
thx alot this note save me alot, thx again
thanks alot
Why is it the first few steps are always the hardest..
Thanks!
You've saved me hours(days, weeks?) of teeth gnashing. The instructions on www.postgresql.org detail none of this.. The biggest obstacle though is that you won't have a working postgresql implementation out of the box, and doing an urpmi postgresql won't give it to you either. You have to ask urpmi for postgresql-server. (doh!) Then everything is jake:)
RE (lines #3-#5: Make sure the database service (called Postmaster, in PostgreSQL) is started. You can permanently enable the service by setting it to start automatically using Mandrake Control Center)
How exactly is this done????
Sorry guys ive worked that out now, and if anyone else is stuck delete whats already in /usr/local/pgsql/data (only if you know no ones using it and stuff!) then make it again with
mkdir /usr/local/pgsql/data
then
chown postgres /usr/local/pgsql/data
then
su - postgres
then
initdb -D /usr/local/pgsql/data
and your away, wasnt working for me until i cleared out the contents of /usr/local/pgsql/data after install
Ok I have tried that and it works on some computer. But there are those once when you run ./postgresql restart, is says failed. What then, what is wrong with that database ?
Hi,
I saw your site has providing with the useful info. & like to submited my problem which I found in my mandrake9.2 machine when I started psql program, the error show below:
"psql: FATAL: database "john" does not exit inthe system catalog." , do you have any idea ? please help...
Thank you.
Best Regard
John
Hi..i tried what is said above but this is the error i get..is there something i am missing. Please let me know ..thanks in adavance...
[kbis@localhost kbis]$ psql
psql: FATAL: Database "kbis" does not exist in the system catalog.
Hi, can anyone tell me how to set up a pgsql server with this postgres that comes with mandrake 9.1
Thanks a lot buddy.........
This worked a dream on Mandrake 10. I used the services dialog to startup postgresql. Easy as pie, thanks a BUNCH!
I am trying to set up plpgsql on Mandrake 10.1 Community, I tried to install postgresql-devel-7.4.5-1mdk.i586.rpm:
[root@localhost tmp]# urpmi postgresql-devel-7.4.5-1mdk.i586.rpm
Some package requested cannot be installed:
postgresql-devel-7.4.5-1mdk.i586 (due to unsatisfied devel(libcrypto))
Continue? (Y/n)
Any suggestions? Thanks! :)