Hello Juan,
It depends what you understand by connecting; in this context: directly connecting Cloud Pub/Sub with Cloud SQL doesn't seem to be an option. By contrast, you may benefit from using both features in conjunction with an application deployed to Flexible or Standard environment.
There are
Cloud Pub/Sub Triggers that trigger Cloud Functions, which, in their turn, provide a local socket interface to connect to Cloud SQL instances. This interface works for both MySQL and PostgreSQL instances. To connect to your Cloud SQL instance you can use the /cloudsql file system path. You may find related detail on the "Connecting to Cloud SQL" documentation
page.
If you provide more information on your application needs, we'll be happy to help further.