How to connect to PostgreSQL
host: IP address
port: normally 5432
user: (normally 'postgres') and password
However --- I do not see a full list of databases and/or schemas (in my case, I have 3 databases, each with multiple schemas).
Any brilliant ideas?
Robert
I tried to select a database on the initial selection screen, but received an access violation (0366958F, LIBEAY32.dll, address 03010000) - win32.
On Win7, a dropdown list is shown, but does not include any of the databases defined (as, e.g., in pgAdmin).
PostgreSQL version is 9.3.4
I would love to drop pgAdmin in favour of Heidi! (I use both MariaDB and POstgreSQL).
Regards,
Robert
You need to install HeidiSQL with dlls you don't have yet. Please use the latest installer from the nightly builds section.
Then, in the session screen, ensure you have one database you want to work with in the "Database(s)" box.
Have done this ansgar (re-installed build 8.3.0.4799) and I get the connection requested but no objects.
Any idea whats wrong please?
I can't get it work. My english is poor and i will try to explain my connection problem.
I have an PHP app that uses PostgreSQL. This is my PHP connection configuration:

This is the schema of the database with another database manager application:

I can connect correctly with HeidiSQL but the public "schema" is empty, if i no choose database name in heidi connection configuration:

And this is the result:

If i choose my database name in Heidi SQL i get the same result (empty):

Result:

What am I doing wrong?
More Information:
- HeidiSQL 8.3.0.4799.
- Wine 1.7.2
- SO openSUSE 13.1
- PostgreSQL 9.2.7
Greetings.
http://jdbc.postgresql.org/download.html
If you don't get error messages when connecting to a PostgreSQL server, you don't have a driver problem.
The fact that your table list is empty probably means that HeidiSQL fires a wrong query to get them. Please post the last 10 lines of your SQL log when you click your empty database.
Without writing database name on session manager and selecting it on left panel:
/* Delimitador cambiado a ; */
/* Conectando a localhost por PostgreSQL (experimental), usuario postgres, usando contraseña: Yes ... */
SELECT VERSION();
/* Conectado. ID de Hilo: 2728 */
SET statement_timeout TO 0;
SELECT EXTRACT(EPOCH FROM CURRENT_TIMESTAMP - pg_postmaster_start_time())::INTEGER;
SELECT "schema_name" FROM "information_schema"."schemata" ORDER BY "schema_name";
/* Entrando a la sesión "localhost PGSQL" */
SELECT *, pg_table_size(CONCAT(t.TABLE_SCHEMA, '.', t.TABLE_NAME)) AS data_length, pg_relation_size(CONCAT(t.TABLE_SCHEMA, '.', t.TABLE_NAME)) AS index_length, c.reltuples, obj_description(c.oid) AS comment FROM "information_schema"."tables" AS t LEFT JOIN "pg_class" c ON c.relname=t.table_name LEFT JOIN "pg_namespace" n ON (n.oid = c.relnamespace) WHERE t."table_schema"='public';
SET SCHEMA 'public';
Writing database name on session manager and selecting it on left panel:
/* Delimitador cambiado a ; */
/* Conectando a localhost por PostgreSQL (experimental), usuario postgres, usando contraseña: Yes ... */
SELECT VERSION();
/* Conectado. ID de Hilo: 2794 */
SET statement_timeout TO 0;
SELECT EXTRACT(EPOCH FROM CURRENT_TIMESTAMP - pg_postmaster_start_time())::INTEGER;
SET SCHEMA 'sapcine';
/* Entrando a la sesión "localhost PGSQL" */
SELECT *, pg_table_size(CONCAT(t.TABLE_SCHEMA, '.', t.TABLE_NAME)) AS data_length, pg_relation_size(CONCAT(t.TABLE_SCHEMA, '.', t.TABLE_NAME)) AS index_length, c.reltuples, obj_description(c.oid) AS comment FROM "information_schema"."tables" AS t LEFT JOIN "pg_class" c ON c.relname=t.table_name LEFT JOIN "pg_namespace" n ON (n.oid = c.relnamespace) WHERE t."table_schema"='sapcine';
* Do not use the "Databases" setting for the db tree, just use it to set the single db name in PostgreSQL mode.
* Use "postgres" as default db (was "template1")
* Turn checkable dropdown menu items into radio items in PostgreSQL mode
See issue #3190 and http://www.heidisql.com/forum.php?t=16072
SELECT *, pg_table_size(t.TABLE_SCHEMA || '.' || t.TABLE_NAME) AS data_length
, pg_relation_size(t.TABLE_SCHEMA || '.' || t.TABLE_NAME) AS index_length, c.reltuples, obj_description(c.oid) AS COMMENT
FROM "information_schema"."tables" AS t
LEFT JOIN "pg_class" c ON c.relname=t.table_name
LEFT JOIN "pg_namespace" n ON (n.oid = c.relnamespace);
Main problem I was having was because some of the database object names were in uppercase. PGAdminIII does not seem to mind this but Heidi (correctly) throws errors.
Thanks to ansgar for a great piece of work much more friendly than PGAdmin. Will still have to use PGAdmin as I need to use the shapefile loader plugin. Unless its possible to use the plugin in Heidi of course?
Console log:
/* ERROR: function concat(information_schema.sql_identifier, unknown, information_schema.sql_identifier) does not exist
LINE 1: SELECT *, pg_table_size(CONCAT(t.TABLE_SCHEMA, '.', t.TABLE_...
HINT: No function matches the given name and argument types. You might need to add explicit type casts. */
This fix error:
This fulfills a request like:
SELECT *, pg_table_size(t.TABLE_SCHEMA || '.' || t.TABLE_NAME) AS data_length
, pg_relation_size(t.TABLE_SCHEMA || '.' || t.TABLE_NAME) AS index_length, c.reltuples, obj_description(c.oid) AS COMMENT
FROM "information_schema"."tables" AS t
LEFT JOIN "pg_class" c ON c.relname=t.table_name
LEFT JOIN "pg_namespace" n ON (n.oid = c.relnamespace);
Support older PostgreSQL servers in TPGConnection.FetchDbObjects. See http://www.heidisql.com/forum.php?t=16072#p16138
CREATE TABLE "users_info_ext" (
"uin" TEXT NOT NULL,
"pass" TEXT NULL,
"ulock" SMALLINT NULL,
"llog" TEXT NULL,
"iadr" TEXT NULL,
"bcst" SMALLINT NULL,
"cdate" TEXT NULL,
"cpass" SMALLINT NULL,
"nick" TEXT NULL,
"frst" TEXT NULL,
"last" TEXT NULL,
"email1" TEXT NULL,
"email2" TEXT NULL,
"email3" TEXT NULL,
"e1publ" SMALLINT NULL,
"gmtoffs" SMALLINT NULL,
"auth" SMALLINT NULL,
"sex" SMALLINT NULL,
"age" SMALLINT NULL,
"bday" SMALLINT NULL,
"bmon" SMALLINT NULL,
"byear" SMALLINT NULL,
"waddr" TEXT NULL,
"wcity" TEXT NULL,
"wstate" TEXT NULL,
"wcountry" INTEGER NULL,
"wcompany" TEXT NULL,
"wtitle" TEXT NULL,
"wocup" SMALLINT NULL,
"wdepart" TEXT NULL,
"wphon" TEXT NULL,
"wfax" TEXT NULL,
"wpager" TEXT NULL,
"wzip" TEXT NULL,
"wweb" TEXT NULL,
"notes" TEXT NULL,
"haddr" TEXT NULL,
"hcity" TEXT NULL,
"hstate" TEXT NULL,
"hcountry" INTEGER NULL,
"hphon" TEXT NULL,
"hfax" TEXT NULL,
"hcell" TEXT NULL,
"hzip" TEXT NULL,
"hweb" TEXT NULL,
"nnotes" TEXT NULL,
"lang1" SMALLINT NULL,
"lang2" SMALLINT NULL,
"lang3" SMALLINT NULL,
"hpage_cf" SMALLINT NULL,
"hpage_cat" INTEGER NULL,
"hpage_txt" TEXT NULL,
"wdepart2" TEXT NULL,
"past_num" SMALLINT NULL,
"past_ind1" INTEGER NULL,
"past_key1" TEXT NULL,
"past_ind2" INTEGER NULL,
"past_key2" TEXT NULL,
"past_ind3" INTEGER NULL,
"past_key3" TEXT NULL,
"int_num" SMALLINT NULL,
"int_ind1" INTEGER NULL,
"int_key1" TEXT NULL,
"int_ind2" INTEGER NULL,
"int_key2" TEXT NULL,
"int_ind3" INTEGER NULL,
"int_key3" TEXT NULL,
"int_ind4" INTEGER NULL,
"int_key4" TEXT NULL,
"aff_num" SMALLINT NULL,
"aff_ind1" INTEGER NULL,
"aff_key1" TEXT NULL,
"aff_ind2" INTEGER NULL,
"aff_key2" TEXT NULL,
"aff_ind3" INTEGER NULL,
"aff_key3" TEXT NULL,
"iphide" SMALLINT NULL,
"webaware" SMALLINT NULL,
PRIMARY KEY ("uin")
);
Use SUBSTR() alternative to LEFT() on PostgreSQL table data selection. See http://www.heidisql.com/forum.php?t=16072
SELECT "uin" , LEFT("pass",256) pass, "ulock"
-- , LEFT("llog", 256) yyy
FROM "public"."users_info_ext";
it worked
---
SELECT "uin" , LEFT("pass",256) pass, "ulock"
, LEFT("llog", 256) yyy
FROM "public"."users_info_ext";
not worked
---
/* ERROR: function left(double precision, integer) does not exist
LINE 2: , LEFT("llog", 256) yyy
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts. */
---
hmm column "pass" and "llog" type text, what could be wrong?
P.S. and function substr same problem
CREATE TABLE users_info_ext (
uin double precision NOT NULL,
pass text,
ulock smallint,
llog double precision,
iadr double precision,
bcst smallint,
cdate double precision,
cpass smallint,
nick text,
frst text,
last text,
email1 text,
email2 text,
email3 text,
e1publ smallint,
gmtoffs smallint,
auth smallint,
sex smallint,
age smallint,
bday smallint,
bmon smallint,
byear smallint,
waddr text,
wcity text,
wstate text,
wcountry integer,
wcompany text,
wtitle text,
wocup smallint,
wdepart text,
wphon text,
wfax text,
wpager text,
wzip text,
wweb text,
notes text,
haddr text,
hcity text,
hstate text,
hcountry integer,
hphon text,
hfax text,
hcell text,
hzip text,
hweb text,
nnotes double precision,
lang1 smallint DEFAULT 0,
lang2 smallint DEFAULT 0,
lang3 smallint DEFAULT 0,
hpage_cf smallint DEFAULT 0,
hpage_cat integer DEFAULT 0,
hpage_txt text DEFAULT ''::text,
wdepart2 text DEFAULT ''::text,
past_num smallint DEFAULT 0,
past_ind1 integer DEFAULT 0,
past_key1 text DEFAULT ''::text,
past_ind2 integer DEFAULT 0,
past_key2 text DEFAULT ''::text,
past_ind3 integer DEFAULT 0,
past_key3 text DEFAULT ''::text,
int_num smallint DEFAULT 0,
int_ind1 integer DEFAULT 0,
int_key1 text DEFAULT ''::text,
int_ind2 integer DEFAULT 0,
int_key2 text DEFAULT ''::text,
int_ind3 integer DEFAULT 0,
int_key3 text DEFAULT ''::text,
int_ind4 integer DEFAULT 0,
int_key4 text DEFAULT ''::text,
aff_num smallint DEFAULT 0,
aff_ind1 integer DEFAULT 0,
aff_key1 text DEFAULT ''::text,
aff_ind2 integer DEFAULT 0,
aff_key2 text DEFAULT ''::text,
aff_ind3 integer DEFAULT 0,
aff_key3 text DEFAULT ''::text,
iphide smallint DEFAULT 0,
webaware smallint DEFAULT 1
);
Support data types with spaces in them, for example "DOUBLE PRECISION" on PostgreSQL. See http://www.heidisql.com/forum.php?t=16072#p16169
I have installed the last r4805 release, using PostgreSQL 9.3.5 on a Windows 7 64 bit computer.
I still have the same error when I go on the Data tab :
"ERROR: function substr(bit, integer, integer) does not exist..."
This is because a column that has the BIT data type is probably detected as a text column.
Could you add this data type to the list of non-text types ?
Thanks a lot in advance,
Cedric
Support BIT and BIT VARYING data types in PostgreSQL without SQL errors in Data tab. See http://www.heidisql.com/forum.php?t=16072#p16180
We are in danger of trying to run before we can walk. i.e. priority must be to get Postgres working correctly before we tackle the PostGIS extension issues.
Postgres support remains, after all 'experimental'.
@ansgar is, I know trying to deal with a number of issues regarding the subtle differences between MySQL and Postgres but given time and patience, I am sure the reward will be worth the effort. Then we can put pgadminIII away forever.
We must continue to support his laudable work and significant progress has been made so far.
There are also issues with creating indexes but that is another thread.
Thanks ansgar.
SELECT "gid", SUBSTR("naer13cd", 0, 256), SUBSTR("naer13cdo", 0, 256), SUBSTR("naer13nm", 0, 256), SUBSTR("geom", 0, 256) FROM "public"."naer_dec_2013_wa_bfe" LIMIT 1000;
/* ERROR: function substr(geometry, integer, integer) is not unique
LINE 1: ...aer13cdo", 0, 256), SUBSTR("naer13nm", 0, 256), SUBSTR("ge...
Add support for geometry data types in PostgreSQL. See http://www.heidisql.com/forum.php?t=16072#p16198
"function substr(public.geometry, integer, integer) is not unique.
HINT : Could not choose a best candidate function. You might need to add explicit type casts."
Thanks for all you efforts.
column_name;column_default;is_nullable;data_type;character_maximum_length;udt_name
gid;nextval('oa_2011_ew_pwc_gid_seq'::regclass);NO;integer;\N;int4
oa11cd;\N;YES;character varying;9;varchar
geom;\N;YES;USER-DEFINED;\N;geometry
geom geometry(Point)
geom geometry(Line)
geom geometry(Polygon)
geom geometry(MultiPolygon)
As follows
Does this help?
CREATE TABLE public.oa_2011_ew_pwc
(
gid integer NOT NULL DEFAULT nextval('oa_2011_ew_pwc_gid_seq'::regclass),
oa11cd character varying(9),
geom geometry(Point),
CONSTRAINT oa_2011_ew_pwc_pkey PRIMARY KEY (gid)
Add support for BOOLEAN column data type in PostgreSQL. See http://www.heidisql.com/forum.php?t=16072#p16204
alter table geom add column geotest geometry(Point);
/* FEHLER: Typ „geometry“ existiert nicht
LINE 1: alter table geom add column geotest geometry(Point) */
Which means as much as "Type "geometry" does not exist".
-- Enable PostGIS (includes raster)
CREATE EXTENSION postgis;
-- Enable Topology
CREATE EXTENSION postgis_topology;
-- fuzzy matching needed for Tiger
CREATE EXTENSION fuzzystrmatch;
-- Enable US Tiger Geocoder
CREATE EXTENSION postgis_tiger_geocoder;
I created a simple table and then ran a query similar to yours and it works?
http://postgis.net/
When you installed PostgreSQL database server, the PostgreSQL installer also installed some useful tools for working with the database server. You can connect to the PostgreSQL database server by using the psql or pgAdmin tool.
Connect to PostgreSQL database using psql psql is an interactive terminal program provided by PostgreSQL. You can do a lot with psql tool e.g., execute SQL statements, manage database objects, etc.
The following steps show you how to connect to the PostgreSQL database server by using the psql program:
First launch psql program.
Second, enter all the required information such as the server, database, port, username, and password. If you press enter, psql will use default values inside the square brackets.
Third, you can interact with PostgreSQL database server by using various SQL statements. You can try the following statement to test it out:
1 SELECT version(); psql tool
Please do not forget to put the semicolon (;) at the end of the statement. After pressing enter, psql will give you the current PostgreSQL version that you have in the system.
Connect to PostgreSQL database using pgAdmin GUI application The second way to connect to a database is using pgAdmin GUI application. By using pgAdmin GUI application, you can interact with PostgreSQL database server via an intuitive user interface.
The following illustrates how to connect to a database using pgAdmin GUI application:
First, launch the pgAdmin application.
Launch pgAdmin
Second, double-click the PostgreSQL 9.2 under the Servers item. pgAdmin will ask you for the password. You have to provide the password for the postgres user. Once finish, click OK button to log in to the PostgreSQL server.
pgAdmin Enter Password
Third, choose the postgres database and click Execute Arbitrary SQL queries tool from the pgAdmin’s toolbar.
Launch SQL editor Fourth, enter the following statement:
Execute SQL query
Fifth, click the execute query button in the toolbar, pgAdmin will display the result in the output panel.
pgadmin output
Connect to PostgreSQL database from other applications Any application that supports ODBC or JDBC can connect to PostgreSQL database server. In addition, if you develop an application that uses an appropriate driver, the application can connect to the PostgreSQL database server as well.
In this tutorial, you’ve learned how to connect to PostgreSQL database server by using different client tools including psql and pgAdmin GUI application. Let’s explore the PostgreSQL database objects and find out how can we use them in our applications.
Thank you very much for your response.
I am actively using "SQL Manager" for PostgreSQL.
In my previous projects I was using MySQL - HeidiSQL ...
HeidiSQL has a lot of success and Easy to Use interface ...
When I see the posts for older versions of PostgreSQL, I have written in the hope that a study can be done for the current version ...
I thank HeidiSQL developer friends and wish them continued success.
Respects
Please login to leave a reply, or register at first.