Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qcvXQ-001bPS-57 for pgsql-general@arkaria.postgresql.org; Sun, 03 Sep 2023 22:25:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qcvXM-006HXk-Qw for pgsql-general@arkaria.postgresql.org; Sun, 03 Sep 2023 22:25:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qcvXM-006HXb-9S for pgsql-general@lists.postgresql.org; Sun, 03 Sep 2023 22:25:44 +0000 Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qcvXE-002ZcL-Ki for pgsql-general@lists.postgresql.org; Sun, 03 Sep 2023 22:25:42 +0000 Received: by mail-qt1-x831.google.com with SMTP id d75a77b69052e-4132c2cee1dso7598131cf.2 for ; Sun, 03 Sep 2023 15:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693779935; x=1694384735; darn=lists.postgresql.org; h=in-reply-to:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:from:to:cc:subject:date :message-id:reply-to; bh=O7PnuQ8RQ/ghPUbcm34wUYpMzTo+FqyffnlqUh6CEh8=; b=HzeQ2OMd+9dKnafQ0iBuLe2Q0s0H44+X1iW91hYiIx6fmnoIOad9NvbCjKdV62KQTq 4kdoL2gpbx+5ZXPypVY9FqZNOvJvoIp1Jm6hfWDukKsTzuIoK7EQ2s1sTXClJVkgxSMp +FCeGyLA5u8GAaCbuCaEr3xB6RLmdBiBWK477uh7onoXRCn28hFUJoM9Fb290BsfFara s75oIhqA1J1NLqQRDF0GfWSMaPojRnctCPtzMNFk8yxUQxar0zfBMZ4Bz5PRYiJr+HEL CPGIOFjD4Fb+LEecOZQ8Y+JyilgrvkrHIZRQQ8usPiHXqYvPQLOqSLUTRDYp+mP6klOc nn2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693779935; x=1694384735; h=in-reply-to:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O7PnuQ8RQ/ghPUbcm34wUYpMzTo+FqyffnlqUh6CEh8=; b=V6OJR0QdOuTWf2k3isr/b/UUdHTkYFso7E0eelcU5ee/OkvPFy8+/mDJR/NRSlLaT7 qKnCKPLAt9TmvvYgnZRZQ2EbtdQiJH7Co177TWP7SWQw04PeW7tDnlJJ7Q4C4NHNvXxK ZWHPITInCer2U+IPbyZUpgjvu+1+7niEjQe6yz+P7SAbmEuwXrPFcVkU3A4X7Oc7RGVJ Bboo6n4n6iV1u/c2TZBPHZDMOQQKgA581k8NKgxdgO1oiDFvPlhumgnqCiv83HS+zjQK hS7iz65J39kMIo0strp0Q0Wr/7obEF1PM9u5siCLZwYXnw/cfSpwt+5biW2VBuk5BZDD Tn4g== X-Gm-Message-State: AOJu0YyLl8YaElJ0AGveZ2M0C6zRGBDexo262qb2nVfOk3lktLZLSGx4 COoJ5xn6UmXZIhxpv//p5hlfXEPzQbo= X-Google-Smtp-Source: AGHT+IG2ySEPSOWOVpJF3YTA+WsDSP5pgswde361NPFD9g0tNO7V0U5XFHzY0qrlr87E+5n+Ld/NCg== X-Received: by 2002:ac8:7f14:0:b0:412:da83:484b with SMTP id f20-20020ac87f14000000b00412da83484bmr12632613qtk.10.1693779935088; Sun, 03 Sep 2023 15:25:35 -0700 (PDT) Received: from [192.168.2.170] ([67.70.150.114]) by smtp.gmail.com with ESMTPSA id fg18-20020a05622a581200b00403c1a19a2bsm3119084qtb.92.2023.09.03.15.25.34 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Sep 2023 15:25:34 -0700 (PDT) From: Amn Ojee Uw X-Google-Original-From: Amn Ojee Uw Content-Type: multipart/alternative; boundary="------------q0uqaFtPiDoBa6MmpDZ052vB" Message-ID: Date: Sun, 3 Sep 2023 18:25:25 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: PSQL = Yes ... JDBC = no ?? Content-Language: en-CA, es-ES To: pgsql-general@lists.postgresql.org References: <9524571e-96ed-15f0-4f70-89d9bbe273b9@aklaver.com> In-Reply-To: <9524571e-96ed-15f0-4f70-89d9bbe273b9@aklaver.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------q0uqaFtPiDoBa6MmpDZ052vB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Thanks Adrian, I did read the link you suggested. I was had at the Introduction title, since it makes this mention "/Alternatively, input can be from a file or from command line arguments./" since the input would be from the back end of the database, as I am using Java DBC to access the database. However, I have not been able to discern the correlation that exist between the*JDBC statement *and the definition of *gexec* [/Sends the current query buffer to the server, then treats each column of each row of the query's output (if any) as an SQL statement to be executed./] I guess it is that I am so new to the world of PG-15 that I just cannot understand or get your point. My reality is that esoteric definition go right over my head, since I am a newbie. Would you be able to make the appropriate corrections to the PostgreSQL-15 schema passed to the JDBC Statement.executeUpdate() method? Thanks in advance. PD: Are you saying that JDBC cannot handle or process \gexec, since it is PG-15 exclusive? On 9/3/23 12:04 p.m., Adrian Klaver wrote: > On 9/3/23 09:00, Amn Ojee Uw wrote: >> Hello! >> >> This issue really puzzles me beyond intrigue. >> >> Why would this schema: >> *SELECT 'CREATE DATABASE jme_test_database' WHERE NOT EXISTS (SELECT >> FROM pg_database WHERE datname = 'jme_test_database')\gexec* >> work when entered at the psql prompt, but not when passed as a >> parameter in a JDBC method? >> >> The bellow snip demonstrates the the creation of a String object with >> same character string used in the PSQL#. >> //CREATE DATABASE IF NOT EXISTS >> //~~~~~~~~~~~~~~~~~~ >> *var s = new ***myString*(SELECT 'CREATE DATABASE jme_test_database' >> WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = >> 'jme_test_database')\gexec);** > > > \gexec is a psql specific meta-command. > > See Meta-Commands here: > > https://www.postgresql.org/docs/current/app-psql.html > > >> >> Any help would be very much appreciated. >> >> Thanks in advance. >> > --------------q0uqaFtPiDoBa6MmpDZ052vB Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Thanks Adrian, I did read the link you suggested.
I was had at the Introduction title, since it makes this mention "Alternatively, input can be from a file or from command line arguments." since the input would be from the back end of the database, as I am using Java DBC to access the database.

However, I have not been able to discern the correlation that exist between the JDBC statement and the definition of gexec [Sends the current query buffer to the server, then treats each column of each row of the query's output (if any) as an SQL statement to be executed.]

I guess it is that I am so new to the world of PG-15 that I just cannot understand or get your point. My reality is that esoteric definition go right over my head, since I am a newbie.

Would you be able to make the appropriate corrections to the PostgreSQL-15 schema passed to the JDBC Statement.executeUpdate() method?

Thanks in advance.

PD:

Are you saying that JDBC cannot handle or process \gexec, since it is PG-15 exclusive?

On 9/3/23 12:04 p.m., Adrian Klaver wrote:
On 9/3/23 09:00, Amn Ojee Uw wrote:
Hello!

This issue really puzzles me beyond intrigue.

Why would this schema:
*SELECT 'CREATE DATABASE jme_test_database' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'jme_test_database')\gexec*
work when entered at the psql prompt, but not when passed as a parameter in a JDBC method?

The bellow snip demonstrates the the creation of a String object with same character string used in the PSQL#.
//CREATE DATABASE IF NOT EXISTS
//~~~~~~~~~~~~~~~~~~
*var s = new ***myString*(SELECT 'CREATE DATABASE jme_test_database' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'jme_test_database')\gexec);**


\gexec is a psql specific meta-command.

See Meta-Commands here:

https://www.postgresql.org/docs/current/app-psql.html



Any help would be very much appreciated.

Thanks in advance.


--------------q0uqaFtPiDoBa6MmpDZ052vB--