Skip to content

Drop schema doesn't work #424

@rswheeldon

Description

@rswheeldon

Describe the bug

I can run create schema commands but drop ones don't work. In particular drop if exists doesn't work but if I run create schema twice with the same name it whinges (correctly). What I'd like to do in my tests is drop if exists, then create - that way I know I'm dealing with a clean environment. But I can't :(

💔 Your query failed to parse.
This is most likely due to a SQL syntax error. However, you might also have hit a bug, or an unimplemented feature of pg-mem.
If this is the case, please file an issue at https://github.com/oguimbal/pg-mem along with a query that reproduces this syntax error.

👉 Failed query:

    
create schema foo;
drop schema foo;
;

💀 Syntax error at line 3 col 13:

  drop schema foo
              ^
Unexpected word token: "foo". I did not expect any more input. Here is the state of my parse table:

    kw_index → %word ● 
    kw_trigger → %word ● 
    kw_type → %word ● 
    kw_sequence → %word ● 
    kw_function → %word ● 

To Reproduce

postgres=# create schema foo;
CREATE SCHEMA
postgres=# drop schema foo;
DROP SCHEMA
postgres=# drop schema if exists foo;
NOTICE:  schema "foo" does not exist, skipping
DROP SCHEMA
postgres=# 

pg-mem version

3.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions