Search Postgresql Archives

Re: filling database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/23/2013 03:29 AM, sachin kotwal wrote:
create sample table with one or two rows then use following command to
populate data.

INSERT INTO TABLE_NAME VALUES(generate_series(1,1000000000));

Cartesian joins are also useful - especially when you want semi-realistic data. A quick Google will get you a list of 1000 surnames and another 1000 given names. Then a cartesian join like:

select given.givenname, surnames.surname from given,surnames

will give you a million rows. Add a middle-initial column and you quickly expand to 26-million unique names. Need more? There are lists that go well beyond 1000 names or you can just use a full middle name instead of an initial and get a 1,000,000,000 names (or somewhat less if you eliminate names where first/middle/last name are the same).

Then you can chuckle at your newly integrated society with Huang Alexopoulos O'Leary, Albrecht Fernandez Grebenshchikov and Wekesa Étienne Nikoleta.

Add in similar lists of common town-names and street-names along with some generated street numbers and you will quickly exceed the world population and/or your storage capacity.

Cheers,
Steve




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux