以下は私のシェルスクリプトです。シェルスクリプトを使用してposrgresqlに列を挿入しようとしています。 しかし、以下のエラーを取得します。 スクリプト:シェルスクリプトを使用してpostgresqlに列を挿入中にエラーが発生しましたか?
i='dcm_account494401_click_2017050511_20170505_093843_556195422.csv.gz'
load_date='2017-05-12'
load_status='Fail'
message="INFO: Load into table 'stg_ft_raw_activity' completed, 362554 record(s) loaded successfully.
INFO: Load into table 'stg_ft_raw_activity' completed, 1 record(s) were loaded with replacements made for ACCEPTINVCHARS. Check 'stl_replacements' system table for details.
"
psql "host=$HOST port=$DBPORT dbname=$DBNAME user=$DBUSER password=$DBPASS" -F --no-align <<EOF
truncate table stg.notification_table;
\set fname $i
\set load_date $load_date
\set load_status $load_status
\set message $message
insert into stg.notification_table values (:'fname', :'load_date', :'load_status',:"message");
EOF
エラー:
Expanded display is used automatically.
TRUNCATE TABLE and COMMIT TRANSACTION
ERROR: syntax error at or near "INFO"
LINE 1: INFO: Load into table 'stg_ft_raw_activity' completed, 1 re...
^
メッセージCOLは、文字列値であり、またSPL文字が含まれています。それは理由ですか?
解決に協力してください。 Thansk、
あなたは実際にPostgresqlまたはRedshiftを使用していますか?それらは関連していますが、多くの違いがあります。 – Nathan