Re: WIP patch - INSERT-able log statements

Started by Tom Lanealmost 19 years ago5 messages
#1Tom Lane
tgl@sss.pgh.pa.us

"FAST PostgreSQL" <fastpgs@fast.fujitsu.com.au> writes:

The second variable is of interest. We need to specify a table in the insert command. My preferred option is for the user to give one and he can create it if and when he wants to. The alternative is we decide the table name and make initdb to create one.

Why not output the data in COPY format instead? That (a) eliminates the
problem of needing to predetermine a destination table name, and (b)
should be considerably faster to load than thousands of INSERT statements.

regards, tom lane

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#1)

"FAST PostgreSQL" <fastpgs@fast.fujitsu.com.au> writes:

On Fri, 16 Feb 2007 11:50, Tom Lane wrote:

Why not output the data in COPY format instead?

Yeah, that was my initial idea too... But because the TODO item clearly
mentions INSERT, I thought maybe there was some very specific reason for the
output to be in INSERT stmts.. ..

I don't think the TODO entry was particularly carefully thought out.

regards, tom lane

#3Alvaro Herrera
alvherre@commandprompt.com
In reply to: Tom Lane (#2)

Tom Lane wrote:

"FAST PostgreSQL" <fastpgs@fast.fujitsu.com.au> writes:

On Fri, 16 Feb 2007 11:50, Tom Lane wrote:

Why not output the data in COPY format instead?

Yeah, that was my initial idea too... But because the TODO item clearly
mentions INSERT, I thought maybe there was some very specific reason for the
output to be in INSERT stmts.. ..

I don't think the TODO entry was particularly carefully thought out.

... which is why discussing stuff in -hackers *before* coding tends to
be a good idea.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#4Joshua D. Drake
jd@commandprompt.com
In reply to: Alvaro Herrera (#3)

FAST PostgreSQL wrote:

On Fri, 16 Feb 2007 11:50, Tom Lane wrote:

"FAST PostgreSQL" <fastpgs@fast.fujitsu.com.au> writes:

The second variable is of interest. We need to specify a table in the
insert command. My preferred option is for the user to give one and he
can create it if and when he wants to. The alternative is we decide the
table name and make initdb to create one.

Why not output the data in COPY format instead? That (a) eliminates the
problem of needing to predetermine a destination table name, and (b)
should be considerably faster to load than thousands of INSERT statements.

Yeah, that was my initial idea too... But because the TODO item clearly
mentions INSERT, I thought maybe there was some very specific reason for the
output to be in INSERT stmts.. ..

COPY would be a good option, but INSERT is probably what I would use as
the default. The most use I see for this is something where I am tailing
out the log and inserting live into a log db...

Sincerely,

Joshua D. Drake

Rgds,
Arul Shaji

regards, tom lane

This is an email from Fujitsu Australia Software Technology Pty Ltd, ABN 27 003 693 481. It is confidential to the ordinary user of the email address to which it was addressed and may contain copyright and/or legally privileged information. No one else may read, print, store, copy or forward all or any of it or its attachments. If you receive this email in error, please return to sender. Thank you.

If you do not wish to receive commercial email messages from Fujitsu Australia Software Technology Pty Ltd, please email unsubscribe@fast.fujitsu.com.au

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

#5FAST PostgreSQL
fastpgs@fast.fujitsu.com.au
In reply to: Tom Lane (#1)

On Fri, 16 Feb 2007 11:50, Tom Lane wrote:

"FAST PostgreSQL" <fastpgs@fast.fujitsu.com.au> writes:

The second variable is of interest. We need to specify a table in the
insert command. My preferred option is for the user to give one and he
can create it if and when he wants to. The alternative is we decide the
table name and make initdb to create one.

Why not output the data in COPY format instead? That (a) eliminates the
problem of needing to predetermine a destination table name, and (b)
should be considerably faster to load than thousands of INSERT statements.

Yeah, that was my initial idea too... But because the TODO item clearly
mentions INSERT, I thought maybe there was some very specific reason for the
output to be in INSERT stmts.. ..

Rgds,
Arul Shaji

regards, tom lane

This is an email from Fujitsu Australia Software Technology Pty Ltd, ABN 27 003 693 481. It is confidential to the ordinary user of the email address to which it was addressed and may contain copyright and/or legally privileged information. No one else may read, print, store, copy or forward all or any of it or its attachments. If you receive this email in error, please return to sender. Thank you.

If you do not wish to receive commercial email messages from Fujitsu Australia Software Technology Pty Ltd, please email unsubscribe@fast.fujitsu.com.au