Most Popular

1500 questions
45
votes
3 answers

select rows where column contains same data in more than one record

I have a table that has a column called article_title. Let's say the table name is articles. I need to find out the records where the article_title data is the same on more than one record. Here's what I've got: select a.* from articles a where…
somejkuser
  • 797
  • 3
  • 8
  • 15
45
votes
3 answers

Using PostgreSQL 8.4, how to convert bytea to text value in postgres?

In my application I insert data in database using C code, since the strings I receive from an untrusted source I have escaped them using PQescapeByteaConn of libpq library. Which is working perfectly fine i.e. results in Octet format String. See…
Amit
  • 591
  • 2
  • 5
  • 10
45
votes
4 answers

Can listen_addresses really be set to a list?

I have a VM with IP address 192.168.0.192 running postgreSQL. If I specify listen_addresses = '*' then I can connect from another VM at 192.168.0.191 and from localhost. But I can't seem to use a list to tell postgreSQL to use those two addresses. …
zabouti
  • 553
  • 1
  • 4
  • 4
45
votes
1 answer

Why does CREATE INDEX ... WITH ONLINE=ON block access to the table over a period of minutes?

I have an existing table: CREATE TABLE dbo.ProofDetails ( ProofDetailsID int NOT NULL CONSTRAINT PK_ProofDetails PRIMARY KEY CLUSTERED IDENTITY(1,1) , ProofID int NULL , IDShownToUser int NULL , UserViewedDetails…
Hannah Vernon
  • 70,928
  • 22
  • 177
  • 323
45
votes
6 answers

Best practices on common person fields (Name, email, address, gender etc...)

What are the most common best practices on length and data type on common fields like: First Name Last Name Address Email Sex State City Country Phone Number etc....
Snow_Mac
  • 563
  • 1
  • 4
  • 7
45
votes
2 answers

Most efficient way of bulk deleting rows from postgres

I'm wondering what the most efficient way would be to delete large numbers of rows from PostgreSQL, this process would be part of a recurring task every day to bulk import data (a delta of insertions + deletions) into a table. There could be…
tarnfeld
  • 639
  • 2
  • 6
  • 7
45
votes
9 answers

MySQL DB import/export command line in Windows

How do I import and export a local instance of a MySQL database via command-line interface? My operating system is Windows and WampServer server is installed.
Bharanikumar
  • 559
  • 1
  • 4
  • 5
45
votes
5 answers

Benefits of using backtick (`) in MySQL queries?

In MySQL we can create queries with or without the backtick (`) symbol. Example: SELECT * FROM TEST; SELECT * FROM `TEST`; Both works fine in mysql-console. Is there any technical difference between them? Is there any benefit using (`) over over…
Satish Pandey
  • 683
  • 1
  • 7
  • 13
45
votes
1 answer

Commonly Used Acronyms by Database Administrators

What are the most commonly used acronyms among database administrators and what are their correlated meanings? This is for the community and those searching for meanings of commonly used terms and acronyms when working with databases, etc.
tacotuesday
  • 611
  • 1
  • 7
  • 10
45
votes
6 answers

PostgreSQL: Force data into memory

Is there a systematic way to force PostgreSQL to load a specific table into memory, or at least read it from disk so that it will be cached by the system?
Adam Matan
  • 12,079
  • 30
  • 82
  • 96
45
votes
4 answers

Is it possible to install just the mongo Shell?

I have Docker installed and am running a MongoDB container for my local development on my Mac. The problem is that I can't connect to said DB easily from CLI. I have Robo 3T installed, but I would prefer to use the CLI client instead. Is there a…
CodeChimp
  • 553
  • 1
  • 4
  • 5
45
votes
1 answer

PostgreSQL - Truncate a table on cascade and reset all hierarchic sequences with 1

Is there any way to reset all the sequences of tables, when truncate a table on cascade. I already read this post How to reset sequence in postgres and fill id column with new data? ALTER SEQUENCE seq RESTART WITH 1; UPDATE t SET…
Youcef LAIDANI
  • 553
  • 1
  • 4
  • 10
45
votes
2 answers

What is a WITH CHECK CHECK CONSTRAINT?

I have some auto-generated T-SQL, which is probably valid, but I don't really understand. ALTER TABLE [dbo].[MyTable] WITH CHECK CHECK CONSTRAINT [My_FORIEGN_KEY]; I know what a foreign key constraint is, but what's the CHECK CHECK?
BanksySan
  • 1,011
  • 1
  • 12
  • 16
45
votes
3 answers

How do you calculate mysql max_connections variable?

How do you calculate mysql max_connections ? What do you take into consideration ?
Gabriel Solomon
  • 985
  • 2
  • 10
  • 13
44
votes
4 answers

How do I change the DEFINER of a VIEW in Mysql?

When I run mysqldump, I get an error: mysqldump: Got error: 1449: The user specified as a definer ('root'@'foobar') does not exist when using LOCK TABLES This makes sense because foobar is a legacy machine that no longer exists. How do I change the…
kfmfe04
  • 849
  • 2
  • 8
  • 12