| From: | raghu ram <raghuchennuru(at)gmail(dot)com> |
|---|---|
| To: | mauricejea(at)numericable(dot)fr |
| Cc: | pgsql-novice(at)postgresql(dot)org |
| Subject: | Re: really novice with Postgres ! |
| Date: | 2013-08-02 13:03:30 |
| Message-ID: | CALnrrJROC5xpXvGEnP+0C7V9UDfXVE5xAstf2iQVzUVip4kSGQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
On Fri, Aug 2, 2013 at 6:21 PM, Jean MAURICE <mauricejea(at)numericable(dot)fr>wrote:
> Hi everybody,
>
> I have some more questions :
> Is there a SQL command to
> - test if a database exists
>
postgres=# select * from pg_database where datname='<DB name>';
or
postgres=# \l
> - test if a table exists
>
postgres=# select * from pg_class where rename='<tablename>';
> - get the list of the tables of a database
>
postgres=# \dt
or
postgres=# select * from pg_class
- get the structure (list of fields) of a table
>
>
postgres=# \d <tablename>
Thanks & Regards
Raghu Ram
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jean MAURICE | 2013-08-02 13:07:38 | Re: really novice with Postgres ! |
| Previous Message | Tovo Rabemanantsoa | 2013-08-02 13:01:45 | Re: really novice with Postgres ! |