Most Popular
1500 questions
1402
votes
7 answers
How do I list all databases and tables using psql?
I am trying to learn PostgreSQL administration and have started learning how to use the psql command line tool.
When I log in with psql --username=postgres, how do I list all databases and tables?
I have tried \d, d and dS+ but nothing is listed. I…
Jonas
- 29,165
- 26
- 57
- 64
504
votes
4 answers
How do you mysqldump specific table(s)?
How can I dump a specific table or set of tables without including the rest of the db tables?
markdorison
- 5,175
- 3
- 14
- 6
473
votes
2 answers
What's the difference between a temp table and table variable in SQL Server?
This seems to be an area with quite a few myths and conflicting views.
So what is the difference between a table variable and a local temporary table in SQL Server?
Martin Smith
- 77,689
- 15
- 224
- 316
417
votes
5 answers
List all columns for a specified table
I'm looking for a precise piece of information in a database which I have no knowledge about. The database is on a separate machine, but I can log into it, and launch a psql command line, with administrator rights.
It's a third-party product, and…
Stephane Rolland
- 7,003
- 8
- 27
- 39
356
votes
4 answers
How do I list all schemas in PostgreSQL?
When using PostgreSQL v9.1, how do I list all of the schemas using SQL?
I was expecting something along the lines of:
SELECT something FROM pg_blah;
Stéphane
- 4,595
- 3
- 16
- 12
311
votes
3 answers
How can I time SQL-queries using psql?
I would like to benchmark some SQL-queries agains my PostgreSQL database. Is there any way I can time SQL-queries using psql?
Jonas
- 29,165
- 26
- 57
- 64
307
votes
4 answers
How to insert values into a table from a select query in PostgreSQL?
I have a table items (item_id serial, name varchar(10), item_group int) and a table items_ver (id serial, item_id int, name varchar(10), item_group int).
Now I want to insert a row into items_ver from items. Is there any short SQL-syntax for doing…
Jonas
- 29,165
- 26
- 57
- 64
292
votes
15 answers
Can MySQL reasonably perform queries on billions of rows?
I am planning on storing scans from a mass spectrometer in a MySQL database and
would like to know whether storing and analyzing this amount of data is remotely
feasible. I know performance varies wildly depending on the environment, but I'm
looking…
haxney
- 2,383
- 2
- 12
- 7
289
votes
4 answers
Why Does the Transaction Log Keep Growing or Run Out of Space?
This one seems to be a common question in most forums and all over the web, it is asked here in many formats that typically sound like this:
In SQL Server -
What are some reasons the transaction log grows so large?
Why is my log file so big?
What…
Mike Walsh
- 17,793
- 6
- 45
- 72
283
votes
12 answers
connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host
Hello I am trying to run a website sent to me but after doing so this error appeared
connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "4X.XXX.XX.XXX", user "userXXX", database "dbXXX", SSL off in C:\xampp\htdocs\xmastool\index.php…
Jin
- 2,943
- 2
- 11
- 6
272
votes
10 answers
What are the main differences between InnoDB and MyISAM?
What are the main differences between InnoDB and MyISAM?
ilhan
- 2,929
- 5
- 18
- 13
267
votes
18 answers
How can I monitor the progress of an import of a large .sql file?
I am importing a 7 GB foobar.sql to restore a table in a local database.
$ mysql -h localhost -u root 'my_data' < foobar.sql
$ mysql --version
/usr/local/mysql/bin/mysql Ver 14.12 Distrib 5.0.96, for apple-darwin9.8.0 (i386) using readline…
qazwsx
- 3,137
- 9
- 20
- 21
249
votes
6 answers
When should I use a unique constraint instead of a unique index?
When I want a column to have distinct values, I can either use a constraint
create table t1(
id int primary key,
code varchar(10) unique NULL
);
go
or I can use a unique index
create table t2(
id int primary key,
code varchar(10) NULL
);
go
create…
bernd_k
- 11,741
- 23
- 73
- 108
246
votes
10 answers
List the database privileges using psql
I'm in the middle of a database server migration and I can't figure (after googling and searching here) how can I list the database privileges (or all the privileges across the server) on PostgreSQL using the psql command line tool?
I'm on Ubuntu…
pedrosanta
- 2,763
- 3
- 14
- 7
241
votes
18 answers
How do you document your databases?
I find that most of my clients are not documenting their databases at all and I find that pretty scary. To introduce some better practice, I would like to know what tools/process people are using.
How do you document your database? (SQL-Server)…
user316
- 961
- 3
- 7
- 4