Received: from maia.hub.org (maia-1.hub.org [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 6EAB763289D for ; Thu, 13 May 2010 09:38:16 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 91136-09 for ; Thu, 13 May 2010 12:38:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yw0-f190.google.com (mail-yw0-f190.google.com [209.85.211.190]) by mail.postgresql.org (Postfix) with ESMTP id E4898632794 for ; Thu, 13 May 2010 09:38:08 -0300 (ADT) Received: by ywh28 with SMTP id 28so595963ywh.28 for ; Thu, 13 May 2010 05:38:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:cc :subject:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=VaCTrb4APPzaBTN3SZC2EDcBHLK4h8Oj6GG2VPvplkw=; b=fsXsjfDQl86qahj1g/pk14RR8bzDEmEVrfsTgOHjkuyP94DU8C7CnKsy+x2H4FGw2u DNEUMzDatnlScuK4Hfp8JfTLmWd1rssYZocpHppNil6UrdKusQ1SCgAfzmzMKAiwgj2q Iy/0ihtXk3OlpdZlspAMxw2J48V7Zw1yRbdQA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:cc:subject:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=KT8ZxVEgS1pJe8S7tMLy/MW7dhq7tWyQHCisPdLQbZw1aoNi4hjIWmu2QIaCrfegUg IqC6UbQAbAkSNQXkMADY+gQewMPxEAMAmb3ow7fenkseKw0AsdtjHKxGICSUEY2IVY/d C7rbamwgXwLFbOrNXIEyII1ILiLyYrXzrbmS0= Received: by 10.100.246.35 with SMTP id t35mr6336210anh.14.1273754287395; Thu, 13 May 2010 05:38:07 -0700 (PDT) Received: from eddie (c-67-182-224-31.hsd1.ut.comcast.net [67.182.224.31]) by mx.google.com with ESMTPS id a18sm1543048anl.13.2010.05.13.05.38.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 13 May 2010 05:38:06 -0700 (PDT) Message-ID: <4bebf2ae.1249650a.19f4.2ea8@mx.google.com> Date: Thu, 13 May 2010 06:37:56 -0600 From: Joshua Tolley To: Jasen Betts Cc: pgsql-sql@postgresql.org Subject: Re: Greetings folks, dumb question maybe? References: <4BEAE646.9050902@ttitech.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="smOfPzt+Qjm5bNGJ" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201005/62 X-Sequence-Number: 34110 --smOfPzt+Qjm5bNGJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 13, 2010 at 10:09:51AM +0000, Jasen Betts wrote: > On 2010-05-12, Josh wrote: > don't need a function for that one. >=20 > INSERT INTO unpart_tbl_test=20 > SELECT GENERATE_SERIES(0,9999999), > 'teststring data', > date '1995-01-01' +(floor(random()*36520)::int % 3652); =2E..and if you'd rather it were a function anyway, do this: CREATE FUNCTION populate_table() RETURNS VOID AS $$ INSERT INTO unpart_tbl_test=20 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 --smOfPzt+Qjm5bNGJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkvr8qQACgkQRiRfCGf1UMPzWgCbBD3PXXXdZ5fVItWLGB8i5ZbR Uk4An2Ma1aPlgejAHhF36cGFNKko44uS =abaA -----END PGP SIGNATURE----- --smOfPzt+Qjm5bNGJ--