pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Notice about psql !
5+ messages / 4 participants
[nested] [flat]

* Notice about psql !
@ 2013-12-17 05:29  Doom.zhou <zzepaigh@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Doom.zhou @ 2013-12-17 05:29 UTC (permalink / raw)
  To: pgsql-admin

HI guys
    when edit some sql in psql's \e feature then quit edit
it is performed !!!!


it's dangerous isn't it ?


if i edit drop database datname;   then .....

any friends have confuse?


Nice day!

doom.zhou

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Notice about psql !
@ 2013-12-17 14:46  Steve Crawford <scrawford@pinpointresearch.com>
  parent: Doom.zhou <zzepaigh@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Steve Crawford @ 2013-12-17 14:46 UTC (permalink / raw)
  To: Doom.zhou <zzepaigh@gmail.com>; pgsql-admin

On 12/16/2013 09:29 PM, Doom.zhou wrote:
> HI guys
>     when edit some sql in psql's \e feature then quit edit
> it is performed !!!!
>
>
> it's dangerous isn't it ?
>
It is *extremely* dangerous. But neither more nor less dangerous than 
any interface that allows you to submit SQL directly to the server.

The \e command merely offers an alternative to the command-line editing 
to craft your SQL statements and is very convenient when you are editing 
a long statement. When done, you exit and the command is submitted just 
as it is submitted when you press <Enter> at the command-line.

If you change your mind while in the editor, just clear the text in the 
editor and exit. Nothing will be run.

Cheers,
Steve



-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Notice about psql !
@ 2013-12-17 15:04  David Johnston <polobo@yahoo.com>
  parent: Steve Crawford <scrawford@pinpointresearch.com>
  0 siblings, 1 reply; 5+ messages in thread

From: David Johnston @ 2013-12-17 15:04 UTC (permalink / raw)
  To: pgsql-admin

Steve Crawford wrote
> On 12/16/2013 09:29 PM, Doom.zhou wrote:
>> HI guys
>>     when edit some sql in psql's \e feature then quit edit
>> it is performed !!!!
>>
>>
>> it's dangerous isn't it ?
>>
> It is *extremely* dangerous. But neither more nor less dangerous than 
> any interface that allows you to submit SQL directly to the server.
> 
> The \e command merely offers an alternative to the command-line editing 
> to craft your SQL statements and is very convenient when you are editing 
> a long statement. When done, you exit and the command is submitted just 
> as it is submitted when you press 
> <Enter>
>  at the command-line.
> 
> If you change your mind while in the editor, just clear the text in the 
> editor and exit. Nothing will be run.

Or

BEGIN; <Enter>

\e <Enter>

COMMIT | ROLLBACK ; <Enter>

David J.







--
View this message in context: http://postgresql.1045698.n5.nabble.com/Notice-about-psql-tp5783659p5783726.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Notice about psql !
@ 2013-12-18 02:35  Doom.zhou <zzepaigh@gmail.com>
  parent: David Johnston <polobo@yahoo.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Doom.zhou @ 2013-12-18 02:35 UTC (permalink / raw)
  To: David Johnston <polobo@yahoo.com>; +Cc: pgsql-admin

Really thanks


On Tue, Dec 17, 2013 at 11:04 PM, David Johnston <polobo@yahoo.com> wrote:

> Steve Crawford wrote
> > On 12/16/2013 09:29 PM, Doom.zhou wrote:
> >> HI guys
> >>     when edit some sql in psql's \e feature then quit edit
> >> it is performed !!!!
> >>
> >>
> >> it's dangerous isn't it ?
> >>
> > It is *extremely* dangerous. But neither more nor less dangerous than
> > any interface that allows you to submit SQL directly to the server.
> >
> > The \e command merely offers an alternative to the command-line editing
> > to craft your SQL statements and is very convenient when you are editing
> > a long statement. When done, you exit and the command is submitted just
> > as it is submitted when you press
> > <Enter>
> >  at the command-line.
> >
> > If you change your mind while in the editor, just clear the text in the
> > editor and exit. Nothing will be run.
>
> Or
>
> BEGIN; <Enter>
>
> \e <Enter>
>
> COMMIT | ROLLBACK ; <Enter>
>
> David J.
>
>
>
>
>
>
>
> --
> View this message in context:
> http://postgresql.1045698.n5.nabble.com/Notice-about-psql-tp5783659p5783726.html
> Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Notice about psql !
@ 2013-12-18 02:58  Bruce Momjian <bruce@momjian.us>
  parent: Doom.zhou <zzepaigh@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Bruce Momjian @ 2013-12-18 02:58 UTC (permalink / raw)
  To: Doom.zhou <zzepaigh@gmail.com>; +Cc: David Johnston <polobo@yahoo.com>; pgsql-admin

On Wed, Dec 18, 2013 at 10:35:33AM +0800, Doom.zhou wrote:
> Really thanks 
> 
> 
> On Tue, Dec 17, 2013 at 11:04 PM, David Johnston <polobo@yahoo.com> wrote:
> 
>     Steve Crawford wrote
>     > On 12/16/2013 09:29 PM, Doom.zhou wrote:
>     >> HI guys
>     >>     when edit some sql in psql's \e feature then quit edit
>     >> it is performed !!!!
>     >>
>     >>
>     >> it's dangerous isn't it ?
>     >>
>     > It is *extremely* dangerous. But neither more nor less dangerous than
>     > any interface that allows you to submit SQL directly to the server.
>     >
>     > The \e command merely offers an alternative to the command-line editing
>     > to craft your SQL statements and is very convenient when you are editing
>     > a long statement. When done, you exit and the command is submitted just
>     > as it is submitted when you press
>     > <Enter>
>     >  at the command-line.
>     >
>     > If you change your mind while in the editor, just clear the text in the
>     > editor and exit. Nothing will be run.
> 
>     Or
> 
>     BEGIN; <Enter>
> 
>     \e <Enter>
> 
>     COMMIT | ROLLBACK ; <Enter>

Actually, just remove the semicolon from the query and it will not run
when you exit \e.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2013-12-18 02:58 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-12-17 05:29 Notice about psql ! Doom.zhou <zzepaigh@gmail.com>
2013-12-17 14:46 ` Steve Crawford <scrawford@pinpointresearch.com>
2013-12-17 15:04   ` David Johnston <polobo@yahoo.com>
2013-12-18 02:35     ` Doom.zhou <zzepaigh@gmail.com>
2013-12-18 02:58       ` Bruce Momjian <bruce@momjian.us>

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