Re: proposal: multiple psql option -c

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, dinesh kumar <dineshkumar02(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: multiple psql option -c
Date: 2015-07-25 08:12:54
Message-ID: CAFj8pRA6gHwxGchYdh4zKqfUbp=N-406M_jXAS7tu6PHBA3gjQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2015-07-23 17:52 GMT+02:00 Robert Haas <robertmhaas(at)gmail(dot)com>:

> On Fri, Jul 17, 2015 at 12:36 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
> >> Or just properly understand the ; ?
> >>
> >> -c "select * from foo; update bar set baz = 'bing'; vacuum bar;"
> >
> > there is a risk of compatibility issues - all statements runs under one
> > transaction implicitly
>
> So what?
>

[pavel(at)dhcppc2 ~]$ psql -c "insert into x
values(txid_current()::text);insert into x values(txid_current()::text)"
postgres
INSERT 0 1
[pavel(at)dhcppc2 ~]$ psql postgres -c "select * from x"
a
------
1888
1888
(2 rows)

I would to run -c command in separate transactions (when option
--single-transaction is not used).

Then is possible run

-c "select pg_reset ...()" -c "vacuum analyze ..."

Regards

Pavel

p.s.

the state string "INSERT 0 1" is buggy probably

>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2015-07-25 08:33:14 proposal: multiple psql option -c
Previous Message Simon Riggs 2015-07-25 08:11:12 Re: MultiXact member wraparound protections are now enabled