Thread: Some Simple Questions

Some Simple Questions

From
"Williams, Quinton L"
Date:

Hello, I’m new to using PostgreSQL as a backend for NetReg (www.netreg.org).

I have some questions on getting started.  I have installed the database on a Linux box.

 

  1. How do you list the definitions of the tables you have created in a database?
  2. How do you list the users in a database?

 

I know I will probably have some user authentication questions once this NetReg program tries to access the database with the user I created.

Quinton Williams
Telecommunications Analyst
University of Houston
(832) 842-4680
 

 

Re: Some Simple Questions

From
Bruno Wolff III
Date:
On Fri, Sep 26, 2003 at 18:12:04 -0500,
  "Williams, Quinton L" <QWilliams@Central.UH.edu> wrote:
> 1.    How do you list the definitions of the tables you have created in a
> database?
> 2.    How do you list the users in a database?

Using psql, you can use \d to list tables and \du to list users. \? can
be used to see a list of \ commands. If you want to see the SQL used by
these commands, you can run psql with the -E option.

Install question

From
"Mickey"
Date:
Hi,

I'm following some step-by-step instructions from Lyris.com on installing
postgres 7.2.3, and at step 6, which is this:

Initialize the data directory:
initdb --lc-collate=C

I get this:

bash-2.05$ initdb --lc-collate=C
initdb: invalid option: --lc-collate=C

I think this is a non-vital part of the setup, but I want to be clear,
before I screw anything up. can anyone tell me if this is required, or if
the command itself is incorrect in same fashion?

Thanks!

Mickey


Re: Install question

From
"Mickey"
Date:
New install - Rh 7.3, PG 7.2.3

On trying to start postgres with

pg_ctrl start

I get this:

pg_ctl: no database directory or environment variable $PGDATA is specified

I was instructed to add this:

POSTGRESHOME=/usr/local/pgsql
MANPATH=$POSTGRESHOME/man:$MANPATH
PATH=$POSTGRESHOME/bin:$PATH
PGDATA=$POSTGRESHOME/data
LD_LIBRARY_PATH=$POSTGRESHOME/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH MANPATH PATH PGDATA

To this file:

 /etc/profile

Which I have done, and it has been saved ;)

Anyone know anything that might help?

Thanks,
Mickey

Re: Install question

From
Oliver Elphick
Date:
On Mon, 2003-09-29 at 22:04, Mickey wrote:
> New install - Rh 7.3, PG 7.2.3
>
> On trying to start postgres with
>
> pg_ctrl start
>
> I get this:
>
> pg_ctl: no database directory or environment variable $PGDATA is specified
>
> I was instructed to add this:
>
> POSTGRESHOME=/usr/local/pgsql
> MANPATH=$POSTGRESHOME/man:$MANPATH
> PATH=$POSTGRESHOME/bin:$PATH
> PGDATA=$POSTGRESHOME/data
> LD_LIBRARY_PATH=$POSTGRESHOME/lib:$LD_LIBRARY_PATH
> export LD_LIBRARY_PATH MANPATH PATH PGDATA
>
> To this file:
>
>  /etc/profile
>
> Which I have done, and it has been saved ;)

Have you logged out and in since?  Or are you using a setup where
/etc/profile is sourced into your environment?  In many systems,
/etc/profile is sourced by a login shell, but that may not be the case
if you are using a GUI environment.  You will need to make sure that it
is (see the bash manual page for an explanation of this).

To source it in the current session, do:

 . /etc/profile

which will read the file and set those variables in your environment.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Let not your heart be troubled; ye believe in God,
      believe also in me."          John 14:1


Re: Install question

From
Tom Lane
Date:
"Mickey" <mickey@mcnjeni.com> writes:
> I'm following some step-by-step instructions from Lyris.com on installing
> postgres 7.2.3, and at step 6, which is this:
> Initialize the data directory:
> initdb --lc-collate=C
> I get this:
> bash-2.05$ initdb --lc-collate=C
> initdb: invalid option: --lc-collate=C

IIRC, locale support was optional in 7.2.  You probably built without it.
If you don't want it, leave out the lc_collate option; else go back and
rebuild.

            regards, tom lane

Re: Install question

From
Tom Lane
Date:
"Mickey" <mickey@mcnjeni.com> writes:
> I was instructed to add this:
> POSTGRESHOME=/usr/local/pgsql
> MANPATH=$POSTGRESHOME/man:$MANPATH
> PATH=$POSTGRESHOME/bin:$PATH
> PGDATA=$POSTGRESHOME/data
> LD_LIBRARY_PATH=$POSTGRESHOME/lib:$LD_LIBRARY_PATH
> export LD_LIBRARY_PATH MANPATH PATH PGDATA

> To this file:
>  /etc/profile

> Which I have done, and it has been saved ;)

/etc/profile won't affect anything until you log in again.  Maybe not
then, depending on what shell you use, but try re-logging-in and then
look at the output of "env" to see if PGDATA has been set.

            regards, tom lane

Re: Some Simple Questions

From
Bruno LEVEQUE
Date:
1 - \d table give you the definition of your table "table"

2 - select * from pg_user; give you the name of users;


Williams, Quinton L wrote:

>Hello, I'm new to using PostgreSQL as a backend for NetReg (www.netreg.org
><http://www.netreg.org/> ).
>I have some questions on getting started.  I have installed the database on
>a Linux box.
>
>1.    How do you list the definitions of the tables you have created in a
>database?
>2.    How do you list the users in a database?
>
>I know I will probably have some user authentication questions once this
>NetReg program tries to access the database with the user I created.
>Quinton Williams
>Telecommunications Analyst
>University of Houston
>(832) 842-4680
>
>
>
>
>

--
Bruno LEVEQUE
System Engineer
SARL NET6D
bruno.leveque@net6d.com
http://www.net6d.com