AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-107865

Thirumal's questions

Martin Hope
Thirumal
Asked: 2020-05-31 02:11:24 +0800 CST

如何在将主键序列(整数)转换为大序列(大整数)时设置当前序列

  • 0

该表已经有几千行,我想将主键从 Integer 转换为 BigInteger。如何更改大整数的序列?

--Create new temp sequence (sequence-name1) for bigint
CREATE SEQUENCE public.case_audit_case_audit_uid_seq1
    INCREMENT 1
    START 5542
    MINVALUE 1
    MAXVALUE 9223372036854775807
    CACHE 1;
ALTER SEQUENCE public.case_audit_case_audit_uid_seq1  OWNER TO postgres;
--Alter column to bigint
ALTER TABLE public.case_audit ALTER COLUMN case_audit_uid TYPE bigint;  
--Alter pk column with temp Sequence
ALTER TABLE public.case_audit ALTER COLUMN case_audit_uid SET DEFAULT     nextval('indsolv.case_audit_case_audit_uid_seq1'::regclass);
--Drop original sequence
DROP SEQUENCE public.case_audit_case_audit_uid_seq;
--Create new sequence for bigint with original sequence name
CREATE SEQUENCE public.case_audit_case_audit_uid_seq
    INCREMENT 1
    START 5542
    MINVALUE 1
    MAXVALUE 9223372036854775807
    CACHE 1;
ALTER SEQUENCE public.case_audit_case_audit_uid_seq OWNER TO postgres;
---Set original sequence
ALTER TABLE public.case_audit ALTER COLUMN case_audit_uid SET DEFAULT nextval('public.case_audit_case_audit_uid_seq'::regclass);
---Drop temp sequence
DROP SEQUENCE public.case_audit_case_audit_uid_seq1;

有没有比这更简单的解决方案?

postgresql primary-key
  • 1 个回答
  • 882 Views
Martin Hope
Thirumal
Asked: 2019-10-29 04:30:46 +0800 CST

如何在 PostgreSQL 的 POINT 列上制定相等谓词?

  • 1

如何从列上具有相等谓词的表中进行选择point?
需要明确的是:它是原生的 Postgrespoint数据类型,而不是geometry(point)来自 PostGIS。

select a.* from indsolv.address As a where a.location = '93.2321, 21.0321';

为上述查询获取此错误:

ERROR:  operator does not exist: point = unknown
LINE 1: ...ct a.* from indsolv.address As a where a.location = '93.2321...
                                                         ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.
SQL state: 42883

还尝试过:

select a.* from indsolv.address As a where a.location = point('93.2321,21.0321');

仍然出现错误。

postgresql operator
  • 1 个回答
  • 777 Views
Martin Hope
Thirumal
Asked: 2019-04-06 01:39:57 +0800 CST

逻辑复制:订阅时模式不存在

  • 2

PostgreSQL 逻辑复制。

我正在尝试将表从服务器 1 复制到服务器 2。

在服务器 1

create publication locale for table code.locale_cd;
CREATE PUBLICATION

在服务器 2

create subscription indsolv_dev10 connection
    'host=192.168.0.26 port=5432 password=****** user=replicator
    dbname=indsolv_dev' publication locale;

引发错误架构“代码”不存在,但它存在于数据库中。

postgresql replication
  • 1 个回答
  • 935 Views
Martin Hope
Thirumal
Asked: 2019-03-27 23:12:26 +0800 CST

创建发布在 PostgreSQL 中不起作用

  • 1

我试图在 PostgreSQL 数据库中创建一个发布(用于逻辑复制),但它抛出一个错误:

indsolv_dev=# CREATE PUBLICATION my_publication;
ERROR:  syntax error at or near "PUBLICATION"
LINE 1: CREATE PUBLICATION my_publication;
postgresql replication
  • 1 个回答
  • 927 Views
Martin Hope
Thirumal
Asked: 2018-08-14 23:32:18 +0800 CST

如何列出 PostgreSQL 中表的所有约束?

  • 122

如何在 PostgreSQL 中列出表的所有约束(主键、检查、唯一互斥、..)?

postgresql
  • 3 个回答
  • 181789 Views
Martin Hope
Thirumal
Asked: 2018-06-21 01:40:40 +0800 CST

如何在 PostgreSQL 中存储年数、月数和天数?

  • 0

如何在 PostgreSQL 中存储年数、月数和天数?

示例:灯泡的使用寿命=> 3 年4 个月23 天

PostgreSQL 中有数据类型吗

database-design postgresql
  • 1 个回答
  • 105 Views
Martin Hope
Thirumal
Asked: 2017-07-19 22:10:38 +0800 CST

PostgreSQL 中 coulmnName = null 和 coumnName IS NULL 的不同类型的结果

  • 1

我有表 Party 列party_Id, party_type

当我使用以下查询时,我得到两种不同类型的结果。

SELECT * FROM party WHERE party_type = null

什么都不返回

SELECT * FROM party WHERE party_type IS NULL

返回所有可能的行

需要一个应该接受 null 和值的查询。

postgresql select
  • 3 个回答
  • 85 Views
Martin Hope
Thirumal
Asked: 2017-02-24 01:28:01 +0800 CST

多个外键的约束但它是互斥的(PostgreSQL)

  • 1

与到期表关联的贷款表。

还

与到期表关联的发票表。

在到期表中,其中一个外键应该存在,另一个应该为空。

什么样的约束才会完美?

谢谢。

postgresql trigger
  • 2 个回答
  • 1374 Views
Martin Hope
Thirumal
Asked: 2016-12-19 21:24:06 +0800 CST

如何在 Neo4J Cypher 中转义反斜杠和正斜杠?

  • 2

当我跑步时,

MATCH (p:person {id:'1'}), (a:Address {street:"11\34, Wall street"})RETURN p, a;

无效输入 'S':预期为 '\'、'''、'"'、'b'、'f'、'n'、'r'、't'、'_'、'%'、UTF16 或 UTF32

如何处理\和/特殊字符

neo4j cypher
  • 1 个回答
  • 2078 Views
Martin Hope
Thirumal
Asked: 2016-12-13 21:06:24 +0800 CST

Neo4j 密码查询错误:无效输入“Q”:预期“t/T”

  • -1

在 Neo4j 中执行匹配的密码查询时出现错误(无效的输入“Q”:预期的“t/T”)。

MATCH (company:COMPANY {name:'`X'SQUIRE COMMUNICATIONS PRIVATE LIMITED'}), 
      (cin:CORPORATE_IDENTIFICATION_NUMBER {number:'U64202TN2001PTC048084'}) 
CREATE (company)-[:IDENTIFIED_BY]-> (cin)
neo4j cypher
  • 1 个回答
  • 3408 Views
Martin Hope
Thirumal
Asked: 2016-10-26 22:00:18 +0800 CST

如何从postgresql中的所有表中删除所有行?[复制]

  • 10
这个问题在这里已经有了答案:
删除 Postgres 数据库中的所有数据 6 个答案
5年前关闭。

是否有任何 SQL 查询可以从 postgresql 中的所有表中删除所有行?

postgresql
  • 1 个回答
  • 42343 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目

    • 12 个回答
  • Marko Smith

    如何让sqlplus的输出出现在一行中?

    • 3 个回答
  • Marko Smith

    选择具有最大日期或最晚日期的日期

    • 3 个回答
  • Marko Smith

    如何列出 PostgreSQL 中的所有模式?

    • 4 个回答
  • Marko Smith

    列出指定表的所有列

    • 5 个回答
  • Marko Smith

    如何在不修改我自己的 tnsnames.ora 的情况下使用 sqlplus 连接到位于另一台主机上的 Oracle 数据库

    • 4 个回答
  • Marko Smith

    你如何mysqldump特定的表?

    • 4 个回答
  • Marko Smith

    使用 psql 列出数据库权限

    • 10 个回答
  • Marko Smith

    如何从 PostgreSQL 中的选择查询中将值插入表中?

    • 4 个回答
  • Marko Smith

    如何使用 psql 列出所有数据库和表?

    • 7 个回答
  • Martin Hope
    Jin 连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目 2014-12-02 02:54:58 +0800 CST
  • Martin Hope
    Stéphane 如何列出 PostgreSQL 中的所有模式? 2013-04-16 11:19:16 +0800 CST
  • Martin Hope
    Mike Walsh 为什么事务日志不断增长或空间不足? 2012-12-05 18:11:22 +0800 CST
  • Martin Hope
    Stephane Rolland 列出指定表的所有列 2012-08-14 04:44:44 +0800 CST
  • Martin Hope
    haxney MySQL 能否合理地对数十亿行执行查询? 2012-07-03 11:36:13 +0800 CST
  • Martin Hope
    qazwsx 如何监控大型 .sql 文件的导入进度? 2012-05-03 08:54:41 +0800 CST
  • Martin Hope
    markdorison 你如何mysqldump特定的表? 2011-12-17 12:39:37 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 对 SQL 查询进行计时? 2011-06-04 02:22:54 +0800 CST
  • Martin Hope
    Jonas 如何从 PostgreSQL 中的选择查询中将值插入表中? 2011-05-28 00:33:05 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 列出所有数据库和表? 2011-02-18 00:45:49 +0800 CST

热门标签

sql-server mysql postgresql sql-server-2014 sql-server-2016 oracle sql-server-2008 database-design query-performance sql-server-2017

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve