Thread: Basic Tutorials for 9.0

Basic Tutorials for 9.0

From
ray
Date:
I just downloaded 9.0 onto my laptop and desktop Windows XP machines.
Nether one could run the stack builder.  Windows would fault any time
I tried to run it.  I tried inputing the proxy server but that did not
help.

I have found many tutorials but none look like the 9.0.  Many seem to
be for EnterpriseDB version 8.3.

I need a lot of help.  I have seen tutorials that say to use pgAdmin
III but they only address high level functions; I haven't found
anything that gives a step by step.  When I first bring up pgAdmin,
the server entry has a red 'X' through it.  I played around and got it
to open and show tables and schema and things but I just stumbled on
it.  Now I don't rmember how I got there.  But then I don't know what
to do when I am.

I also tried the shell.  create mydb.  I used all the defaults but the
console came back and rejected all the defaults and closed the
console.

I would like to export an Excel file as CVS and ;'copy' into pg.  So I
would like to learn how to create a new database and what ever goes
along with that to acheive this goal.

I would appreciate all help.

Thanks,
ray

Re: Basic Tutorials for 9.0

From
Rob Sargent
Date:

ray wrote:
> I just downloaded 9.0 onto my laptop and desktop Windows XP machines.
> Nether one could run the stack builder.  Windows would fault any time
> I tried to run it.  I tried inputing the proxy server but that did not
> help.
>
> I have found many tutorials but none look like the 9.0.  Many seem to
> be for EnterpriseDB version 8.3.
>
> I need a lot of help.  I have seen tutorials that say to use pgAdmin
> III but they only address high level functions; I haven't found
> anything that gives a step by step.  When I first bring up pgAdmin,
> the server entry has a red 'X' through it.  I played around and got it
> to open and show tables and schema and things but I just stumbled on
> it.  Now I don't rmember how I got there.  But then I don't know what
> to do when I am.
>
> I also tried the shell.  create mydb.  I used all the defaults but the
> console came back and rejected all the defaults and closed the
> console.
>
> I would like to export an Excel file as CVS and ;'copy' into pg.  So I
> would like to learn how to create a new database and what ever goes
> along with that to acheive this goal.
>
> I would appreciate all help.
>
> Thanks,
> ray
>
>

if the defaults are in play the owning account should be able to do

createdb somedbname;

You left of the "db" in createdb in your posting.

The red X by a server means you haven't logged in to that server.

Since you've got all the way in to there that might be best spot from
which to explore  There is a create database on the right-click menu.

Re: Basic Tutorials for 9.0

From
ray
Date:
On Nov 10, 11:07 pm, robjsarg...@gmail.com (Rob Sargent) wrote:
> ray wrote:
> > I just downloaded 9.0 onto my laptop and desktop Windows XP machines.
> > Nether one could run the stack builder.  Windows would fault any time
> > I tried to run it.  I tried inputing the proxy server but that did not
> > help.
>
> > I have found many tutorials but none look like the 9.0.  Many seem to
> > be for EnterpriseDB version 8.3.
>
> > I need a lot of help.  I have seen tutorials that say to use pgAdmin
> > III but they only address high level functions; I haven't found
> > anything that gives a step by step.  When I first bring up pgAdmin,
> > the server entry has a red 'X' through it.  I played around and got it
> > to open and show tables and schema and things but I just stumbled on
> > it.  Now I don't rmember how I got there.  But then I don't know what
> > to do when I am.
>
> > I also tried the shell.  create mydb.  I used all the defaults but the
> > console came back and rejected all the defaults and closed the
> > console.
>
> > I would like to export an Excel file as CVS and ;'copy' into pg.  So I
> > would like to learn how to create a new database and what ever goes
> > along with that to acheive this goal.
>
> > I would appreciate all help.
>
> > Thanks,
> > ray
>
> if the defaults are in play the owning account should be able to do
>
> createdb somedbname;
>
> You left of the "db" in createdb in your posting.
>
> The red X by a server means you haven't logged in to that server.
>
> Since you've got all the way in to there that might be best spot from
> which to explore  There is a create database on the right-click menu.
>
> --
> Sent via pgsql-general mailing list (pgsql-gene...@postgresql.org)
> To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-general- Hide quoted text -
>
> - Show quoted text -

I really didn't understand.  I was trying to create a new db inside of
the pg shell.  I found that I needed to do it at the OS command
prompt.  This was totally unclear in the manual.  Now I have found
that the copy cammand is to be done in the shell.  Now if I could just
find out if it is working.  I can't seem to look into the db.

Slow, but progressing.

I would like any help/suggestions.

Thanks,
ray

Re: Basic Tutorials for 9.0

From
smallfish
Date:
Hi, you can try to use phpPgAadmin.(must modify the pg_hba.conf, allow the web app visit db)
--


On Thu, Nov 11, 2010 at 9:58 AM, ray <ray@aarden.us> wrote:
I just downloaded 9.0 onto my laptop and desktop Windows XP machines.
Nether one could run the stack builder.  Windows would fault any time
I tried to run it.  I tried inputing the proxy server but that did not
help.

I have found many tutorials but none look like the 9.0.  Many seem to
be for EnterpriseDB version 8.3.

I need a lot of help.  I have seen tutorials that say to use pgAdmin
III but they only address high level functions; I haven't found
anything that gives a step by step.  When I first bring up pgAdmin,
the server entry has a red 'X' through it.  I played around and got it
to open and show tables and schema and things but I just stumbled on
it.  Now I don't rmember how I got there.  But then I don't know what
to do when I am.

I also tried the shell.  create mydb.  I used all the defaults but the
console came back and rejected all the defaults and closed the
console.

I would like to export an Excel file as CVS and ;'copy' into pg.  So I
would like to learn how to create a new database and what ever goes
along with that to acheive this goal.

I would appreciate all help.

Thanks,
ray

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: Basic Tutorials for 9.0

From
Alban Hertroys
Date:
On 13 Nov 2010, at 3:44, ray wrote:

> On Nov 10, 11:07 pm, robjsarg...@gmail.com (Rob Sargent) wrote:
>> ray wrote:
>>> I also tried the shell.  create mydb.  I used all the defaults but the
>>> console came back and rejected all the defaults and closed the
>>> console.
>>
>>> I would like to export an Excel file as CVS and ;'copy' into pg.  So I
>>> would like to learn how to create a new database and what ever goes
>>> along with that to acheive this goal.
>>
>>> I would appreciate all help.
>>
>>> Thanks,
>>> ray
>>
>> if the defaults are in play the owning account should be able to do
>>
>> createdb somedbname;
>>
>> You left of the "db" in createdb in your posting.

> I really didn't understand.  I was trying to create a new db inside of
> the pg shell.  I found that I needed to do it at the OS command
> prompt.  This was totally unclear in the manual.

That's not true, it's just that the command you used wouldn't have worked in either.

On the OS shell's command line (cmd in Windows) you use "createdb mydb" to create a database,
in the psql shell you use "CREATE DATABASE mydb;".
I expect the latter command would work in pgadmin too (although you may have to leave out the semi-colon), but it
probablyhas a convenient menu option for creating databases somewhere. 

I tend to install MSys in Windows so that I have a proper UNIX shell to run those commands from, but it's a bit hard to
setup. 

> Now I have found that the copy cammand is to be done in the shell.

If you're saying shell, do you mean your OS shell (cmd.exe) or are you talking about the psql shell?

To copy data you can use either the \copy command built in the psql shell, or you can use the COPY statement directly
andcopy from STDIN, followed by your CSV data and closed with a \. terminator. 
Check the documentation on COPY for details and examples.

> Now if I could just find out if it is working.  I can't seem to look into the db.


I guess you're talking about pgadmin here, with which I'm not familiar. It's probably just not connected to your
database,guessing from your earlier remark about the red X. 
Is the database server on the same machine as pgadmin? If not, you probably need to edit pg_hba.conf to allow access
fromthe machine running pgadmin. 

In the psql shell you can type \dt to see your tables (or \? for a list of built-in commands) and use SELECT statements
tolook at your data. 

You could also try to hook up an ODBC connection to your database and look at it using Access or Openoffice's variant
ofthat. There are plenty more possibilities. 

Alban Hertroys

--
Screwing up is an excellent way to attach something to the ceiling.


!DSPAM:737,4cde80ae10261879520974!



Re: Basic Tutorials for 9.0

From
Alban Hertroys
Date:
On 15 Nov 2010, at 2:02, ray joseph wrote:

> Alban,
>
> Thank you for your time and effort.  I can see that you are very familiar
> with this environment.
>
> I have only used MS Access (for years).  My difficulties are very basic.
> When I said I can't view the data in the data base, I meant basically - with
> any method.  The psql help shows many commands for displaying.  My basic
> difficulties are: Choosing the right one(s), determining whether I have used
> it correctly, knowing whether I have actually put data in the db.
>
> This is why I was looking for a basic tutorial, something that would guide
> me in detail through steps to achieve a goal.  I have read through the psql
> manual a couple times in the last two years but I have not been able to
> complete any task.
>
> A pointer to a detailed tutorial would be great.

Please include the mailing-list in your replies, you'll get better help that way. Try to prevent top-posting as well,
itmakes it more difficult on people to get the context of your message and thus reduces the chance they'll answer -
there'splenty more mail in this list ;) 

I'm not really sure what you're looking for, you didn't tell what you tried to see your data or what failed (and how)
whenyou tried. 

The built-in commands in psql and pgadmin that I referred to don't show you your data, they show your data structure.
Youcan query your data using SQL commands. 
I'm sure there are plenty of SQL tutorials around if that's what you're looking for?

I'm guessing that if no error message was shown when you copied your data into the database, then you'll be able to see
yourdata if you query your tables. None of us can tell you how to do that exactly, as we don't know your table
structure,but you could get some general pointers (The SELECT statement is probably what you're looking for). 

Seeing your original message though, I wonder whether you did create any tables at all before you tried copying data
intothem? 

> -----Original Message-----
> From: Alban Hertroys [mailto:dalroi@solfertje.student.utwente.nl]
> Sent: Saturday, November 13, 2010 6:12 AM
> To: ray
> Cc: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Basic Tutorials for 9.0
>
> On 13 Nov 2010, at 3:44, ray wrote:
>
>> On Nov 10, 11:07 pm, robjsarg...@gmail.com (Rob Sargent) wrote:
>>> ray wrote:
>>>> I also tried the shell.  create mydb.  I used all the defaults but
>>>> the console came back and rejected all the defaults and closed the
>>>> console.
>>>
>>>> I would like to export an Excel file as CVS and ;'copy' into pg.  So
>>>> I would like to learn how to create a new database and what ever
>>>> goes along with that to acheive this goal.
>>>
>>>> I would appreciate all help.
>>>
>>>> Thanks,
>>>> ray
>>>
>>> if the defaults are in play the owning account should be able to do
>>>
>>> createdb somedbname;
>>>
>>> You left of the "db" in createdb in your posting.
>
>> I really didn't understand.  I was trying to create a new db inside of
>> the pg shell.  I found that I needed to do it at the OS command
>> prompt.  This was totally unclear in the manual.
>
> That's not true, it's just that the command you used wouldn't have worked in
> either.
>
> On the OS shell's command line (cmd in Windows) you use "createdb mydb" to
> create a database, in the psql shell you use "CREATE DATABASE mydb;".
> I expect the latter command would work in pgadmin too (although you may have
> to leave out the semi-colon), but it probably has a convenient menu option
> for creating databases somewhere.
>
> I tend to install MSys in Windows so that I have a proper UNIX shell to run
> those commands from, but it's a bit hard to set up.
>
>> Now I have found that the copy cammand is to be done in the shell.
>
> If you're saying shell, do you mean your OS shell (cmd.exe) or are you
> talking about the psql shell?
>
> To copy data you can use either the \copy command built in the psql shell,
> or you can use the COPY statement directly and copy from STDIN, followed by
> your CSV data and closed with a \. terminator.
> Check the documentation on COPY for details and examples.
>
>> Now if I could just find out if it is working.  I can't seem to look into
> the db.
>
>
> I guess you're talking about pgadmin here, with which I'm not familiar. It's
> probably just not connected to your database, guessing from your earlier
> remark about the red X.
> Is the database server on the same machine as pgadmin? If not, you probably
> need to edit pg_hba.conf to allow access from the machine running pgadmin.
>
> In the psql shell you can type \dt to see your tables (or \? for a list of
> built-in commands) and use SELECT statements to look at your data.
>
> You could also try to hook up an ODBC connection to your database and look
> at it using Access or Openoffice's variant of that. There are plenty more
> possibilities.
>
> Alban Hertroys
>
> --
> Screwing up is an excellent way to attach something to the ceiling.
>
>
>
>
>
>
>
>

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


!DSPAM:737,4ce0deb810267424515313!



Re: Basic Tutorials for 9.0

From
Vincent Veyron
Date:
Le lundi 15 novembre 2010 à 08:17 +0100, Alban Hertroys a écrit :
> >
> > I have only used MS Access (for years).  My difficulties are very basic.
> > When I said I can't view the data in the data base, I meant basically - with
> > any method.  The psql help shows many ommands for displaying.  My basic
> > difficulties are: Choosing the right one(s), determining whether I have used
> > it correctly, knowing whether I have actually put data in the db.
> >

to work with psql you need three things :
1- a basic knowledge of relational databases concepts
2- some familiarity with a command line interface
3- much reading of the excellent postgresql documentation

Working with psql is very similar to typing some SQL in a querydef, and
clicking on 'Execute' to see the result, except you do it for everything
(data inserts, exports, relations, etc...), and then type 'Enter'.

So as noted in the doc, to add a primary key to a table, instead of
opening the table in creation mode and clicking on the little key, you
type :
ALTER TABLE distributors ADD PRIMARY KEY (dist_id);

(see http://www.postgresql.org/docs/9.0/static/sql-altertable.html)

It's disconcerting when you're used to a GUI , but one gets to like it.
Just learn the sql (it's very similar to Access (Jet's) SQL), you'll
find that you have more control in the end.

there are GUI available for PostgreSQL (for instance : pgadmin), but I
never tried them.

>
> > A pointer to a detailed tutorial would be great.

Read the doc, more.

--
Vincent Veyron
http://marica.fr/
Logiciel de gestion des dossiers de contentieux et d'assurance pour le service juridique