public inbox for [email protected]  
help / color / mirror / Atom feed
From: Laurenz Albe <[email protected]>
To: sud <[email protected]>
To: pgsql-general <[email protected]>
Subject: Re: Timestamp conversion Error in dynamic sql script
Date: Tue, 02 Apr 2024 10:08:44 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAD=mzVVHrGgJ08SH8pECjTAH1EKE26ZdL26OjW3mcXhM-AZi2A@mail.gmail.com>
References: <CAD=mzVVHrGgJ08SH8pECjTAH1EKE26ZdL26OjW3mcXhM-AZi2A@mail.gmail.com>

On Tue, 2024-04-02 at 11:08 +0530, sud wrote:
> Not able to figure out why it's giving below error during timezone conversion
> while defining the partitions even though I used the typecast? 
> 
> [...]
> DECLARE
> start_date TIMESTAMP := '2022-01-01';
> [...]
>     TO_CHAR(start_date + i, 'YYYY_MM_DD')
> 
> ***********
> SQL Error [42883]: ERROR: operator does not exist: timestamp without time zone + integer
> Hint: No operator matches the given name and argument types. You might need to add explicit type casts.

As the error states, you cannot add an integer to a timestamp.

What is the supposed meaning of that addition?

Yours,
Laurenz Albe






reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Timestamp conversion Error in dynamic sql script
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox