SHOW server_version;
SHOW server_version_num;
I can fetch the version by these two statement.
On Thu, Aug 9, 2018 at 3:01 PM Luca Ferrari wrote:
> HI all,
> I see a lot of external tools that do a 'SELECT version()' and then
> parse the output to get the version number (e.g., 10.4).
> My opinio
The 'SEQ' part can't be substituted by variable.
https://www.postgresql.org/docs/10/static/plpgsql-implementation.html
DO $$
DECLARE
SEQ BIGINT;
BEGIN
SEQ := (SELECT MAX(ID) FROM TABLE_1);
EXECUTE format('ALTER SEQUENCE TABLE_1_SEQ RESTART WITH %s', SEQ);
END
$$;
On Wed, Nov 22, 2017 at 6