Re: Logs say update done but not actually done or committed into database ???

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: Logs say update done but not actually done or committed into database ???
Дата
Msg-id dcc563d10904221330i1459a0bfw558a5e43116893a0@mail.gmail.com
обсуждение исходный текст
Ответ на Logs say update done but not actually done or committed into database ???  ("Atul Chojar" <achojar@airfacts.com>)
Ответы Re: Logs say update done but not actually done or committed into database ???  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin
On Wed, Apr 22, 2009 at 2:28 PM, Atul Chojar <achojar@airfacts.com> wrote:
> We are facing a strange problem in our 8.2.7 database.
>
> There is a bash shell script that does:-
>
> sql="select distinct to_char(date_of_issue, 'YYYYMM') from
> yan.int_prod_s_master order by 1;"
> YYYYMM=`/usr/local/pgsql/bin/psql -U postgres -h payday -d sandbox -t -c
> "$sql"`
> for x in $YYYYMM
> do
>  $scriptdir/USCS_production_updates.sh $x
>>>$logdir/USCS_production_updates.log 2>&1
> done
>
> The $scriptdir/USCS_production_updates.sh script does updates like:-
>
> YYYYMM=$1
> database="us_audit"
> db_user="postgres"
> db_host="nutrageous"
> psql_cmd="/usr/local/pgsql/bin/psql -U ${db_user} -h ${db_host} -d
> ${database} -e ";
> sql="
> update int_prod_manual_price_${YYYYMM} mp
>  set .
> from int_prod_s_master_${YYYYMM} sm
> where .
> and not exists ( select 1 from int_prod_stop_${YYYYMM} where .)
> and .;
> ";
> $psql_cmd -c "$SQL"
>
> When these scripts run, the USCS_production_updates.log shows the correct
> update statement, with values of YYYYMM substituted in the table names, and
> message like "UPDATE 1025" from postgres indicating 1025 rows got updated.
>
> However, none of these updates actually get applied in the database. Auto
> commit is on in the database, but it seems the updates do not get committed.
>
> The system logs also show no errors.
>
> Any ideas why above update is not working?

Any possibility you're doing the updates to an inherited table, or a
table in a different schema or a different database than you think?

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Atul Chojar"
Дата:
Сообщение: Logs say update done but not actually done or committed into database ???
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Logs say update done but not actually done or committed into database ???