Thread: Navigating Databases / Tables in SQL Editor

Navigating Databases / Tables in SQL Editor

From
Carlos Mennens
Date:
This may seem like a really novice question however when I select my
database in pgAdmin3, I then click the SQL window. How can I switch
database connections or show / describe tables in the SQL Editor?
Usually I would be in psql and just run:

\c dbname

\d (show tables)

\d tname (describe table)

Sadly my SQL Editor doesn't support psql commands so I was wondering
what the correct way to do this in pgAdmin3 would be...

Thanks for any help!


Re: Navigating Databases / Tables in SQL Editor

From
Guillaume Lelarge
Date:
On Wed, 2012-02-08 at 11:58 -0500, Carlos Mennens wrote:
> This may seem like a really novice question however when I select my
> database in pgAdmin3, I then click the SQL window. How can I switch
> database connections or show / describe tables in the SQL Editor?

To change connection, there is a combobox in the toolbar that allows you
to do so.

The SQL Editor cannot show or describe tables. You have to use the
browser for that.

> Usually I would be in psql and just run:
> 
> \c dbname
> 
> \d (show tables)
> 
> \d tname (describe table)
> 
> Sadly my SQL Editor doesn't support psql commands so I was wondering
> what the correct way to do this in pgAdmin3 would be...
> 

That's right. The SQL editor doesn't support any psql metacommands. The
correct way to see a description of the table is to use its browser.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com



Re: Navigating Databases / Tables in SQL Editor

From
Raymond O'Donnell
Date:
On 08/02/2012 17:18, Guillaume Lelarge wrote:
> On Wed, 2012-02-08 at 11:58 -0500, Carlos Mennens wrote:
>> This may seem like a really novice question however when I select my
>> database in pgAdmin3, I then click the SQL window. How can I switch
>> database connections or show / describe tables in the SQL Editor?
> 
> To change connection, there is a combobox in the toolbar that allows you
> to do so.
> 
> The SQL Editor cannot show or describe tables. You have to use the
> browser for that.

You can enable an option to copy the SQL for an object into the query
tool, which can be handy if you need it a lot. It's under File ->
Options -> Query Tool tab, "Copy SQL from main window to query tool".

Ray.


-- 
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie