pg_dump/restore syntax checking bug?
От | Joshua D. Drake |
---|---|
Тема | pg_dump/restore syntax checking bug? |
Дата | |
Msg-id | 514D3123.3040907@commandprompt.com обсуждение исходный текст |
Ответы |
Re: pg_dump/restore syntax checking bug?
|
Список | pgsql-hackers |
Hello, In testing some pg_restore functionality I found the following: postgres@jd-laptop:~$ pg_dump -U postgres -Fc -s --file=foo.sqlc postgres@jd-laptop:~$ dropdb test; postgres@jd-laptop:~$ createdb test; postgres@jd-laptop:~$ pg_restore -d test -P 'by()' foo.sqlc postgres@jd-laptop:~$ psql -U postgres test psql (9.1.8) Type "help" for help. test=# select by(); by ---- by (1 row) test=# select hello(); ERROR: function hello() does not exist LINE 1: select hello(); ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. ----> The above is as expected. test=# \q postgres@jd-laptop:~$ pg_restore -d test -P 'by(),hello()' foo.sqlc postgres@jd-laptop:~$ psql -U postgres test; psql (9.1.8) Type "help" for help. test=# select hello(); ERROR: function hello() does not exist LINE 1: select hello(); ----> This is where I am confused. It didn't restore hello() and it also didn't error that the syntax of the restore command was invalid. ^ test=# drop function by(); DROP FUNCTION test=# test=# q test-# \q postgres@jd-laptop:~$ pg_restore -d test -P 'by(),hello()' foo.sqlc postgres@jd-laptop:~$ psql -U postgres test; psql (9.1.8) Type "help" for help. test=# drop function by(); ERROR: function by() does not exist ----> by() not restored by above command test=# \q postgres@jd-laptop:~$ pg_restore -d test -P 'by()','hello()' foo.sqlc postgres@jd-laptop:~$ psql -U postgres test; psql (9.1.8) Type "help" for help. test=# drop function by(); ERROR: function by() does not exist test=# select hello(); ERROR: function hello() does not exist LINE 1: select hello(); ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. ----> by() and hello() also not restored test=# \q postgres@jd-laptop:~$ pg_restore -d test -P 'by()' -P'hello()' foo.sqlc postgres@jd-laptop:~$ psql -U postgres test; psql (9.1.8) Type "help" for help. test=# select hello(); hello ------- hello (1 row) test=# select by(); ERROR: function by() does not exist LINE 1: select by(); ----> hello() restored but by() was not. It appears we need better syntax checking. Sincerely, JD
В списке pgsql-hackers по дате отправления: