HeidiSQL 10.2 with Postgres doesnt show newly created database - postgresql

I connected PostgreSQL to heidiSQL and each time I create a new Database, it does not appear in the database list, even after refreshing or restarting Heidi.
If I try to create it back, it tells me that the database already exists.
I really don't know what to do by now

Most probably you told your session to display only one or some of all databases:
Remove these, or add the newly created database there to let HeidiSQL display it.

Related

adminer only displays one database

I download Adminer 4.2.5 from https://www.adminer.org/#download which is just one php file around 414 kB in size. I placed this in /localhost/ and was able to log in to database without any issues. But the only problem is that, I have about 24 databases, and adminer only shows tables and contents from 1 database.
This database also happens to be the first one indexed as it starts with letters ab.. so I am guessing it is only grabbing it, but this is not the database I want to fetch. Is there any solution for this?
Adminer will only ever show one database at a time.
You can switch databases very simply, by using the standard links at the top of your screen (just to the left of your "logout" button). I.e.:
MySQL » Server » yourDatabaseName » Table: yourTableName
In this example, clicking on "Server" will return a list of all of the databases to which you have access.
If you can not see a database which you know to exist, you may have a permission and/or access error.
Found an easy alternative.
While logging in with a username and password, there's an option of typing the database name. If the database exists and the user has the rights, the tables in the DB will open up.

Trying to overwrite sqlite database in iPhone app update

Unlike most sqlite apps where developers don't want to overwrite data in a sqlite database, I'm trying to enable an app to overwrite all data with future updates. The sqlite database will have the exact same name and have the same tables, I just want to be able to update the data contained in the database without making users delete the app and reinstall it. Is there an easy method to do this?
Thanks in advance!
A SQLite database file is just a normal file, so no special steps are needed. Get the path or URL to the file, and use NSFileManager's -removeItemAtPath:error: or -removeItemAtURL:error:. Then create the new database the same way you created the old one.

sqlite DB to-do during iphone app update

I have some general questions about iphone app updates that involves sqlite db.
With the new update does the existing sqlite db get overwritten with a copy of the new one?
If the update doesn't involve any schema changes then the user should be able to reuse the existing database with their saved data, right? (if the existing database doesn't get overwritten from 1 above )
If there are some schema changes, what's the best way to transfer data from the old database into the new one? Can some one please give me guidelines and sample code?
Only files inside the app bundle are replaced. If the database file is in your app's Documents directory, it will not be replaced. (Note that if you change files inside your app bundle, the code signature will no longer be valid, and the app will not launch. So unless you are using a read-only database, it would have to be in the Documents directory.)
Yes.
What's best depends on the data. You're not going to find sample code for such a generic question. First, you need to detect that your app is running with an old DB version. Then you need to upgrade it.
To check versions:
You could use a different file name for the new schema. If Version2.db does not exist but Version1.db does, do an upgrade.
You could embed a schema version in your database. I have a table called metadata with a name and value column. I use that to store some general values, including a dataversion number. I check that number when I open the database, and if it is less than the current version, I do an upgrade.
Instead of creating a table, you could also use sqlite's built-in user_version pragma to check and store a version number.
You could check the table structure directly: look for the existence of a column or table.
To upgrade:
You could upgrade in place by using a series of SQL commands. You could even store a SQL file inside your app bundle as a resource and simply pass it along to sqlite3_exec to do all the work. (Do this inside a transaction, in case there is a problem!)
You could upgrade by copying data from one database file to a new one.
If your upgrade may run a long time (more than one second), you should display an upgrading screen, to explain to the user what is going on.
1) The database file isn't stored as part of the app bundle so no, it won't get automatically overwritten.
2) Yes - all their data will be saved. In fact, the database won't get touched at all by the update.
3) This is the tricky one - read this fantastically interesting document - especially the part on lightweight migration - if your schema changes are small and follow a certain set of rules, they will happen automatically and the user won't notice. however, if ther are major changes to the schema you will have to write your own migration code (that's in that links as well)
I've always managed to get away with running lightweight migrations myself - it's by far easier than doing it yourself.
What I do is that I create a working copy of the database in the Documents directory. The main copy comes with the bundle. When I update the app I then have the option to make a new copy over the working copy, or leave it.

i lose my linked tables when closing access

i create a linked table and it works fine. but when i close access and open it again the table is gone. why is that happening ?
i am using access 2003.
I'm not sure if you have resolved this, but I have had the same problem years ago. I speculate it is due to a corrupt database.
My workaround was to copy all the objects from one database to a new database.
Please ensure the MDB file does not have a read-only attribute or other restriction on updating it.

iPhone SQLite File management

I'm developing an application and I'm using SQLite as my database storage.
I want to add and update the sqlite database throughout my application duration, so i copied it to the documents directory so i can do all kinds of stuff with my database except only selecting from it.
But since I'm developing "time", my database changes frequently (the database architecture is made by another developer) through the process
On the iPhone i'm checking
if the database exists in the documents directory
(if not) copy it to it.
use that database
but when i want to update my database ( i made in a separate sqlite manager ) it fails through the process of copying the newer version because i'm only checking if the database exists.
Does anyone of you guys experienced the same kind of problem ? and what did you do to pass this kind of problem ..
my only idea was to create a settings table and hold a row that check's for a version number of the database..
Is there also a way to edit the sql file from the documents directory in any sqlite management tool ?
or are there better solutions ?
What i did in my app:
- First i do the same thing. Check whether DB is in Documents or not.
- Then i check the previously installed version: small text file in documents tells me this
- If there is a need of an update, i merge the databases: the one in /Documents with the another one from app bundle.
- In my case i need to merge. In yours may be you can just copy over, if user doesn't change it.
What I do is create a series of sql scripts that are capable of upgrading from a previous version 1.sql, 2.sql, 3.sql, etc. When i open my database i query the version from a settings table and compare it with the newest .sql file i've found in my application bundle. If there is a newer version i begin running the .sql scripts until i have encountered the latest version. This has worked out pretty well for me on a couple of projects now.
Did you try to delete application on iPhone, and after that to deploy application again?
What I do is similar to what you did, except I added a small second table to the database. This database just contains one record - a database version number. So you start with version 1 in this database table. Then, when you change the structure, you update this version number to 2. In your startup code, check to see if the database exists. If so, check the version number of the database. If the version number of the database matches what you expect, just continue. If it's less than what you expect, call some code to upgrade the database to the current version and then continue.