UUID type is not supported for PG connections.
Unknown datatype "UUID" for "entity". Fall back to UNKNOWN.
[PostgreSQL] Support for uuid type
Code modification/commit
from ansgarbecker,
9 years ago,
revision 9.2.0.4951
Add support for PostgreSQL's UUID data type. See http://www.heidisql.com/forum.php?t=18442
I am not sure about the solution. Query log on click "Data" tab is the following (sorry for polish locale):
/* Ładowanie sesji "PostgreSQL lokalny" */
SELECT "entity", SUBSTR("class", 1, 256), "minver", "maxver", SUBSTR("name", 1, 256) FROM "public"."entities" LIMIT 1000;
/* BŁĄD: funkcja substr(uuid, integer, integer) nie istnieje
LINE 1: SELECT "entity", SUBSTR("class", 1, 256), "minver", "max...
^
HINT: Brak funkcji pasującej do podanej nazwy i typów argumentów. Być może należy dodać jawne rzutowanie typów. */
Translation: function substr(uuid, integer, integer) doesn't exist
Columns entity and class are UUIDs, name is varchar. What is SUBSTR used for? Anyway it doesn't work.
/* Ładowanie sesji "PostgreSQL lokalny" */
SELECT "entity", SUBSTR("class", 1, 256), "minver", "maxver", SUBSTR("name", 1, 256) FROM "public"."entities" LIMIT 1000;
/* BŁĄD: funkcja substr(uuid, integer, integer) nie istnieje
LINE 1: SELECT "entity", SUBSTR("class", 1, 256), "minver", "max...
^
HINT: Brak funkcji pasującej do podanej nazwy i typów argumentów. Być może należy dodać jawne rzutowanie typów. */
Translation: function substr(uuid, integer, integer) doesn't exist
Columns entity and class are UUIDs, name is varchar. What is SUBSTR used for? Anyway it doesn't work.
Yep, I'm getting the same error when trying to view the "Data" tab of a table with UUID columns:
function substr(uuid, integer, integer) does not exist...
It works okay when the first column is a UUID type (no attempt to use substr()), but in this table I have a second column that is also a UUID type (and a foreign key).
Example table create code:
function substr(uuid, integer, integer) does not exist...
It works okay when the first column is a UUID type (no attempt to use substr()), but in this table I have a second column that is also a UUID type (and a foreign key).
Example table create code:
CREATE TABLE "items" (
"item_id" UUID NOT NULL,
"merchant_id" UUID NOT NULL,
"title" TEXT NOT NULL,
"description" TEXT NOT NULL,
PRIMARY KEY ("item_id")
);
Code modification/commit
from ansgarbecker,
9 years ago,
revision 9.2.0.4952
Introduce new data type property "LoadPart" (boolean), which says whether such columns can be loaded per SUBSTR or LEFT into the data grid. Set it to false for UUID and JSON. See http://www.heidisql.com/forum.php?t=18442
Confirmed it works for tables with multiple UUID columns. Thank you!
However, I found it giving a similar error with the 'inet' type: it shows in the Table tab as a 'VARCHAR' (technically incorrect), renders fine in the query tab if I do a SELECT * with an inet type, but fails with the SUBSTR() error message in the Data tab. (I imagine the other netwrok address types will do the same.)
However, I found it giving a similar error with the 'inet' type: it shows in the Table tab as a 'VARCHAR' (technically incorrect), renders fine in the query tab if I do a SELECT * with an inet type, but fails with the SUBSTR() error message in the Data tab. (I imagine the other netwrok address types will do the same.)
Code modification/commit
from ansgarbecker,
9 years ago,
revision 9.2.0.4953
Support PostgreSQL data types cidr, inet and macaddr. Grouped in dtcText category, so the grids show the normal text editor, but without applying SUBSTR(). See http://www.heidisql.com/forum.php?t=18442
cidr, inet and macaddr types added in r4953. These were formerly detected as varchar. Now, the grids still offer the normal text editor for these types, but without applying the SUBSTR() logic, so it does not crash when you have such columns.
Thank *you* for consistent and helpful feedback!
So I shall have a look at foreign keys for PostgreSQL. I just found a query at StackOverflow:
So I shall have a look at foreign keys for PostgreSQL. I just found a query at StackOverflow:
SELECT
tc.constraint_name, tc.table_name, kcu.column_name,
ccu.table_name AS foreign_table_name,
ccu.column_name AS foreign_column_name
FROM
information_schema.table_constraints AS tc
JOIN information_schema.key_column_usage AS kcu
ON tc.constraint_name = kcu.constraint_name
JOIN information_schema.constraint_column_usage AS ccu
ON ccu.constraint_name = tc.constraint_name
WHERE constraint_type = 'FOREIGN KEY' AND tc.table_name='mytable';
Please login to leave a reply, or register at first.