| From: | Joshua Tolley <eggyknap(at)gmail(dot)com> |
|---|---|
| To: | Jasen Betts <jasen(at)xnet(dot)co(dot)nz> |
| Cc: | pgsql-sql(at)postgresql(dot)org |
| Subject: | Re: Greetings folks, dumb question maybe? |
| Date: | 2010-05-13 12:37:56 |
| Message-ID: | 4bebf2ae.1249650a.19f4.2ea8@mx.google.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
On Thu, May 13, 2010 at 10:09:51AM +0000, Jasen Betts wrote:
> On 2010-05-12, Josh <jgooding(at)ttitech(dot)net> wrote:
> don't need a function for that one.
>
> INSERT INTO unpart_tbl_test
> SELECT GENERATE_SERIES(0,9999999),
> 'teststring data',
> date '1995-01-01' +(floor(random()*36520)::int % 3652);
...and if you'd rather it were a function anyway, do this:
CREATE FUNCTION populate_table() RETURNS VOID AS $$
INSERT INTO unpart_tbl_test
SELECT GENERATE_SERIES(0,9999999),
'teststring data',
date '1995-01-01' +(floor(random()*36520)::int % 3652);
$$ LANGUAGE SQL;
--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Justin Graf | 2010-05-13 13:28:03 | Re: best paging strategies for large datasets? |
| Previous Message | Jasen Betts | 2010-05-13 10:51:22 | Re: [Trigger] Help needed with NEW.* and TG_TABLE_NAME |