Most Popular
1500 questions
1455
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
- 30,365
- 26
- 57
- 64
517
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,305
- 3
- 14
- 6
476
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
- 78,558
- 15
- 227
- 320
456
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,483
- 8
- 29
- 40
372
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,805
- 4
- 17
- 12
329
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
- 30,365
- 26
- 57
- 64
321
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
- 30,365
- 26
- 57
- 64
310
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
- 3,213
- 2
- 11
- 6
296
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,423
- 2
- 13
- 7
293
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,943
- 6
- 45
- 72
275
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,217
- 9
- 20
- 21
273
votes
10 answers
What are the main differences between InnoDB and MyISAM?
What are the main differences between InnoDB and MyISAM?

ilhan
- 2,949
- 5
- 18
- 13
258
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,883
- 3
- 15
- 7
254
votes
7 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,821
- 23
- 73
- 108
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