current_date = '2022-07-26 08:00:00'
INSERT INTO info (id_user, firstname, lastname, date_payment)
VALUES (123, 'Alex', 'Ivanov', '2022-07-24, 12:05:13') ON CONFLICT (id_user)
DO UPDATE SET payment_date = (если info.payment_date - current_date > 30, то присваиваем payment_date excluded.payment_date + interval '30 days', в противном случае присваиваем payment_date info.payment_date + interval '30 days');
INSERT INTO info (id_user, firstname, lastname, date_payment)
VALUES (123, 'Alex', 'Ivanov', '2022-07-24, 12:05:13') ON CONFLICT (id_user) DO UPDATE SET payment_date = timestamp '2022-07-26 13:20:00' + interval '23 hours';
message_id=1554 date=datetime.datetime(2022, 4, 18, 11, 15, 13, tzinfo=datetime.timezone.utc) chat=Chat(id=-1001713227744, type='channel', title='Channel', username=None, first_name=None, last_name=None, photo=None, bio=None, has_private_forwards=None, description=None, invite_link=None, pinned_message=None, permissions=None, slow_mode_delay=None, message_auto_delete_time=None, has_protected_content=None, sticker_set_name=None, can_set_sticker_set=None, linked_chat_id=None, location=None) from_user=None sender_chat=Chat(id=-1001713227744, type='channel', title='Channel', username=None, first_name=None, last_name=None, photo=None, bio=None, has_private_forwards=None, description=None, invite_link=None, pinned_message=None, permissions=None, slow_mode_delay=None, message_auto_delete_time=None, has_protected_content=None, sticker_set_name=None, can_set_sticker_set=None, linked_chat_id=None, location=None) forward_from=None forward_from_chat=Chat(id=-1001533051444, type='channel', title='Deeaaa', username='test', first_name=None, last_name=None, photo=None, bio=None, has_private_forwards=None, description=None, invite_link=None, pinned_message=None, permissions=None, slow_mode_delay=None, message_auto_delete_time=None, has_protected_content=None, sticker_set_name=None, can_set_sticker_set=None, linked_chat_id=None, location=None) forward_from_message_id=554 forward_signature=None forward_sender_name=None forward_date=1650280511 is_automatic_forward=None reply_to_message=None via_bot=None edit_date=None has_protected_content=None media_group_id='13202244104077456' author_signature=None text=None entities=None animation=None audio=None document=None photo=[PhotoSize(file_id='AgACAgIAAx0CZh3IDAACBhJiXUhACYrArLi1YwMZPiYRlrGb9wAC6LcxGxVo6Eq5dWw', file_unique_id='AQAD6LcxGxVo6Ep4', width=58, height=90, file_size=734), PhotoSize(file_id='AgACAgIAAx0CZh3IDAACBhJiXUhACYrArLi1YwMZPiYRlrGb9wAC6LcxGxVo6Eq5dWw', file_unique_id='AQAD6LcxGxVo', width=207, height=320, file_size=6395), PhotoSize(file_id='AgACAgIAAx0CZh3IDAACBhJiXUhACYrArLi1YwMZPiYRlrGb9wAC6LcxGxVo6Eq5dWw', file_unique_id='AQAD6LcxGxVo', width=518, height=800, file_size=24176), PhotoSize(file_id='AgACAgIAAx0CZh3IDAACBhJiXUhACYrArLi1YwMZPiYRlrGb9wAC6LcxGxVo6Eq5dWw', file_unique_id='AQAD6LcxGxVo', width=828, height=1278, file_size=32464)] sticker=None video=None video_note=None voice=None caption=None caption_entities=None contact=None dice=None game=None poll=None venue=None location=None new_chat_members=None left_chat_member=None new_chat_title=None new_chat_photo=None delete_chat_photo=None group_chat_created=None supergroup_chat_created=None channel_chat_created=None message_auto_delete_timer_changed=None migrate_to_chat_id=None migrate_from_chat_id=None pinned_message=None invoice=None successful_payment=None connected_website=None passport_data=None proximity_alert_triggered=None voice_chat_scheduled=None voice_chat_started=None voice_chat_ended=None voice_chat_participants_invited=None reply_markup=None
@app.on_message(filters.text & filters.outgoing)
def callback(client: app, message: Message):
if 'smile' in message.text:
msg = message.text.replace('smile', 'CENSORED')
message.edit_text(msg)
callbackfn(app, message)
def callbackfn(client: app, message: Message):
for k in range(11):
message.edit_text(str(k))
Я пробовал добавить RETURNING, вот что получаю
ERROR: ОШИБКА: в запросе нет назначения для данных результата
CONTEXT: функция PL/pgSQL inline_code_block, строка 9, оператор SQL-оператор