pgAdmin

How to connect to localhost with postgres_fdw?

旧城冷巷雨未停 提交于 2020-01-11 02:36:10
问题 The idea is that I have local database named northwind , and with postgres_fdw I want to connect with another database named test on localhost (remote connection simulation, for situations like when table in my database is updated, do something in other database like save to history etc..). So I opened psql console and type: CREATE SERVER app_db FOREIGN DATA WRAPPER postgres_fdw OPTIONS (dbname 'test', host 'localhost:5432'); As i found in A Look at Foreign Data Wrappers link. Next I also

如何将CSV文件数据导入PostgreSQL表?

本小妞迷上赌 提交于 2020-01-08 18:27:57
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 如何编写一个存储过程,该存储过程从CSV文件导入数据并填充表? #1楼 您也可以使用pgAdmin,它提供了一个GUI来进行导入。 这在此 SO线程中显示 。 使用pgAdmin的优点是它也适用于远程数据库。 但是,与之前的解决方案非常相似,您将需要在数据库中拥有表。 每个人都有自己的解决方案,但我通常要做的是在Excel中打开CSV,复制标题,将带有换位符的特殊内容粘贴在不同的工作表上,将相应的数据类型放在下一列中,然后将其复制并粘贴到文本编辑器中加上适当的SQL表创建查询,如下所示: CREATE TABLE my_table ( /*paste data from Excel here for example ... */ col_1 bigint, col_2 bigint, /* ... */ col_n bigint ) #2楼 一种快速的方法是使用Python pandas库(版本0.15或更高版本效果最好)。 这将为您创建列-尽管显然对数据类型所做的选择可能不是您想要的。 如果不能完全满足您的要求,则可以始终使用作为模板生成的“创建表”代码。 这是一个简单的例子: import pandas as pd df = pd.read_csv('mypath.csv') df.columns = [c

What do TX and XID fractions stand for in the postgres pgadmin tool

柔情痞子 提交于 2020-01-06 02:21:26
问题 What does the fractions in column XID and TX stand for. This is a screenshot of the postgres's pgadmin tool. I understand that TX and XID mean transaction and transaction ID respectively, however I don't understand what the fraction notation means. 回答1: Virtual transaction IDs have the "n/nnnn" format. Real XIDs are just integers. The first part of the virtual xid is a backend identifier that's unique to each connection; the second part is a temporary transaction id assigned by that

What do TX and XID fractions stand for in the postgres pgadmin tool

我的梦境 提交于 2020-01-06 02:21:10
问题 What does the fractions in column XID and TX stand for. This is a screenshot of the postgres's pgadmin tool. I understand that TX and XID mean transaction and transaction ID respectively, however I don't understand what the fraction notation means. 回答1: Virtual transaction IDs have the "n/nnnn" format. Real XIDs are just integers. The first part of the virtual xid is a backend identifier that's unique to each connection; the second part is a temporary transaction id assigned by that

pgAdmin4: Importing a CSV

拟墨画扇 提交于 2020-01-05 04:15:29
问题 I am trying to import a CSV using pgAdmin4. I created the table using the query, CREATE TABLE i210_2017_02_18 ( PROBE_ID character varying(255), SAMPLE_DATE timestamp without time zone, LAT numeric, LON numeric, HEADING integer, SPEED integer, PROBE_DATA_PROVIDER character varying(255), SYSTEM_DATE timestamp without time zone ) The header and first line of my CSV read is... PROBE_ID,SAMPLE_DATE,LAT,LON,HEADING,SPEED,PROBE_DATA_PROVIDER,SYSTEM_DATE 841625st,2017-02-18 00:58:19,34.11968,-117

How to access the pgadmin database designer?

非 Y 不嫁゛ 提交于 2020-01-04 04:05:14
问题 I am running pgadmin 1.18.... In the options pane I can set the font for the database designer but I see absolutelly no way to access this db designer window, no icon or menu or whatsoever... Is it a working feature under pgadmin 1.18? Should it be enabled? 回答1: Graphical Query builder : Source 来源: https://stackoverflow.com/questions/22101818/how-to-access-the-pgadmin-database-designer

PgAdmin on Windows 10 with Postgres when installed via Bash on Ubuntu on Windows

浪子不回头ぞ 提交于 2020-01-03 10:44:22
问题 I would like to install Rails 5/Postgres within Bash On Ubuntu On Windows and also be able to access Postgres database via PgAdmin for Windows . Am quiet happy to install all my rails dependencies through Bash on Ubuntu on Windows, but I am aware that I can't run any standard GUI tools from Bash and was wondering if it is possible to install Rails and PostGres on the Linux Subsystem and then query my databases using the Windows version of PgAdmin I had a look at this tutorial how-to-install

Postgresql Transaction ID Not Found

强颜欢笑 提交于 2020-01-01 08:04:04
问题 Whenever I am executing a query in postgresql, this is the error message I receive Transaction ID not found in the session. Does anyone have any idea how to resolve this? I recently created a new user, but I was unable to find documentation that even shows this as a valid error. Additional Details: I've managed to resolve the error by re-connecting with admin credentials. I was using PG Admin V4 with Postgres V9.6, and that was the only message appearing in any query I executed, even if it

Postgresql Transaction ID Not Found

左心房为你撑大大i 提交于 2020-01-01 08:03:30
问题 Whenever I am executing a query in postgresql, this is the error message I receive Transaction ID not found in the session. Does anyone have any idea how to resolve this? I recently created a new user, but I was unable to find documentation that even shows this as a valid error. Additional Details: I've managed to resolve the error by re-connecting with admin credentials. I was using PG Admin V4 with Postgres V9.6, and that was the only message appearing in any query I executed, even if it

postgresql extracting function source

不羁的心 提交于 2019-12-31 04:48:08
问题 Need to extract the source of a PostgreSQL function using SQL. I am seeing this odd behavior with one of the function, all other functions (around 200+ ) work absolutely fine. When I run the following statement, it works: select prosrc from pg_proc where proname= 'accounts_count'; However when I run the following, it returns an empty string: select routine_definition from information_schema.routines where specific_name = 'accounts_count_66243' PostgreSQL version 8.3. I have tried using both