pgAdmin

Creating relationship links in PostgreSQL via pgAdmin

Deadly 提交于 2019-12-22 10:33:03
问题 I created a databse with four tables in pgAdmin. It was coded in PostgreSQL. I was wondering how do you create replationship links in pgAdmin? I've searched google and youtube, but can't seem to find a tutorial on it. If someone can explain how to do this, i'll be grateful. Here's a picture of how I designed my datase to relate: 回答1: You can find it via right-click on the table --> Properties --> Constraints --> Foreign Key (Add) . Then you can add the foreign keys as needed. There is (yet)

Easy way to view data in pgAdmin (PostgreSQL)

不打扰是莪最后的温柔 提交于 2019-12-22 01:38:14
问题 I have searched this problem for more than an hour without any clue. In Heidi SQL (for MySQL), I just need few clicks to open any table to view its data. But in pgAdmin, I must collapse many sub-folder to do that : database/Schemas/public/Tables/... and then I must right click on a table to "view data". It's 3 times slower. I wonder if there is any easier way to look through PostgreSQL data? Or is there any other way for Postgres that allow me to make it faster? 回答1: Go to the properties of

Heroku pg:pull is giving sh: createdb: command not found

和自甴很熟 提交于 2019-12-21 18:29:43
问题 When I try to do heroku pg:pull DATABASE_URL myappspassword , I get this error: my-computer:a-folder (master*) · heroku pg:pull DATABASE_URL myappspassword ! sh: createdb: command not found ! ! Unable to create new local database. Ensure your local Postgres is working and try again. For once Googling doesn't return a result. I'm wondering if it's related to the fact that when I do which psql , there is no result. Maybe I need to do something special with pgAdmin to get this working (e.g.

Where can I get pldbgapi.sql in order to install the debugger for postgresql?

浪尽此生 提交于 2019-12-21 04:01:44
问题 I am trying to install the debugger for postgresql on Linux so I can use pgAdmin to debug my functions. I've set up my postgresql.conf file. However, I can't find pldbgapi.sql . Postgresql is installed at /usr/pgsql-9.2/ . The directory /usr/pgsql-9.2/share/ exists, but /usr/pgsql-9.2/share/contrib does not exist. Where can I find the file or download it? Thanks! 回答1: I've found out it works if I run the contents of this file share\extension\pldbgapi--1.0.sql There is also this readme for the

how to execute pgsql script in pgAdmin?

試著忘記壹切 提交于 2019-12-21 03:35:23
问题 I want to execute some pgScript directly from the pgAdmin editor UI. FOR i IN 1..10 LOOP PRINT i; -- i will take on the values 1,2,3,4,5,6,7,8,9,10 within the loop END LOOP; But I always got [ERROR ] 1.0: syntax error, unexpected character I also tried to wrap the code with do$$...$$ , but does not solve the problem. 回答1: apart from Clodoaldo Neto's Answer.You can try this also DO $$ BEGIN FOR i IN 1..10 LOOP RAISE NOTICE '%', i; -- i will take on the values 1,2,3,4,5,6,7,8,9,10 within the

Primary & Foreign Keys in pgAdmin

醉酒当歌 提交于 2019-12-20 08:42:49
问题 I was wondering can some give me an explanation on how to assign primary and foreign keys in pgAdmin? I can't find any information online. For example...I've got a Student table with all their details (address, d.o.b. and etc.). I'm going to add a student_number to the table and make it a primary key. I just want to know how do I do that using pgAdmin? And if you may be kind to explain give me further information on using Primary Keys in postgreSQL (and pgAdmin). The same case with the

How connect Postgres to localhost server using pgAdmin on Ubuntu?

偶尔善良 提交于 2019-12-20 07:59:39
问题 I installed Postgres with this command sudo apt-get install postgresql postgresql-client postgresql-contrib libpq-dev Using psql --version on terminal I get psql (PostgreSQL) 9.3.4 then I installed pgadmin with sudo apt-get install pgadmin3 Later I opened the UI and create the server with this information but this error appear how can I fix it? 回答1: You haven't created a user db . If its just a fresh install, the default user is postgres and the password should be blank. After you access it,

Table name as variable parameter

元气小坏坏 提交于 2019-12-19 12:49:11
问题 I made a function in pgadmin create or replace function get_source2(a text) returns integer as $$ declare a text; geom geometry; begin select get_source(geom) from a; end; $$ language plpgsql; I want input a by table name How can I do? I try to like this select get_source2('postgis.center') but I get: ERROR: relation "a" does not exist LINE 2: from a help me 回答1: try this: create or replace function get_source2(a text) returns integer as $$ declare geom geometry; begin execute 'select get

pgAdmin - Sharing DB Connection Definitions

别来无恙 提交于 2019-12-18 19:40:24
问题 I have a few database servers and few developers. I have set up database connection definitions on my PC for each servers and now I want to share with other developers but I was not sure how to export and import the definitions. I am running pgAdmin 1.10.2 on Ubuntu 10.04 (lucid). 回答1: You should have a .pgadmin3 conf file in your home directory. You just need to give that one to your fellow developers. 回答2: By the way, for those looking for the answer to this question on the Windows platform

pgAdmin - Sharing DB Connection Definitions

眉间皱痕 提交于 2019-12-18 19:40:07
问题 I have a few database servers and few developers. I have set up database connection definitions on my PC for each servers and now I want to share with other developers but I was not sure how to export and import the definitions. I am running pgAdmin 1.10.2 on Ubuntu 10.04 (lucid). 回答1: You should have a .pgadmin3 conf file in your home directory. You just need to give that one to your fellow developers. 回答2: By the way, for those looking for the answer to this question on the Windows platform