Обсуждение: How to delete a table in Postgres ???

Поиск
Список
Период
Сортировка

How to delete a table in Postgres ???

От
"suhail sarwar"
Дата:
Does anyone know how to delete a table in postgresql???

I have tried all the usual commands like:
delete <tablename>;
del <tablename>;
del table <tablename>;
delete table <tablename>;

Can anyone help??

Regards

Sarwar

Re: How to delete a table in Postgres ???

От
"Poul L. Christiansen"
Дата:
Try "DROP TABLE <tablename>".

Poul L. Christiansen

suhail sarwar wrote:
>
> Does anyone know how to delete a table in postgresql???
>
> I have tried all the usual commands like:
> delete <tablename>;
> del <tablename>;
> del table <tablename>;
> delete table <tablename>;
>
> Can anyone help??
>
> Regards
>
> Sarwar
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly

Re: How to delete a table in Postgres ???

От
Lutz Steinborn
Дата:
Hello Sarwar,

try:
drop <tablename>

Regards
Lutz

On Fri, 27 Apr 2001 12:57:50 +0100
"suhail sarwar" <sarwar@postmaster.co.uk> wrote:

> Does anyone know how to delete a table in postgresql???
>
> I have tried all the usual commands like:
> delete <tablename>;
> del <tablename>;
> del table <tablename>;
> delete table <tablename>;
>
> Can anyone help??
>
> Regards
>
> Sarwar
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly

Re: How to delete a table in Postgres ???

От
Jeff Daugherty
Дата:
In accordance with SQL92:
drop table <tablename>;

jeff

suhail sarwar wrote:

> Does anyone know how to delete a table in postgresql???
>
> I have tried all the usual commands like:
> delete <tablename>;
> del <tablename>;
> del table <tablename>;
> delete table <tablename>;
>
> Can anyone help??
>
> Regards
>
> Sarwar
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly


Re: How to delete a table in Postgres ???

От
"D. Duccini"
Дата:
drop table


On Fri, 27 Apr 2001, suhail sarwar wrote:

> Does anyone know how to delete a table in postgresql???
>
> I have tried all the usual commands like:
> delete <tablename>;
> del <tablename>;
> del table <tablename>;
> delete table <tablename>;
>
> Can anyone help??
>
> Regards
>
> Sarwar
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>


-----------------------------------------------------------------------------
david@backpack.com            BackPack Software, Inc.        www.backpack.com
+1 651.645.7550 voice       "Life is an Adventure.
+1 651.645.9798 fax            Don't forget your BackPack!"
-----------------------------------------------------------------------------


Re: How to delete a table in Postgres ???

От
Johan Daine
Дата:
You should use
    drop <tablename> ;
instead
Johan Daine
suhail sarwar a écrit :
>
> Does anyone know how to delete a table in postgresql???
>
> I have tried all the usual commands like:
> delete <tablename>;
> del <tablename>;
> del table <tablename>;
> delete table <tablename>;
>
> Can anyone help??
>
> Regards
>
> Sarwar
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly

Re: How to delete a table in Postgres ???

От
Joel Burton
Дата:
On Fri, 27 Apr 2001, suhail sarwar wrote:

> Does anyone know how to delete a table in postgresql???
>
> I have tried all the usual commands like:
> delete <tablename>;
> del <tablename>;
> del table <tablename>;
> delete table <tablename>;
>
> Can anyone help??

\h in psql shows "DROP TABLE xxx".

Please read the FAQs, or at least the man page for psql.

--
Joel Burton   <jburton@scw.org>
Director of Information Systems, Support Center of Washington


Re: How to delete a table in Postgres ???

От
"Brett W. McCoy"
Дата:
On Fri, 27 Apr 2001, suhail sarwar wrote:

> Does anyone know how to delete a table in postgresql???

Standard SQL is DROP TABLE <table name>

-- Brett

                   http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
Nothing will ever be attempted if all possible objections must be first
overcome.
        -- Dr. Johnson


Re: How to delete a table in Postgres ???

От
Jeff Self
Дата:
On Fri, 27 Apr 2001, suhail sarwar wrote:

> Does anyone know how to delete a table in postgresql???
>
DROP TABLE <tablename>

You also will need to drop the sequence if you plan to use the same table
name again.
 DROP SEQUENCE <sequencename>
You can find the sequence name by issuing the \d command in psql.
--
Jeff Self
Information Specialist
Great Bridge, LLC
www.greatbridge.com | www.greatbridge.org
Norfolk, VA
(757)233-5570
jeff.self@greatbridge.com