Remove unneeded pg_catalog schema name

This commit is contained in:
Javier Goizueta 2016-04-25 16:30:58 +02:00
parent 65415bb335
commit 11ad45306f
3 changed files with 9 additions and 9 deletions

View File

@ -5,9 +5,9 @@ AS $$
SELECT SELECT
a.attname::information_schema.sql_identifier column_name a.attname::information_schema.sql_identifier column_name
FROM pg_class c FROM pg_class c
LEFT JOIN pg_catalog.pg_attribute a ON a.attrelid = c.oid LEFT JOIN pg_attribute a ON a.attrelid = c.oid
WHERE c.oid = $1::oid WHERE c.oid = $1::oid
AND a.attstattarget = -1 AND a.attstattarget < 0 -- exclude system columns
ORDER BY a.attnum; ORDER BY a.attnum;
$$ LANGUAGE SQL; $$ LANGUAGE SQL;

View File

@ -3,12 +3,12 @@ CREATE OR REPLACE FUNCTION CDB_ColumnType(REGCLASS, TEXT)
RETURNS information_schema.character_data RETURNS information_schema.character_data
AS $$ AS $$
SELECT SELECT
pg_catalog.format_type(a.atttypid, NULL)::information_schema.character_data data_type format_type(a.atttypid, NULL)::information_schema.character_data data_type
FROM pg_class c FROM pg_class c
LEFT JOIN pg_catalog.pg_attribute a ON a.attrelid = c.oid LEFT JOIN pg_attribute a ON a.attrelid = c.oid
WHERE c.oid = $1::oid WHERE c.oid = $1::oid
AND a.attname = $2 AND a.attname = $2
AND a.attstattarget = -1; AND a.attstattarget < 0; -- exclude system columns
$$ LANGUAGE SQL; $$ LANGUAGE SQL;
-- This is to migrate from pre-0.2.0 version -- This is to migrate from pre-0.2.0 version

View File

@ -522,12 +522,12 @@ AS $$
SELECT EXISTS ( SELECT EXISTS (
SELECT a.attname SELECT a.attname
FROM pg_class c FROM pg_class c
LEFT JOIN pg_catalog.pg_attribute a ON a.attrelid = c.oid LEFT JOIN pg_attribute a ON a.attrelid = c.oid
LEFT JOIN pg_catalog.pg_type t ON t.oid = a.atttypid LEFT JOIN pg_type t ON t.oid = a.atttypid
WHERE c.oid = reloid WHERE c.oid = reloid
AND a.attname = col_name AND a.attname = col_name
AND pg_catalog.format_type(a.atttypid, NULL) IN ('text', 'character varying', 'character') AND format_type(a.atttypid, NULL) IN ('text', 'character varying', 'character')
AND pg_catalog.format_type(a.atttypid, NULL) = pg_catalog.format_type(a.atttypid, a.atttypmod) AND format_type(a.atttypid, NULL) = format_type(a.atttypid, a.atttypmod)
); );
$$ LANGUAGE SQL STABLE; $$ LANGUAGE SQL STABLE;