Re: Greetings folks, dumb question maybe? - Mailing list pgsql-sql

From Richard Broersma
Subject Re: Greetings folks, dumb question maybe?
Date
Msg-id AANLkTikyHpSv1d6mWLk0NfMJ3mpqqHpmnNfuTf7SY5EO@mail.gmail.com
Whole thread Raw
In response to Greetings folks, dumb question maybe?  (Josh <jgooding@ttitech.net>)
Responses Re: Greetings folks, dumb question maybe?  ("Little, Douglas" <DOUGLAS.LITTLE@orbitz.com>)
List pgsql-sql
On Wed, May 12, 2010 at 10:32 AM, Josh <jgooding@ttitech.net> wrote:

> I am trying to create a function that loads 100M test records into a
> database,  however I am having a hard time building the function that does
> so.

Here is one idea a function, but is could be wrapped by one:

p2082849b=> INSERT INTO Testtable ( n, c, d )
p2082849b-> WITH RECURSIVE T(n,c,d) as ( SELECT 1, 'A', CAST(
'2009-12-31' AS DATE ) + INTERVAL '1 DAY'
p2082849b(>                    UNION ALL SELECT n + 1, c, d + INTERVAL '1 day'
p2082849b(>                                FROM T
p2082849b(>                               WHERE n <= 10000)
p2082849b-> SELECT n,c,d FROM T;
INSERT 0 10001


--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug


pgsql-sql by date:

Previous
From: Josh
Date:
Subject: Re: Greetings folks, dumb question maybe?
Next
From: "Little, Douglas"
Date:
Subject: Re: Greetings folks, dumb question maybe?