If you take a look at the CloudSQL Postgres documentation
<https://cloud.google.com/sql/docs/postgres/connect-app-engine>, you'll see
that App Engine standard is not yet supported.  Postgres on CloudSQL is
currently a beta product and isn't available for all environments at this
time.  You can, however, use a Postgres db on App Engine Flexible
environment.

On Thu, Jun 22, 2017 at 12:44 PM, Jason Lee <[email protected]> wrote:

> Tutorial link I am following is: https://cloud.google.com/
> appengine/docs/standard/go/cloud-sql/#setting-up
>
>
>
> On Thursday, 22 June 2017 12:25:56 UTC-7, Jason Lee wrote:
>>
>> I am trying to follow the tutorial at:
>>
>> And I am having the hardest time making my Google App Engine (GoLang)
>> connect to the Cloud SQL Postgres database. I am able to connect NOT
>> following the tutorial by manually opening the port from the firewall
>> rules. But I cannot do it this way because it's connected via IP and if I
>> do it this way, I cannot deploy to GAE.
>>
>> Could someone please review the following GoLang code to see what is
>> wrong.
>>
>> ```
>> *This following line is used to connect from localhost GoLang app to
>> Cloud SQL -- NOT FOLLOWING THE TUTORIAL*
>> db, err := sql.Open("postgres", host=IP_ADDRESS port=PORT user=USERNAME
>> password=PASSWORD dbname=DBNAME sslmode=disable)
>>
>> Here, I am connecting to the Cloud SQL postgres database by IP address. I
>> opened a port manually by firewall rule to make it accessible from my local
>> IP.
>> This works great but I cannot "deploy" my GoLang app to Google App Engine
>> so this is not possible.
>>
>> ---
>>
>> *This does NOT work. It follows the tutorial. I tried 4 different
>> variations.*
>>
>> connectionName = "CONNECTION_NAME"
>> db, err := sql.Open("postgres", fmt.Sprintf("%s:%s@cloudsql(%s)", user,
>> password, connectionName))
>> db, err := sql.Open("postgres", fmt.Sprintf("%s:%s@cloudsql(%s)/DB_NAME",
>> user, password, connectionName))
>> db, err := sql.Open("postgres", fmt.Sprintf("postgres://%s:%s@cloudsql(%s)",
>> user, password, connectionName))
>> db, err := sql.Open("postgres", fmt.Sprintf("postgres://%s:%s@
>> cloudsql(%s)/DB_NAME", user, password, connectionName))
>>
>> All four of these variations do not work. And I do not know why. I could
>> really use some help understanding why. The only difference between this
>> and the tutorial is that I'm using "postgres", not "mysql".
>> ```
>>
>> Thank you so kindly in advance.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/google-appengine.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-appengine/2cc425fa-b87c-409b-b423-
> a7b8a3bc1065%40googlegroups.com
> <https://groups.google.com/d/msgid/google-appengine/2cc425fa-b87c-409b-b423-a7b8a3bc1065%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Josh Moore |  Cloud Solutions Engineer |  [email protected] |

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CAOvpJmVN13-AKK7UQkMJPJNp7BxWiMY2EBkae5ctSuVYhjyRLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to