Thread: Re: Press Release -- Numbers

Re: Press Release -- Numbers

From
greg@turnstep.com
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message


The major thing you can do, besides using a prepare, is to not bother
splitting 502 times, but only enough times so that the last field you
are going to use is included. In this case, the highest element you are
using is [25], which is actually the 26th element to be split. Add one
more and 0-25 will be split, while 26 will be one giant field:

  my @line = split(/\|/, $_, 27);

Since you already know exactly which fields you want from the split
result, we can specify those directly like this:

  my @line = (split(/\|/, $_, 27))[0,4,5,6,10,11,14,18,22,25];

The parenthesis around the split call force it to be evaluated first,
and then we slice out the values we need. Now @line holds exactly the
elements you want to add in. Just pass that in to a prepared statement.

You can also remove the chomp and the chop, as the ends of the line are
being discarded anyways. Moving the commit outside of the loop should
help too. Here's the final result:


my $SQL = "INSERT INTO cdl_16master VALUES(nextval('cdl_16_seq'),?,?,?,?,?,?,?,?,?,?";
my $sth = $dbh->prepare($SQL);

while(<FHD>) {
  my @line = (split(/\|/, $_, 27))[0,4,5,6,10,11,14,18,22,25];
  $sth->execute(@line);
}
$dbh->commit();


On a final note, you may want to create tables in the future that
automagically populate columns with sequences like this:

CREATE TABLE cdl_16master (
  myid INTEGER NOT NULL DEFAULT nextval('cd_16_seq'),
  ...
);

The drawback is that you will need to specify the exact columns to be
filled in the INSERT command, but this is really a good practice to
get into anyway.

Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200210291455

-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iD8DBQE9vunyvJuQZxSWSsgRAnFKAKD5Fkyl9TzEaRwrNTuX8dqvRa6SCACg3Bzd
pgaJNkoGC2hXvpE23Ko9CaE=
=wtsO
-----END PGP SIGNATURE-----



Press Release -- Just Waiting for Tom

From
"Josh Berkus"
Date:
Folks,

Thank you, everyone, for you help with the press release.   The only
thing we're waiting on, I believe, is a quote from Tom Lane on the new
release.   Last-minute copy edits, please, people?

http://techdocs.postgresql.org/guides/Pressrelease73

And can anyone persuade Tom to cough up a quote in the next 36 hours?

-Josh Berkus


Re: Press Release -- Just Waiting for Tom

From
Jason Hihn
Date:
FYI. I just tried to add a comment to the page, and I got <hr><b> rather
than the formatting of a hard-return and bolding. (i.e. "<hr><b>2002/11/18
10:22 EST (via web):</b><br>" appeared rather than it formatted.

I'll also ask what I asked there, here:
Are there any new replication/backup features?

-----Original Message-----
From: pgsql-advocacy-owner@postgresql.org
[mailto:pgsql-advocacy-owner@postgresql.org]On Behalf Of Josh Berkus
Sent: Sunday, November 17, 2002 2:44 PM
To: pgsql-advocacy@postgresql.org
Subject: [pgsql-advocacy] Press Release -- Just Waiting for Tom


Folks,

Thank you, everyone, for you help with the press release.   The only
thing we're waiting on, I believe, is a quote from Tom Lane on the new
release.   Last-minute copy edits, please, people?

http://techdocs.postgresql.org/guides/Pressrelease73

And can anyone persuade Tom to cough up a quote in the next 36 hours?

-Josh Berkus


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


Re: Press Release -- Just Waiting for Tom

From
Robert Treat
Date:
On Mon, 2002-11-18 at 11:39, Jason Hihn wrote:
> FYI. I just tried to add a comment to the page, and I got <hr><b> rather
> than the formatting of a hard-return and bolding. (i.e. "<hr><b>2002/11/18
> 10:22 EST (via web):</b><br>" appeared rather than it formatted.
>

perhaps comments don't allow html formatting? Justin, can you confirm
this?

> I'll also ask what I asked there, here:
> Are there any new replication/backup features?
>

There haven't been major changes in these areas. There are some
commercial companies that are offering replication solutions you can
look at.  I also know Point In Time Recovery is planned for version 7.4
as well.

BTW - A complete list of changes is included in the source distributions
if you want to check for something specific.

Robert Treat

> -----Original Message-----
> From: pgsql-advocacy-owner@postgresql.org
> [mailto:pgsql-advocacy-owner@postgresql.org]On Behalf Of Josh Berkus
> Sent: Sunday, November 17, 2002 2:44 PM
> To: pgsql-advocacy@postgresql.org
> Subject: [pgsql-advocacy] Press Release -- Just Waiting for Tom
>
>
> Folks,
>
> Thank you, everyone, for you help with the press release.   The only
> thing we're waiting on, I believe, is a quote from Tom Lane on the new
> release.   Last-minute copy edits, please, people?
>
> http://techdocs.postgresql.org/guides/Pressrelease73
>
> And can anyone persuade Tom to cough up a quote in the next 36 hours?
>
> -Josh Berkus
>



Re: Press Release -- Just Waiting for Tom

From
Jason Hihn
Date:
I wasn't trying to use any formatting. The CGI did that all on it's own...
It put my comments into the PRE block of the annoucement. Maybe moving the
closing PRE tag is all it will need?


-----Original Message-----
From: Robert Treat [mailto:xzilla@users.sourceforge.net]
Sent: Monday, November 18, 2002 1:06 PM
To: Jason Hihn
Cc: pgsql-advocacy@postgresql.org
Subject: Re: [pgsql-advocacy] Press Release -- Just Waiting for Tom


On Mon, 2002-11-18 at 11:39, Jason Hihn wrote:
> FYI. I just tried to add a comment to the page, and I got <hr><b> rather
> than the formatting of a hard-return and bolding. (i.e. "<hr><b>2002/11/18
> 10:22 EST (via web):</b><br>" appeared rather than it formatted.
>

perhaps comments don't allow html formatting? Justin, can you confirm
this?

> I'll also ask what I asked there, here:
> Are there any new replication/backup features?
>

There haven't been major changes in these areas. There are some
commercial companies that are offering replication solutions you can
look at.  I also know Point In Time Recovery is planned for version 7.4
as well.

BTW - A complete list of changes is included in the source distributions
if you want to check for something specific.

Robert Treat

> -----Original Message-----
> From: pgsql-advocacy-owner@postgresql.org
> [mailto:pgsql-advocacy-owner@postgresql.org]On Behalf Of Josh Berkus
> Sent: Sunday, November 17, 2002 2:44 PM
> To: pgsql-advocacy@postgresql.org
> Subject: [pgsql-advocacy] Press Release -- Just Waiting for Tom
>
>
> Folks,
>
> Thank you, everyone, for you help with the press release.   The only
> thing we're waiting on, I believe, is a quote from Tom Lane on the new
> release.   Last-minute copy edits, please, people?
>
> http://techdocs.postgresql.org/guides/Pressrelease73
>
> And can anyone persuade Tom to cough up a quote in the next 36 hours?
>
> -Josh Berkus
>



Re: Press Release -- Just Waiting for Tom

From
Justin Clift
Date:
Robert Treat wrote:
<snip>
> perhaps comments don't allow html formatting? Justin, can you confirm
> this?

Hi guys,

It's kind of a bit more tricky than that.

The Press Release for PG 7.3 page is being worked on as plain text, and
is stored in Zwiki (the software we're using) that way.  HTML inside it
doesn't work.  :-/

It turns out that the "Add Comments" system automatically adds the
needed seperator, but does so in HTML without checking if that's
appropriate.  Have asked the Zwiki guys if they'd consider altering it,
and think it's been added to the "wishlist" area of their bugs tracker,
but that's it.

If anyone here is good with Python, that could be fixed though.

:-)

Regards and best wishes,

Justin Clift


> > I'll also ask what I asked there, here:
> > Are there any new replication/backup features?
> >
>
> There haven't been major changes in these areas. There are some
> commercial companies that are offering replication solutions you can
> look at.  I also know Point In Time Recovery is planned for version 7.4
> as well.
>
> BTW - A complete list of changes is included in the source distributions
> if you want to check for something specific.
>
> Robert Treat
>
> > -----Original Message-----
> > From: pgsql-advocacy-owner@postgresql.org
> > [mailto:pgsql-advocacy-owner@postgresql.org]On Behalf Of Josh Berkus
> > Sent: Sunday, November 17, 2002 2:44 PM
> > To: pgsql-advocacy@postgresql.org
> > Subject: [pgsql-advocacy] Press Release -- Just Waiting for Tom
> >
> >
> > Folks,
> >
> > Thank you, everyone, for you help with the press release.   The only
> > thing we're waiting on, I believe, is a quote from Tom Lane on the new
> > release.   Last-minute copy edits, please, people?
> >
> > http://techdocs.postgresql.org/guides/Pressrelease73
> >
> > And can anyone persuade Tom to cough up a quote in the next 36 hours?
> >
> > -Josh Berkus
> >
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly

--
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
   - Indira Gandhi