pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joshua Tolley <eggyknap@gmail.com>
To: Jasen Betts <jasen@xnet.co.nz>
Cc: pgsql-sql@postgresql.org
Subject: Re: Greetings folks, dumb question maybe?
Date: Thu, 13 May 2010 06:37:56 -0600
Message-ID: <4bebf2ae.1249650a.19f4.2ea8@mx.google.com> (raw)
In-Reply-To: <hsgj5f$o21$1@reversiblemaps.ath.cx>
References: <4BEAE646.9050902@ttitech.net>
	<hsgj5f$o21$1@reversiblemaps.ath.cx>

On Thu, May 13, 2010 at 10:09:51AM +0000, Jasen Betts wrote:
> On 2010-05-12, Josh <jgooding@ttitech.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

Attachments:

  signature.asc (application/pgp-signature, 196B) download

view thread (6+ messages)

Message-ID: <4bebf2ae.1249650a.19f4.2ea8@mx.google.com>
Permalink:  ../4bebf2ae.1249650a.19f4.2ea8@mx.google.com/
Also on:    postgresql.org/message-id/4bebf2ae.1249650a.19f4.2ea8@mx.google.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: eggyknap@gmail.com, jasen@xnet.co.nz
  Subject: Re: Greetings folks, dumb question maybe?
  In-Reply-To: <4bebf2ae.1249650a.19f4.2ea8@mx.google.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox