我在 bigquery 中有一个表,它有 100 多列,有超过 7000 万行。我想知道是否可以编写一个查询来提取任何列包含值“FINISHED”的行。
如果您使用 Hibernate 创建表,其他用户将无法访问这些表(它们归 cloudsqladmin 所有)。所有向其他用户授予权限的尝试都失败了,因此当我使用我拥有的唯一凭据(非 cloudsqladmin 用户)通过 shell 或 GUI 访问它时,除了列出中的列之外,他们无法访问这些表桌子。
通过 IAM,我已授予服务帐户访问所有权限。
例如。以 postgres 用户身份登录:
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO postgres;
ERROR: permission denied for relation mytable
GRANT SELECT ON post to postgres;
ERROR: permission denied for relation mytable
ALTER TABLE public.mytable OWNER to postgres;
ERROR: must be owner of relation mytable
Run Code Online (Sandbox Code Playgroud)
我想指出的是,postgres 用户能够完全操作不是使用 hibernate 创建的表,并且 hibernate 能够完全操作数据,但不能操作我创建的其他用户。
我已经在 Google Cloud SQL 上设置了一个 PostgreSQL 实例,并且现在将其设置为仅允许 SSL 连接。我可以通过 psql 从我的工作站以及 R Studio 等一些应用程序进行连接。
不过,我尝试通过 GCloud Shell 进行连接,但似乎没有看到任何使用 SSL 连接的选项。有管理认证的选项,我创建了另一个客户端密钥并在我的云 shell 帐户中下载了它的文件,我只是没有看到使用它们建立连接的选项。如果没有它,只会告诉我没有用于“无 SSL”连接的 HBA。
这是我所看到的(有些内容被混淆了):
don@cloudshell:~ (xxx)$ gcloud sql connect foo --user=postgres
Whitelisting your IP for incoming connection for 5 minutes...done.
Connecting to database with SQL user [postgres].Password for user postgres:
psql: FATAL: connection requires a valid client certificate
FATAL: pg_hba.conf rejects connection for host "a.b.c.d", user "postgres", database "postgres", SSL off
Run Code Online (Sandbox Code Playgroud) 我有一个 GAE 项目,为此我使用了 Cloud SQL 数据库来存储数据。我需要对我的 Cloud SQL 数据库进行按需备份,并且备份应存储在 Google 存储中。
谁能帮助我如何使用 JAVA 以编程方式执行此操作?
如何将云函数连接到cloudsql。
import psycopg2
def hello_gcs(event, context):
print("Imported")
conn = psycopg2.connect("dbname='db_bio' user='postgres' host='XXXX' password='aox199'")
print("Connected")
file = event
print(f"Processing file: {file['name']}.")
Run Code Online (Sandbox Code Playgroud)
无法连接到cloud sql的postgres版本,请帮忙。
这些是步骤:
为什么我无法访问 postgresql?是因为 SQL Private IP 处于 Beta 模式,还是我在这里遗漏了一些东西?
postgresql google-cloud-sql google-cloud-platform google-cloud-networking
我正在尝试使用 Google 部署管理器创建一个 CloudSQL 实例和两个数据库。我无法在两个数据库都成功创建的情况下获得可靠的首次部署。相反,每次我运行它时,一个(或两个!)都会失败,状态为“FAILED_PRECONDITION”,错误消息“Bad Request”,并且没有进一步解释哪个前提条件失败或如何修复它。有没有其他人以前遇到过这个问题,或者对我如何找到问题有任何线索?
属性{{ SQL_NAME }}等都在我的 jinja 模板顶部定义,但为了清楚起见,我省略了它们。
resources:
- name: {{ SQL_NAME }}
type: sqladmin.v1beta4.instance
properties:
backendType: SECOND_GEN
instanceType: CLOUD_SQL_INSTANCE
region: {{ properties["region"] }}
databaseVersion: {{ properties["dbType"] }}
settings:
tier: db-n1-standard-1
dataDiskSizeGb: 10
dataDiskType: PD_SSD
storageAutoResize: true
replicationType: SYNCHRONOUS
locationPreference:
zone: {{ properties['zone']}}
ipConfiguration:
privateNetwork: {{ properties["network"] }}
- name: {{ DB_NAME }}
type: sqladmin.v1beta4.database
properties:
name: db1
instance: $(ref.{{ SQL_NAME }}.name)
charset: utf8
collation: utf8_general_ci
metadata:
dependsOn:
- {{ SQL_NAME }} …Run Code Online (Sandbox Code Playgroud) google-cloud-sql google-cloud-platform google-deployment-manager
我是 Terraform 的新手,我想为postgres在 Google Cloud SQL 上的 PostgreSQL 9.6 实例上创建的数据库创建架构。
要创建PostgreSQL实例我有这个main.tf:
resource "google_sql_database_instance" "my-database" {
name = "my-${var.deployment_name}"
database_version = "POSTGRES_9_6"
region = "${var.deployment_region}"
settings {
tier = "db-f1-micro"
ip_configuration {
ipv4_enabled = true
}
}
}
Run Code Online (Sandbox Code Playgroud)
我试图创建一个PostgreSQL这样的对象:
provider "postgresql" {
host = "${google_sql_database_instance.my-database.ip_address}"
username = "postgres"
}
Run Code Online (Sandbox Code Playgroud)
最后创建架构:
resource "postgresql_schema" "my_schema" {
name = "my_schema"
owner = "postgres"
}
Run Code Online (Sandbox Code Playgroud)
但是,这个配置不起作用,我们运行terraform plan:
Inappropriate value for attribute "host": string required.
Run Code Online (Sandbox Code Playgroud)
如果我删除 …
postgresql google-cloud-sql terraform terraform-provider-gcp
我有点卡住了,我最近切换到 Google Cloud MySQL,我想克隆我的一个数据库(不是实例),用于自由职业者的外部开发环境。
这个想法是克隆/复制现有的实时数据库,然后废弃敏感数据(电子邮件等)。我知道我需要使用“gcloud”命令行功能,但我真的不知道该怎么做。
有人能帮我吗 ?
I am trying to create a CloudSQL instance using terraform but its not even trying to create it appears: The CloudSQL dashboard doesnt change
google_sql_database_instance.db-instance: Still creating... [9m41s elapsed]
google_sql_database_instance.db-instance: Still creating... [9m51s elapsed]
google_sql_database_instance.db-instance: Still creating... [10m1s elapsed]
Run Code Online (Sandbox Code Playgroud)
It eventually timesout. Why is that?
resource "google_sql_database_instance" "db-instance" {
# depends_on = [google_service_networking_connection.private-vpc-connection]
name = "sonarqube"
database_version = "POSTGRES_9_6"
region = "asia-southeast1"
settings {
tier = "db-f1-micro"
# ip_configuration {
# private_network = google_compute_network.private-network.self_link
# }
}
}
Run Code Online (Sandbox Code Playgroud)
I even …
google-cloud-sql ×10
postgresql ×4
terraform ×2
gcloud ×1
hibernate ×1
java ×1
mysql ×1
sql ×1
ssl ×1