2020-10-22 01:22:40 -04:00
|
|
|
BEGIN;
|
|
|
|
|
|
|
|
INSERT INTO
|
|
|
|
fc.target_meta
|
|
|
|
SELECT
|
2022-04-06 01:52:18 -04:00
|
|
|
table_schema
|
|
|
|
,table_name
|
2020-10-22 01:22:40 -04:00
|
|
|
,column_name
|
|
|
|
,ordinal_position
|
2022-04-06 01:52:18 -04:00
|
|
|
,null::text func
|
2020-10-22 01:22:40 -04:00
|
|
|
,null::text fkey --foreign key to a master table
|
2022-04-06 01:52:18 -04:00
|
|
|
,column_name fcol
|
2020-10-22 01:22:40 -04:00
|
|
|
,data_type::text dtype
|
2022-04-06 01:52:18 -04:00
|
|
|
,null::text appcol
|
|
|
|
,null::text pretty
|
2020-10-22 01:22:40 -04:00
|
|
|
FROM
|
|
|
|
information_schema.columns
|
|
|
|
WHERE
|
2022-04-09 02:29:51 -04:00
|
|
|
table_name = 'dcard'
|
|
|
|
AND table_schema = 'tpsv'
|
2020-10-22 01:22:40 -04:00
|
|
|
ON CONFLICT ON CONSTRAINT target_meta_pk DO UPDATE SET
|
|
|
|
opos = EXCLUDED.opos
|
|
|
|
,dtype = EXCLUDED.dtype;
|
|
|
|
|
|
|
|
END;
|