[PostgreSQL] new item renders wrong INSERT when default value is function()
Database management in a single PHP file
Brought to you by:
jakubvrana
Adminer v4.7.3. A table with a function - uuid_generate_v1()
- as a default value.
CREATE TABLE "public"."tbl" ( "pkey" uuid DEFAULT uuid_generate_v1() NOT NULL, "foo" smallint NOT NULL, CONSTRAINT "pkey_tbl" PRIMARY KEY ("pkey") ) WITH (oids = false);
The insert form renders the uuid_generate_v1()
as a value into pkey
column, which is then interpreted as a string, which obviously fails.
Proposed solution:
1) The <input> should be rendered empty even if there's a default value on respective column.
2) The rendered INSERT should not specify such a column at all (rather than inserting empty string ''
- v3.7.3)
thanks
Vojtech
I've solved it by pre-selecting the SQL pseudo-function in this case.
Last edit: Jakub Vrána 2021-02-08