adminer icon indicating copy to clipboard operation
adminer copied to clipboard

Remove quote from $sequence_name

Open khoazero123 opened this issue 4 years ago • 1 comments

Location: adminer/drivers/pgsql.inc.php:786

When $sequence_name has double quote around like ""google-drive_account_id_seq"" then the SQL query is like this:

SELECT *, cache_size AS cache_value FROM pg_sequences WHERE schemaname = current_schema() AND sequencename = '"google-drive_account_id_seq"'

The result of the query above return false. And when trying to import SQL file:

Error in query: ERROR: syntax error at or near "MINVALUE"
LINE 1: ...SEQUENCE "google-drive_account_id_seq" INCREMENT MINVALUE ...

The query cause error:

CREATE SEQUENCE "google-drive_account_id_seq" INCREMENT  MINVALUE  MAXVALUE  CACHE ;

The correct query should be:

SELECT *, cache_size AS cache_value FROM pg_sequences WHERE schemaname = current_schema() AND sequencename = 'google-drive_account_id_seq'

khoazero123 avatar Oct 22 '21 04:10 khoazero123

Merged with a modification to https://github.com/pematon/adminer, thanks. Fixes also sequence name "hello""hello".

peterpp avatar Sep 17 '24 22:09 peterpp

Thanks.

vrana avatar Feb 19 '25 11:02 vrana