Search Postgresql Archives

Re: Basic Tutorials for 9.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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, it makes it more difficult on people to get the context of your message and thus reduces the chance they'll answer - there's plenty 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) when you tried.

The built-in commands in psql and pgadmin that I referred to don't show you your data, they show your data structure. You can 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 your data 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 into them?

> -----Original Message-----
> From: Alban Hertroys [mailto:dalroi@xxxxxxxxxxxxxxxxxxxxxxxxxxxx] 
> Sent: Saturday, November 13, 2010 6:12 AM
> To: ray
> Cc: pgsql-general@xxxxxxxxxxxxxx
> Subject: Re:  Basic Tutorials for 9.0
> 
> On 13 Nov 2010, at 3:44, ray wrote:
> 
>> On Nov 10, 11:07 pm, robjsarg...@xxxxxxxxx (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!



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux