Most Popular

1500 questions
1500
votes
8 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
  • 31,495
  • 27
  • 59
  • 64
524
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,375
  • 3
  • 15
  • 6
487
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,903
  • 8
  • 29
  • 40
480
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
  • 80,333
  • 15
  • 230
  • 323
384
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,945
  • 4
  • 17
  • 12
359
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
  • 31,495
  • 27
  • 59
  • 64
332
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
  • 31,495
  • 27
  • 59
  • 64
330
votes
12 answers

connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host

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 on…
Jin
  • 3,413
  • 3
  • 12
  • 6
300
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,463
  • 2
  • 13
  • 7
297
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
  • 18,013
  • 6
  • 46
  • 72
285
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,327
  • 9
  • 21
  • 21
279
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
  • 3,093
  • 3
  • 15
  • 7
278
votes
10 answers

What are the main differences between InnoDB and MyISAM?

What are the main differences between InnoDB and MyISAM?
ilhan
  • 3,009
  • 5
  • 19
  • 13
266
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
  • 12,001
  • 23
  • 74
  • 109
245
votes
5 answers

How large should be mysql innodb_buffer_pool_size?

I have a busy database with solely InnoDB tables which is about 5GB in size. The database runs on a Debian server using SSD disks and I've set max connections = 800 which sometimes saturate and grind the server to halt. The average query per second…
alfish
  • 2,844
  • 6
  • 19
  • 18
1
2 3
99 100