Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop schema doesn't work #424

Open
rswheeldon opened this issue Oct 15, 2024 · 0 comments
Open

Drop schema doesn't work #424

rswheeldon opened this issue Oct 15, 2024 · 0 comments

Comments

@rswheeldon
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant