Thread: Database - Table browing problem.

Database - Table browing problem.

From
Anil Jangam
Date:
Hi,

I have successfully created a user (createuser command) and the database
(using createdb command). Now when I create a table either by using the
create table commnd or through pgAdmin interface, its creating the table
succesfully.. but when I try to see the contents of the table i.e. select *
from <table name>; it gives the error message,

        "ERROR:  Relation '<table name>' does not exist

What could be the problem?? I couldn't resolve it.

-regards,
anil.

Re: Database - Table browing problem.

From
Dave Page
Date:

> -----Original Message-----
> From: Anil Jangam [mailto:anilj@indts.com]
> Sent: 14 December 2001 09:41
> To: 'pgsql-cygwin@postgresql.org'
> Subject: [CYGWIN] Database - Table browing problem.
> Importance: High
>
>
> Hi,
>
> I have successfully created a user (createuser command) and
> the database (using createdb command). Now when I create a
> table either by using the create table commnd or through
> pgAdmin interface, its creating the table succesfully.. but
> when I try to see the contents of the table i.e. select *
> from <table name>; it gives the error message,
>
>         "ERROR:  Relation '<table name>' does not exist
>
> What could be the problem?? I couldn't resolve it.

pgAdmin will allow you to create a table with capital letters in the name.
If you have done this, then make sure you surround the name in quotes in
your select query e.g.

SELECT * FROM "MixedCaseName"

Regards, Dave

Re: Database - Table browing problem.

From
Dave Page
Date:

> -----Original Message-----
> From: Anil Jangam [mailto:anilj@indts.com]
> Sent: 14 December 2001 10:51
> To: 'Dave Page'; Anil Jangam; 'pgsql-cygwin@postgresql.org'
> Subject: RE: [CYGWIN] Database - Table browing problem.
>
>
> Hi Dave,
>
> It worked. But why is there a difference between the
> interfaces?? Is it because of the use of capital letters in
> the definition of the table names?? Is it a standard behavier
> or pgSQL/pgAdmin limitation??

There isn't a difference between the interfaces, it's just that pgAdmin
automatically adds the quotes to object names, whereas in psql you must type
them yourself.

>
> Here is another doubt. When the table is created from the
> psql console, its not pssible to see its proerties in the
> pgAdmin interface. However I can see the table details e.g.
> columns, checks, FKs etc. The error message says:
>
> An error has occured in pgAdminII:frmMain.tvTable
> Number: 2147467259
> Error:person: permission denied.

Are you running pgAdmin as the postgresql superuser?

>
> -anil.
>
>
> > > -----Original Message-----
> > > From: Anil Jangam [mailto:anilj@indts.com]
> > > Sent: 14 December 2001 09:41
> > > To: 'pgsql-cygwin@postgresql.org'
> > > Subject: [CYGWIN] Database - Table browing problem.
> > > Importance: High
> > >
> > >
> > > Hi,
> > >
> > > I have successfully created a user (createuser command) and
> > > the database (using createdb command). Now when I create a
> > > table either by using the create table commnd or through
> > > pgAdmin interface, its creating the table succesfully.. but
> > > when I try to see the contents of the table i.e. select *
> > > from <table name>; it gives the error message,
> > >
> > >         "ERROR:  Relation '<table name>' does not exist
> > >
> > > What could be the problem?? I couldn't resolve it.
> >
> > pgAdmin will allow you to create a table with capital letters
> > in the name.
> > If you have done this, then make sure you surround the name
> > in quotes in
> > your select query e.g.
> >
> > SELECT * FROM "MixedCaseName"
> >
> > Regards, Dave
> >
>

Re: Database - Table browing problem.

From
Anil Jangam
Date:
Hi Dave,

It worked. But why is there a difference between the interfaces?? Is it
because of the use of capital letters in the definition of the table names??
Is it a standard behavier or pgSQL/pgAdmin limitation??

Here is another doubt. When the table is created from the psql console, its
not pssible to see its proerties in the pgAdmin interface. However I can see
the table details e.g. columns, checks, FKs etc. The error message says:

An error has occured in pgAdminII:frmMain.tvTable
Number: 2147467259
Error:person: permission denied.

-anil.


> > -----Original Message-----
> > From: Anil Jangam [mailto:anilj@indts.com]
> > Sent: 14 December 2001 09:41
> > To: 'pgsql-cygwin@postgresql.org'
> > Subject: [CYGWIN] Database - Table browing problem.
> > Importance: High
> >
> >
> > Hi,
> >
> > I have successfully created a user (createuser command) and
> > the database (using createdb command). Now when I create a
> > table either by using the create table commnd or through
> > pgAdmin interface, its creating the table succesfully.. but
> > when I try to see the contents of the table i.e. select *
> > from <table name>; it gives the error message,
> >
> >         "ERROR:  Relation '<table name>' does not exist
> >
> > What could be the problem?? I couldn't resolve it.
>
> pgAdmin will allow you to create a table with capital letters
> in the name.
> If you have done this, then make sure you surround the name
> in quotes in
> your select query e.g.
>
> SELECT * FROM "MixedCaseName"
>
> Regards, Dave
>

Re: Database - Table browing problem.

From
Dave Page
Date:

> -----Original Message-----
> From: Anil Jangam [mailto:anilj@indts.com]
> Sent: 14 December 2001 11:10
> To: 'Dave Page'; 'pgsql-cygwin@postgresql.org'
> Subject: RE: [CYGWIN] Database - Table browing problem.
>
>
>
> > > Here is another doubt. When the table is created from the
> > > psql console, its not pssible to see its proerties in the
> > > pgAdmin interface. However I can see the table details e.g.
> > > columns, checks, FKs etc. The error message says:
> > >
> > > An error has occured in pgAdminII:frmMain.tvTable
> > > Number: 2147467259
> > > Error:person: permission denied.
> >
> > Are you running pgAdmin as the postgresql superuser?
>
> No, as a user I created (using createuser).. Where as when I
> am logging to the psql, its just the psql <database name>.
> The user while this login, I think is the default one i.e.
> "Administrator@ANILJ" (this is also the bash prompt). How do
> I set the pgSQL user when I create the table and so the owner
> of the whole database. See the description of the command:
> (CREATE DATABASE creates a new Postgres database. The creator
> becomes the owner of the new database.)
>

Try using

psql -U username dbname

It sounds to me like pgAdmin is trying to do a SELECT count(*) from a table
that your username doesn't have permission to access.

Regards, Dave.

Re: Database - Table browing problem.

From
Anil Jangam
Date:
> > Here is another doubt. When the table is created from the
> > psql console, its not pssible to see its proerties in the
> > pgAdmin interface. However I can see the table details e.g.
> > columns, checks, FKs etc. The error message says:
> >
> > An error has occured in pgAdminII:frmMain.tvTable
> > Number: 2147467259
> > Error:person: permission denied.
>
> Are you running pgAdmin as the postgresql superuser?

No, as a user I created (using createuser).. Where as when I am logging to
the psql, its just the psql <database name>. The user while this login, I
think is the default one i.e. "Administrator@ANILJ" (this is also the bash
prompt). How do I set the pgSQL user when I create the table and so the
owner of the whole database. See the description of the command:
(CREATE DATABASE creates a new Postgres database. The creator becomes the
owner of the new database.)

 -anil.