On 09/19/2012 07:54 PM, Marc Mamin wrote:
hello,
I've found a small logical issue while writing a migration script:
create table vtest (foo int);
create view vtest_v as select * from vtest;
drop table if exists vtest_v;
ERROR: "vtest_v" is not a table
drop view if exists vtest;
ERROR:
hello,
I've found a small logical issue while writing a migration script:
create table vtest (foo int);
create view vtest_v as select * from vtest;
drop table if exists vtest_v;
ERROR: "vtest_v" is not a table
drop view if exists vtest;
ERROR: "vtest" is not a view
this may be seen as a ni
On Tue, 28 Jun 2011, Rick Genter wrote:
After issuing the \d you are still in the middle of your command. Witness
the following copy/paste of a terminal session:
Ah, so! I didn't see this.
Thank you very much,
Rich
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To m
postgres=# drop table foo
postgres-# \d
specifically note the prompt. the -# means you're in the middle of a
command. =# means its ready for a new command.
as another example...
pierce=# create table foo (id integer);
CREATE TABLE
pierce=# drop
pierce-# table
pierce-# foo
After issuing the \d you are still in the middle of your command. Witness
the following copy/paste of a terminal session:
bash-3.2$ ./psql
Password:
psql (8.4.4)
Type "help" for help.
postgres=# create table foo (bar int);
CREATE TABLE
postgres=# drop table foo
postgres-# \d
List of relat
On Tue, 28 Jun 2011, Rick Genter wrote:
Silly question, but did you try it with a semicolon after the drop table?
Rick,
See my answer to Andy: that's incorrect syntax and psql complains.
I've noticed that if you are in the middle of a statement and issue a \
command, psql ignores the SQL
On Wed, 29 Jun 2011, Andy Firel wrote:
it might be sufficient to add a semicolon to your drop statement:
# drop table station_type;
Andy,
Actually, that's not true. On a whim I tried that and psql complained
about a syntax error at the initial 'd'.
Rich
--
Sent via pgsql-general mailing l
Hi Rich,
it might be sufficient to add a semicolon to your drop statement:
# drop table station_type;
HTH,
Andy
- Ursprüngliche Mail -
> I cannot recall issuing a DROP TABLE command from psql that did not
> work,
> but seem to have this as a new experience.
>
> When I look at the datab
Silly question, but did you try it with a semicolon after the drop table?
# drop table station_type;
I've noticed that if you are in the middle of a statement and issue a \
command, psql ignores the SQL you've typed in and just does the \ command.
On Tue, Jun 28, 2011 at 3:34 PM, Rich Shepard w
I cannot recall issuing a DROP TABLE command from psql that did not work,
but seem to have this as a new experience.
When I look at the database table list with '\d' I see
public | station_type | table| rshepard
public | station_type_statype_seq
On Fri, 2009-05-15 at 09:09 +0200, Luca Ferrari wrote:
> I'm just curious to know why after a drop table the disk file is emptied but
> still existent. What is the reason why the file is not deleted immediately?
To avoid various problems the files are removed after the next
checkpoint.
--
Si
Luca Ferrari writes:
> I'm just curious to know why after a drop table the disk file is emptied but
> still existent. What is the reason why the file is not deleted immediately?
It's protecting against some obscure race condition involving
reassignment of the relfilenode number to a new table.
Hi,
I'm just curious to know why after a drop table the disk file is emptied but
still existent. What is the reason why the file is not deleted immediately?
Thanks,
Luca
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postg
Andreas Kretschmer <[EMAIL PROTECTED]> writes:
> Tom Lane <[EMAIL PROTECTED]> schrieb:
>> In 8.2 and up you can use ALTER SEQUENCE ... OWNED BY ... to establish a
>> link that will make a manually created sequence go away when its "owner"
>> column is dropped. In 8.1 that aspect of SERIAL is hidde
Tom Lane <[EMAIL PROTECTED]> schrieb:
> "Scott Marlowe" <[EMAIL PROTECTED]> writes:
> > On 10/10/07, Guilherme <[EMAIL PROTECTED]> wrote:
> >> If I insert a sequence later on table creation with alter table, drop
> >> table cascade simply doesn't drop this sequence even when I specify
> >> CASCADE
"Scott Marlowe" <[EMAIL PROTECTED]> writes:
> On 10/10/07, Guilherme <[EMAIL PROTECTED]> wrote:
>> If I insert a sequence later on table creation with alter table, drop
>> table cascade simply doesn't drop this sequence even when I specify
>> CASCADE.
> This is normal.
In 8.2 and up you can use A
On 10/10/07, Guilherme <[EMAIL PROTECTED]> wrote:
> Hello folks,
>
> I'm new to postgres and I'm using version 8.1
>
> Here's the problem anyway:
>
> If I insert a sequence later on table creation with alter table, drop
> table cascade simply doesn't drop this sequence even when I specify
> CASCADE
Hello folks,
I'm new to postgres and I'm using version 8.1
Here's the problem anyway:
If I insert a sequence later on table creation with alter table, drop
table cascade simply doesn't drop this sequence even when I specify
CASCADE.
works
create table bla(id serial);
drop
> I need to do a "drop table if exists" type thing. I realise I can
Install 8.2 or use this function, posted by David Fetter:
Thanks for your answers... so this really was something that was
missing (I think it a little rich to come out with a "are you using a
version without this" when it has
Anton Melser <[EMAIL PROTECTED]> schrieb:
> Hi,
> I need to do a "drop table if exists" type thing. I realise I can
Install 8.2 or use this function, posted by David Fetter:
--
-- posted by David Fetter
--
CREATE OR REPLACE FUNCTION drop_table(TEXT)
RETURNS VOID
STRICT
LANGUAGE plpgsql
AS $$
BEG
I am not sure if I understood the problem correctly!!!
Can you not use the standard command "DROP TABLE IF EXISTS table1" that PG
provides?
http://www.postgresql.org/docs/8.2/interactive/sql-droptable.html
Or is it that you are on a version of PG where "IF EXISTS" syntax is not
available?
Rega
Hi,
I need to do a "drop table if exists" type thing. I realise I can
easily look in pg_tables, but for testing (if), don't I need to use a
procedural language? In which case, I will need to install it if it
doesn't exist - but I don't know how to test to see whether a language
exists without usin
am 26.08.2005, um 2:11:30 +0430 mailte Lee Harr folgendes:
> >I have not been able to work out how to do this is Postgres 8
> >(pseudo-code)
> > if exists table foo
> > drop table foo;
> > end
> > create table foo;
> >If I go with
> > drop table foo;
> > create table foo;
> >then it barfs on
I have not been able to work out how to do this is Postgres 8
(pseudo-code)
if exists table foo
drop table foo;
end
create table foo;
If I go with
drop table foo;
create table foo;
then it barfs on an empty db.
The assumption here is that the SQL is coming in on a script via the
Hi ..
I have not been able to work out how to do this is Postgres 8
(pseudo-code)
if exists table foo
drop table foo;
end
create table foo;
If I go with
drop table foo;
create table foo;
then it barfs on an empty db. I can find the table name in pg_class but
I am not sure of where t
On Tue, Dec 07, 2004 at 01:20:07PM +0530, Nageshwar Rao wrote:
> Not able to drop a table,though nobody is accessing the table.I am able to
> insert the records and delete the records.When I give drop table it just
> hangs there .No error message.
Another transaction might be holding a lock on th
Title: Message
Not able to drop a
table,though nobody is accessing the table.I am able to insert the records and
delete the records.When I give drop table it just hangs there .No error
message.
any specific
reasons
thx
Is it possible to drop multiple tables with SQL on the system tables:
I tried this:
DROP TABLE from pg_tables where tablename LIKE 'table_num_%';
Which for whatever reason would delete 0 items despite it should have
matched on several.
Of course I'm not even sure pg_tables would be the smart
28 matches
Mail list logo