When importing a cvs file into postgresql using pgadmin III, it says import successful and then I am able to hit done. However, when I look into the table -- no data is there. Has anyone experienced a similar issue ? I have imported in the past, with no change in environment, to success, but I do not know what is happening now
Related
I use a PostgreSQL database on my local computer. I always import csv files via right-click to the relevant table and choosing the Import/Export Dialog. However, when I opened the pgadmin last time, there was no import/export option in the options. I do not know what happened to it. I, once, took a backup of files and use this backup file to migrate the database to another version of Postgres. I am not sure but I want to ask might one of the options that I selected or did not select cause this trouble?
I also tried to go in an alternative way by using copy from 'C://path/data.csv method and it did not work. then I tried \copy from 'C://path/data.csv but it did not even recognize the \ symbol and gave an error.
I wonder what happened to Postgres or pgadmin and how can I find a solution to import my data to the Postgres database?
I had the same issue, looked everywhere but nothing came up on WHY this happened or HOW to fix it.
RESOLUTION: I was able to resolve this by downloading the latest version of pgadmin4.
After downloading, the Import/Export dialog reappeared.
Hope this helps you too!
Import/Export Dialog - Resolved
I've loaded the finished DVDRental demo app
with
git clone -b branches/10-customized \
https://github.com/DirectToSwift/DVDRental.git
as well as tried it with
git clone -b branches/01-default-rulemodel \
https://github.com/DirectToSwift/DVDRental.git
(see http://www.alwaysrightinstitute.com/directtoswiftui/) and restored the demo database.
Currently, I am trying to execute the app, following the instructions on http://www.alwaysrightinstitute.com/directtoswiftui/ and ReadMe from https://github.com/DirectToSwift/DVDRental. Which means I have named the database accordingly and built the app. In fact, you should only install the database, download the project and it should be running without any change. However, the app remains on the launch screen, showing a "connecting database" message.
Through an exhaustive debugging process, I came to the conclusion that there is something wrong with the authentication. However, I could not determine what exactly goes wrong.
Is there anybody who tried it and it worked?
Using:
Xcode 11.3.1; Swift 5; iOS 13; Postgres.app Version 2.3.3e; PostgreSQL 12
Any idea how to solve the problem?
Update: there is no problem with the database. I can connect via psql, clients such as postico or navicat, or with my own apps using PostgresClientKit. The problem has been tracked down to the authentication process. Therefore I'm pretty sure that the problem lies somewhere there
Apparently, the developers "forgot" to enable authentication.
Right, it is quite possible that I didn't have auth on. I'll see
whether I can give it a try on the weekend.
needless to say, two months later it is still not fixed
I am having an odd problem with PostGreSQL/PostGIS on a Windows 10 machine.
I have successfully installed PostGIS many times without issue over the years, most recently last week on a Windows 10 machine at work. I typically use QGIS as my client, so have a fair idea how these things need to be configured and operated.
Over the weekend, I downloaded the latest PostGres 11 installer with Stackbuilder, and installed PostGres & PostGIS. pgAdmin4 seems to show everything is as it should be, and the sample 'postgis_23_sample' database is present and correct.
However, using QGIS DB Manager, when I try to connect to the database (on port 5432), whilst I can see the sample database and public schema, I cannot create a new table with geometry, or load any data (e.g. a simple shapefile) into the database. The error message tells me that the 'addGeometryColumn' function does not exist. I checked that the PostGIS extension is installed - which it is. (I ran 'CREATE EXTENSION postgis' again to confirm this.)
So, I went back to pgAdmin, and tried creating a table with geometry via SQL, but got the same error: Creating a table without geometry works just fine. As soon as I try to create a geometry column, I get the error. It seems to me that the PostGIS extension is somehow not being 'found' by PostGres.
I have uninstalled and reinstalled various combinations of PostGres, PostGIS and QGIS over the weekend - but get the same error. I created a new Windows account, and tried installing the stack there: same thing happened.
I also tried uninstalling everything and then installing the 'Portable GIS' stack by Astun. These are much older versions of QGIS and PostGIS, but in theory the installer configures them all to work together. (That, at least, has been my past experience of using Portable GIS at work.) In this instance, I got the same error about the missing AddGeometryColumn function.
I am wondering if the various installs of PostGIS, QGIS and other tools over the last year or so have left some stubborn configuration entries (maybe in the registry?) that uninstallers have not been able to remove. Could something like that be upsetting my recent PostGres insatllations? It feels as though something is preventing DB clients from locating the PostGIS services on the assigned port. Having said that, PostGres iteslef seems to be working fine, so maybe that is nonsense.
In any case, if anyone has any ideas how I can begin to debug and fix this, I would be hugely grateful. (In the meantime, I am about to try the OSGeoLive Lubuntu VM, which at least will enable me to get some proper work done - I hope.)
Thank you...
I was having trouble importing a csv, so I created a table without loading and went through the pgAdmin 4 importer - which worked! But now I want to see what it did differently to make it work. Is there a way to see the script behind the import job?
Thanks!
Check the pgAdmin4.log, You might get the complete command executed by pgAdmin4 in the log file itself.
Do you have recommendations for a good PostgreSQL editor plugin for Eclipse?
The PostgreSQL code I have isn't very complex. However I'd like to edit it with syntax-coloring, decent auto-identation, code completion, etc., and it would be sweet to be able to send blocks or entire files to a jdbc connection and get the results. Up until now, I have edited my .sql files with Emacs, and try things by copying/pasting segments into a psql terminal I have next to Emacs. Some of my code uses the psql primitives such as \set var value etc. For example:
\set t mytable
drop table if exists :t;
create table :t (...);
However I would be happy to eliminate this and refactor the code to be proper PL/pgSQL functions. Or perhaps better, implement the dependency and procedural logic in Java and issue the sql queries via JDBC. I still need to edit the sql files and try bits and pieces of them during development.
I tried the "official" Data Tools Platform (http://eclipse.org/datatools/) and configured it to use my localhost:5432 (which in fact is a port-forward via SSH to the actual PostgreSQL server that I'm using). However, connecting to the DB hangs for several minutes (Eclipse doesn't even refresh the screen). In general it feels quite heavy/slow
and I'm always afraid of if hanging without ability to interrupt it (it happened a few times and the only solution is to kill Eclipse; as you probably know, killing Eclipse isn't good as it's very hard/impossible to recover unsaved files).
The other plugin I tried is Toby's PL/SQL editor (https://sourceforge.net/projects/plsqleditor/), which seems very nice and promising, except the last signs of life on the sourceforge forums appear to be around 2007. Also I couldn't configure it to use the postgresql-9.0-801.jdbc4.jar that I have, and so I am unable to connect to my DB.
Any suggestions gladly appreciated.
A free Eclipse plugin for Oracle and PostgreSQL can be found at http://www.toadworld.com/products/toad-extension-for-eclipse/default.aspx
The plugin is in development.