Re: [HACKERS] psql shows line number

2013-11-26 Thread Sawada Masahiko
2013/11/26 22:24 Pavel Stehule pavel.steh...@gmail.com: 2013/11/26 Sawada Masahiko sawada.m...@gmail.com On Tue, Nov 26, 2013 at 9:23 PM, Marko Tiikkaja ma...@joh.to wrote: On 11/26/13 1:05 PM, Sawada Masahiko wrote: When I execute query which contains error, the server returns error

Re: [HACKERS] psql shows line number

2013-11-26 Thread Marko Tiikkaja
On 11/26/13 2:24 PM, Pavel Stehule wrote: yes, but we can define new statement like \sq+ (Show Query) There's already \p; might not be too difficult to add a \p+ which would also show the line numbers. Regards, Marko Tiikkaja -- Sent via pgsql-hackers mailing list

Re: [HACKERS] psql shows line number

2013-11-26 Thread Tom Lane
Marko Tiikkaja ma...@joh.to writes: On 11/26/13 2:24 PM, Pavel Stehule wrote: yes, but we can define new statement like \sq+ (Show Query) There's already \p; might not be too difficult to add a \p+ which would also show the line numbers. I don't actually see the point of this. If you're

Re: [HACKERS] psql shows line number

2013-11-26 Thread Merlin Moncure
On Tue, Nov 26, 2013 at 9:22 AM, Tom Lane t...@sss.pgh.pa.us wrote: Marko Tiikkaja ma...@joh.to writes: On 11/26/13 2:24 PM, Pavel Stehule wrote: yes, but we can define new statement like \sq+ (Show Query) There's already \p; might not be too difficult to add a \p+ which would also show the

Re: [HACKERS] psql should show disabled internal triggers

2013-11-21 Thread Fabrízio de Royes Mello
On Fri, Oct 25, 2013 at 3:37 PM, fabriziomello fabriziome...@gmail.com wrote: On 2013-09-18 15:15:55 +0200, Bernd Helmle wrote: On 2013-09-18 15:15:55 +0200, Bernd Helmle wrote: --On 18. September 2013 13:52:29 +0200 Andres Freund lt;andres@gt; wrote: If you do ALTER TABLE ...

Re: [HACKERS] psql: small patch to correct filename formatting error in '\s FILE' output

2013-11-05 Thread Tom Lane
Ian Lawrence Barwick barw...@gmail.com writes: 2013/9/10 Bruce Momjian br...@momjian.us: I still see that weird behavior in git head: pgdevel=# \s history.txt Wrote history to file ./history.txt. pgdevel=# \s /tmp/history.txt Wrote history to file .//tmp/history.txt. pgdevel=# \cd /tmp

Re: [HACKERS] psql should show disabled internal triggers

2013-10-25 Thread fabriziomello
On 2013-09-18 15:15:55 +0200, Bernd Helmle wrote: On 2013-09-18 15:15:55 +0200, Bernd Helmle wrote: --On 18. September 2013 13:52:29 +0200 Andres Freund lt;andres@gt; wrote: If you do ALTER TABLE ... DISABLE TRIGGER ALL; and then individually re-enable the disabled triggers it's easy

Re: [HACKERS] psql tab completion for updatable foreign tables

2013-10-23 Thread Robert Haas
On Sat, Oct 19, 2013 at 5:44 AM, Dean Rasheed dean.a.rash...@gmail.com wrote: On 18 October 2013 16:41, Robert Haas robertmh...@gmail.com wrote: On Fri, Oct 18, 2013 at 1:34 AM, Dean Rasheed dean.a.rash...@gmail.com wrote: Personally, I think this is too fancy anyway. I'd just complete all

Re: [HACKERS] psql built from git still reports 9.3devel

2013-10-21 Thread Michael Paquier
On Mon, Oct 21, 2013 at 9:09 PM, Colin 't Hart colinth...@gmail.com wrote: git status says that I'm on branch master. psql reports 9.3devel, yet I expected it to report 9.4devel Is this expected behaviour? I've looked at the developer's FAQ and Wiki but couldn't find anything about this. You

Re: [HACKERS] psql built from git still reports 9.3devel

2013-10-21 Thread Colin 't Hart
make distclean ./configure make sudo make install helped. Cheers, Colin On 21 October 2013 14:25, Michael Paquier michael.paqu...@gmail.com wrote: On Mon, Oct 21, 2013 at 9:09 PM, Colin 't Hart colinth...@gmail.com wrote: git status says that I'm on branch master. psql reports

Re: [HACKERS] psql tab completion for updatable foreign tables

2013-10-19 Thread Dean Rasheed
On 18 October 2013 16:41, Robert Haas robertmh...@gmail.com wrote: On Fri, Oct 18, 2013 at 1:34 AM, Dean Rasheed dean.a.rash...@gmail.com wrote: Personally, I think this is too fancy anyway. I'd just complete all views and foreign tables and be done with it. We don't inspect permissions

Re: [HACKERS] psql tab completion for updatable foreign tables

2013-10-18 Thread Robert Haas
On Fri, Oct 18, 2013 at 1:34 AM, Dean Rasheed dean.a.rash...@gmail.com wrote: Personally, I think this is too fancy anyway. I'd just complete all views and foreign tables and be done with it. We don't inspect permissions either, for example. This might be too confusing for users. Yeah, I

Re: [HACKERS] psql tab completion for updatable foreign tables

2013-10-17 Thread Dean Rasheed
On 17 October 2013 03:29, Peter Eisentraut pete...@gmx.net wrote: On Mon, 2013-07-08 at 16:04 +, Dean Rasheed wrote: There was concern that pg_relation_is_updatable() would end up opening every relation in the database, hammering performance. I now realise that these tab-complete queries

Re: [HACKERS] psql tab completion for updatable foreign tables

2013-10-16 Thread Peter Eisentraut
On Mon, 2013-07-08 at 16:04 +, Dean Rasheed wrote: There was concern that pg_relation_is_updatable() would end up opening every relation in the database, hammering performance. I now realise that these tab-complete queries have a limit (1000 by default) so I don't think this is such an

Re: [HACKERS] PSQL return coder

2013-10-15 Thread James Sewell
I was avoiding ON_ERROR_STOP because I was using ON_ERROR_ROLLBACK, but have just realised that if I encase my SQL in a transaction then rollback will still happen. Perfect! James Sewell, PostgreSQL Team Lead / Solutions Architect __ Level 2, 50 Queen St,

Re: [HACKERS] psql tab completion for updatable foreign tables

2013-10-14 Thread Samrat Revagade
On Fri, Sep 20, 2013 at 7:54 PM, Dean Rasheed dean.a.rash...@gmail.comwrote: On 20 September 2013 11:29, Samrat Revagade revagade.sam...@gmail.com wrote: Okay, are you adding this to the september commitfest? OK, I've done that. I think that it's too late for 9.3. +1 for

Re: [HACKERS] psql tab completion for updatable foreign tables

2013-10-14 Thread Pavan Deolasee
On Mon, Oct 14, 2013 at 7:20 PM, Samrat Revagade revagade.sam...@gmail.comwrote: Sorry .my environment has some problem. May be you were using old version of psql ? IIRC tab-completion relies heavily on the psql side, Thanks, Pavan -- Pavan Deolasee http://www.linkedin.com/in/pavandeolasee

Re: [HACKERS] PSQL return coder

2013-10-10 Thread Tom Lane
James Sewell james.sew...@lisasoft.com writes: My question is in a rollback scenario is it possible to get PSQL to return a non 0 exit status? Maybe you could use -c instead of -f? $ psql -c 'select 1; select 1/0' regression ERROR: division by zero $ echo $? 1 You won't need explicit

Re: [HACKERS] PSQL return coder

2013-10-10 Thread Merlin Moncure
On Thu, Oct 10, 2013 at 1:52 AM, Tom Lane t...@sss.pgh.pa.us wrote: James Sewell james.sew...@lisasoft.com writes: My question is in a rollback scenario is it possible to get PSQL to return a non 0 exit status? Maybe you could use -c instead of -f? $ psql -c 'select 1; select 1/0'

Re: [HACKERS] PSQL return coder

2013-10-09 Thread Pavel Stehule
Hello 2013/10/10 James Sewell james.sew...@lisasoft.com Hello, I am using PSQL to run SQL from a file with the -f flag as follows: BEGIN SQL SQL ... END This gives me rollback on error and a nicer output than -1. This works fine. My question is in a rollback scenario is it

Re: [HACKERS] psql tab completion for updatable foreign tables

2013-09-20 Thread Samrat Revagade
Okay, are you adding this to the september commitfest? OK, I've done that. I think that it's too late for 9.3. +1 for idea. I have tested patch and got surprising results with Cent-OS Patch is working fine for Cent-OS 6.2 and RHEL 6.3 But is is giving problem on Cent-OS 6.3 (tab

Re: [HACKERS] psql tab completion for updatable foreign tables

2013-09-20 Thread Dean Rasheed
On 20 September 2013 11:29, Samrat Revagade revagade.sam...@gmail.com wrote: Okay, are you adding this to the september commitfest? OK, I've done that. I think that it's too late for 9.3. +1 for idea. I have tested patch and got surprising results with Cent-OS Patch is working fine

Re: [HACKERS] psql sets up cancel handler very early

2013-09-18 Thread Dean Rasheed
On 14 May 2013 16:35, Peter Eisentraut pete...@gmx.net wrote: Sometimes, the psql startup hangs when it cannot resolve or connect to a host. Intuitively, I would like to press Ctrl+C and correct the connection string or investigate. But that doesn't work because Ctrl+C is already bound to

Re: [HACKERS] psql should show disabled internal triggers

2013-09-18 Thread Dimitri Fontaine
Andres Freund and...@2ndquadrant.com writes: So, how about displaying disabled internal triggers in psql? +1 -- Dimitri Fontaine http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to

Re: [HACKERS] psql should show disabled internal triggers

2013-09-18 Thread Bernd Helmle
--On 18. September 2013 13:52:29 +0200 Andres Freund and...@2ndquadrant.com wrote: If you do ALTER TABLE ... DISABLE TRIGGER ALL; and then individually re-enable the disabled triggers it's easy to miss internal triggers. A \d+ tablename will not show anything out of the ordinary for that

Re: [HACKERS] psql should show disabled internal triggers

2013-09-18 Thread Andres Freund
On 2013-09-18 15:15:55 +0200, Bernd Helmle wrote: --On 18. September 2013 13:52:29 +0200 Andres Freund and...@2ndquadrant.com wrote: If you do ALTER TABLE ... DISABLE TRIGGER ALL; and then individually re-enable the disabled triggers it's easy to miss internal triggers. A \d+ tablename

Re: [HACKERS] psql should show disabled internal triggers

2013-09-18 Thread Bernd Helmle
--On 18. September 2013 15:19:27 +0200 Andres Freund and...@2ndquadrant.com wrote: Well, that will lead the user in the wrong direction, won't it? They haven't disabled the constraint but the trigger. Especially as we already have NOT VALID and might grow DISABLED for constraint

Re: [HACKERS] psql: small patch to correct filename formatting error in '\s FILE' output

2013-09-09 Thread Bruce Momjian
On Tue, Jan 22, 2013 at 07:30:59PM -0500, Tom Lane wrote: Ian Lawrence Barwick barw...@gmail.com writes: Related email from the archives on this subject: http://www.postgresql.org/message-id/37ed240d0611200645l5b70c8ddw5fb735e0d35a7...@mail.gmail.com I agree with the opinion stated there

Re: [HACKERS] psql: small patch to correct filename formatting error in '\s FILE' output

2013-09-09 Thread Ian Lawrence Barwick
2013/9/10 Bruce Momjian br...@momjian.us: On Tue, Jan 22, 2013 at 07:30:59PM -0500, Tom Lane wrote: Ian Lawrence Barwick barw...@gmail.com writes: Related email from the archives on this subject: http://www.postgresql.org/message-id/37ed240d0611200645l5b70c8ddw5fb735e0d35a7...@mail.gmail.com

Re: [HACKERS] psql and pset without any arguments

2013-09-02 Thread Gilles Darold
Patch added to current open commitfest under the Client section with title: Call \pset without any arguments displays current status of all printing options Status: Need review. Let me know if it should not be there. Regards, Le 29/06/2013 01:08, Gilles Darold a écrit : Hi, I was

Re: [HACKERS] psql missing tab completion for extensions

2013-08-17 Thread Dimitri Fontaine
Magnus Hagander mag...@hagander.net writes: Magnus Hagander mag...@hagander.net writes: psql is missing tab completion for \dx (or more usfully, for \dx+). Attached patch fixes this. Done. Thanks! Regards, -- Dimitri Fontaine http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et

Re: [HACKERS] psql missing tab completion for extensions

2013-08-15 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: psql is missing tab completion for \dx (or more usfully, for \dx+). Attached patch fixes this. Do we consider this a bugfix and backpatch (at least to 9.3? even though the problem goes back further), or head only? Sounds like a feature to me. I

Re: [HACKERS] psql missing tab completion for extensions

2013-08-15 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: Magnus Hagander mag...@hagander.net writes: psql is missing tab completion for \dx (or more usfully, for \dx+). Attached patch fixes this. Do we consider this a bugfix and backpatch (at least to 9.3? even though the problem goes back further), or

Re: [HACKERS] psql missing tab completion for extensions

2013-08-15 Thread Magnus Hagander
On Thu, Aug 15, 2013 at 5:26 PM, Stephen Frost sfr...@snowman.net wrote: * Tom Lane (t...@sss.pgh.pa.us) wrote: Magnus Hagander mag...@hagander.net writes: psql is missing tab completion for \dx (or more usfully, for \dx+). Attached patch fixes this. Do we consider this a bugfix and

Re: [HACKERS] psql --single-transaction does not work as expected

2013-08-13 Thread Bruce Momjian
On Tue, Aug 13, 2013 at 04:04:50PM +0200, Rafael Martinez wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello I want to report that psql --single-transaction does not work as one can expect after reading the help information for psql. psql --help says: - -1 (one),

Re: [HACKERS] psql tab completion for updatable foreign tables

2013-07-11 Thread Dean Rasheed
On 11 July 2013 00:03, Bernd Helmle maili...@oopsware.de wrote: --On 8. Juli 2013 16:04:31 + Dean Rasheed dean.a.rash...@gmail.com wrote: * pg_relation_is_updatable is only available in 9.3, whereas psql may connect to older servers, so it needs to guard against that. Oh of course, i

Re: [HACKERS] psql tab completion for updatable foreign tables

2013-07-10 Thread Bernd Helmle
--On 8. Juli 2013 16:04:31 + Dean Rasheed dean.a.rash...@gmail.com wrote: * pg_relation_is_updatable is only available in 9.3, whereas psql may connect to older servers, so it needs to guard against that. Oh of course, i forgot about this. Thanks for pointing out. * If we're doing

Re: [HACKERS] psql tab completion for updatable foreign tables

2013-07-08 Thread Dean Rasheed
On 8 July 2013 12:46, Bernd Helmle maili...@oopsware.de wrote: Recently i got annoyed that psql doesn't tab complete to updatable foreign tables. Attached is a patch to address this. I'm using the new pg_relation_is_updatable() function to accomplish this. The function could also be used for

Re: [HACKERS] psql and pset without any arguments

2013-06-29 Thread Marc Mamin
Von: pgsql-hackers-ow...@postgresql.org [pgsql-hackers-ow...@postgresql.org]quot; im Auftrag von quot;Gilles Darold [gilles.dar...@dalibo.com] I was looking at psql 8.3 documention about \pset options and saw that there was the following note : Note: It is an error to call \pset without

Re: [HACKERS] psql and pset without any arguments

2013-06-29 Thread Erik Rijkers
On Sat, June 29, 2013 01:08, Gilles Darold wrote: Here is a sample output: (postgres@[local]:5494) [postgres] \pset Output format is aligned. Border style is 2. Expanded display is used automatically. Null display is NULL. Field separator

Re: [HACKERS] psql and pset without any arguments

2013-06-29 Thread Pavel Stehule
2013/6/29 Erik Rijkers e...@xs4all.nl: On Sat, June 29, 2013 01:08, Gilles Darold wrote: Here is a sample output: (postgres@[local]:5494) [postgres] \pset Output format is aligned. Border style is 2. Expanded display is used automatically. Null

Re: [HACKERS] psql and pset without any arguments

2013-06-29 Thread Gilles Darold
Le 29/06/2013 13:55, Erik Rijkers a écrit : On Sat, June 29, 2013 01:08, Gilles Darold wrote: Here is a sample output: (postgres@[local]:5494) [postgres] \pset Output format is aligned. Border style is 2. Expanded display is used automatically.

Re: [HACKERS] psql \dv+ shows view size as 0 bytes

2013-06-04 Thread Thom Brown
On 4 June 2013 16:54, Peter Eisentraut pete...@gmx.net wrote: \dv+ shows the size of views as 0 bytes. This doesn't make any sense; I think it should show null. Maybe this is even the fault of the backend functions for returning a number to display in the first place. It doesn't sound useful

Re: [HACKERS] psql \dv+ shows view size as 0 bytes

2013-06-04 Thread Peter Eisentraut
On 6/4/13 12:08 PM, Thom Brown wrote: It doesn't sound useful whether it's 0 or NULL in that output. Why have the column in the first place when it can't have a value? Is it somehow required for inclusion in the output of \d+ ? \dv is just a special case of \dvti... -- Sent via

Re: [HACKERS] psql \watch versus \timing

2013-05-19 Thread Tom Lane
Jeff Janes jeff.ja...@gmail.com writes: I'd like to run same query repeatedly and see how long it takes each time. I thought \watch would be excellent for this, but it turns out that using \watch suppresses the output of \timing. Is this intentional, or unavoidable? \watch uses PSQLexec not

Re: [HACKERS] psql sets up cancel handler very early

2013-05-14 Thread Ryan Kelly
I submitted essentially this same patch over a year ago and Tom vetoed it: http://www.postgresql.org/message-id/3741.1325731...@sss.pgh.pa.us The thread moved to -hackers at some point and I made some further enhancements:

Re: [HACKERS] psql connection reset failed

2013-05-12 Thread amul sul
Hi, I tested this issue with  9.3beta1 , and same thing happening there too. By making changes as done in above patch, its work fine as expected. I am not sure, does this fixed is required to do? If so, then what should min wait time should set as 5000 microSec is seted for test, is this fine

Re: [HACKERS] psql crash fix

2013-04-04 Thread Bruce Momjian
On Tue, Apr 2, 2013 at 08:48:53PM -0400, Bruce Momjian wrote: I found that psql will crash if given a PSQLRC value containing a tilde: $ PSQLRC=~/x psql test *** glibc detected *** psql: free(): invalid pointer: 0x7fffb7c933ec *** This is on Debian Squeeze 6.0.7. The

Re: [HACKERS] psql \l to accept patterns

2013-03-03 Thread Peter Eisentraut
On Wed, 2013-01-30 at 00:20 +0900, Satoshi Nagayasu wrote: It seems working well with the latest git master. I think it's good enough to be committed. Committed, thanks. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] psql \l to accept patterns

2013-01-29 Thread Satoshi Nagayasu
Hi, I have tried this patch. https://commitfest.postgresql.org/action/patch_view?id=1051 2013/01/29 14:48, Peter Eisentraut wrote: On Mon, 2013-01-07 at 07:14 -0500, Peter Eisentraut wrote: Here is a patch for psql's \l command to accept patterns, like \d commands do. While at it, I also

Re: [HACKERS] psql \l to accept patterns

2013-01-29 Thread Tom Lane
Satoshi Nagayasu sn...@uptime.jp writes: On Mon, 2013-01-07 at 07:14 -0500, Peter Eisentraut wrote: Here is a patch for psql's \l command to accept patterns, like \d BTW, is there any good place to put new regression test for the psql command? I couldn't find it out. As far as a test for

Re: [HACKERS] psql \l to accept patterns

2013-01-29 Thread Satoshi Nagayasu
(2013/01/30 0:34), Tom Lane wrote: Satoshi Nagayasu sn...@uptime.jp writes: On Mon, 2013-01-07 at 07:14 -0500, Peter Eisentraut wrote: Here is a patch for psql's \l command to accept patterns, like \d BTW, is there any good place to put new regression test for the psql command? I couldn't

Re: [HACKERS] psql \l to accept patterns

2013-01-29 Thread Tom Lane
Satoshi Nagayasu sn...@uptime.jp writes: First of all, I was looking for some regression tests for CREATE/ALTER/DROP DATABASE commands, but I couldn't find them in the test/regress/sql/ directory. So, I asked the question. I guess these database tests are in pg_regress.c. Right? Yeah, we

Re: [HACKERS] psql \l to accept patterns

2013-01-28 Thread Peter Eisentraut
On Mon, 2013-01-07 at 07:14 -0500, Peter Eisentraut wrote: Here is a patch for psql's \l command to accept patterns, like \d commands do. While at it, I also added an S option to show system objects and removed system objects from the default display. This might be a bit controversial, but

Re: [HACKERS] psql: small patch to correct filename formatting error in '\s FILE' output

2013-01-22 Thread Tom Lane
Ian Lawrence Barwick barw...@gmail.com writes: I've noticed a filename error in feedback messages from psql's '\s' command when saving the command line history to a file specified by an absolute filepath: psql (9.2.2) Type help for help. pgdevel=# \s history.txt Wrote history to

Re: [HACKERS] psql: small patch to correct filename formatting error in '\s FILE' output

2013-01-22 Thread Dickson S. Guedes
2013/1/22 Tom Lane t...@sss.pgh.pa.us: Why should \s, and \s alone, need to remind you where you're cd'd to? Why not just get rid of that prefixed cd'd path in \s? []s -- Dickson S. Guedes mail/xmpp: gue...@guedesoft.net - skype: guediz http://github.com/guedes - http://guedesoft.net

Re: [HACKERS] psql: small patch to correct filename formatting error in '\s FILE' output

2013-01-22 Thread Tom Lane
I wrote: If we did think that this specific backslash command needed to be able to print something other than the filename as-entered, I'd be inclined to just apply make_absolute_path() to the name, instead of relying on inadequate dead-reckoning. However, that would require making

Re: [HACKERS] psql: small patch to correct filename formatting error in '\s FILE' output

2013-01-22 Thread Ian Lawrence Barwick
2013/1/23 Tom Lane t...@sss.pgh.pa.us: I wrote: If we did think that this specific backslash command needed to be able to print something other than the filename as-entered, I'd be inclined to just apply make_absolute_path() to the name, instead of relying on inadequate dead-reckoning.

Re: [HACKERS] psql: small patch to correct filename formatting error in '\s FILE' output

2013-01-22 Thread Tom Lane
Ian Lawrence Barwick barw...@gmail.com writes: Related email from the archives on this subject: http://www.postgresql.org/message-id/37ed240d0611200645l5b70c8ddw5fb735e0d35a7...@mail.gmail.com I agree with the opinion stated there that \cd with no argument really ought to do what cd with no

Re: [HACKERS] psql \l to accept patterns

2013-01-11 Thread Robert Haas
On Tue, Jan 8, 2013 at 11:36 PM, Peter Eisentraut pete...@gmx.net wrote: On Mon, 2013-01-07 at 17:37 -0500, Robert Haas wrote: If we make the postgres database undroppable, unrenamable, and strictly read-only, I will happily support a proposal to consider it a system object. Until then, it's

Re: [HACKERS] psql \l to accept patterns

2013-01-11 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: On Tue, Jan 8, 2013 at 11:36 PM, Peter Eisentraut pete...@gmx.net wrote: Good point. What about the other suggestion about only displaying databases by default that you can connect to? I would tend not to adopt that suggestion, on the grounds

Re: [HACKERS] psql \l to accept patterns

2013-01-08 Thread Peter Eisentraut
On Mon, 2013-01-07 at 17:37 -0500, Robert Haas wrote: If we make the postgres database undroppable, unrenamable, and strictly read-only, I will happily support a proposal to consider it a system object. Until then, it's no more a system object than the public schema - which, you will note,

Re: [HACKERS] psql \l to accept patterns

2013-01-07 Thread Fabrízio de Royes Mello
On Mon, Jan 7, 2013 at 10:14 AM, Peter Eisentraut pete...@gmx.net wrote: Here is a patch for psql's \l command to accept patterns, like \d commands do. While at it, I also added an S option to show system objects and removed system objects from the default display. This might be a bit

Re: [HACKERS] psql \l to accept patterns

2013-01-07 Thread Alvaro Herrera
Peter Eisentraut wrote: Here is a patch for psql's \l command to accept patterns, like \d commands do. While at it, I also added an S option to show system objects and removed system objects from the default display. This might be a bit controversial, but it's how it was decided some time

Re: [HACKERS] psql \l to accept patterns

2013-01-07 Thread Robert Haas
On Mon, Jan 7, 2013 at 7:14 AM, Peter Eisentraut pete...@gmx.net wrote: Here is a patch for psql's \l command to accept patterns, like \d commands do. While at it, I also added an S option to show system objects and removed system objects from the default display. This might be a bit

Re: [HACKERS] psql \l to accept patterns

2013-01-07 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Mon, Jan 7, 2013 at 7:14 AM, Peter Eisentraut pete...@gmx.net wrote: Here is a patch for psql's \l command to accept patterns, like \d commands do. While at it, I also added an S option to show system objects and removed system objects from the

Re: [HACKERS] psql \l to accept patterns

2013-01-07 Thread Peter Eisentraut
On 1/7/13 3:53 PM, Robert Haas wrote: On Mon, Jan 7, 2013 at 7:14 AM, Peter Eisentraut pete...@gmx.net wrote: Here is a patch for psql's \l command to accept patterns, like \d commands do. While at it, I also added an S option to show system objects and removed system objects from the

Re: [HACKERS] psql \l to accept patterns

2013-01-07 Thread Robert Haas
On Mon, Jan 7, 2013 at 5:14 PM, Peter Eisentraut pete...@gmx.net wrote: We removed showing system functions and operators from \df and \do without S. Those are needed all the time. This was controversial at the time, but it's the way it is now. The definition of S, I suppose, is more like

Re: [HACKERS] psql, remove include of psqlscan.c

2012-09-27 Thread Tom Lane
Karl O. Pinc k...@meme.com writes: This patch (psql_remove_include.patch) eliminates the #include of psqlscan.c at the bottom of mainloop.c. I don't really see that this is enough of an improvement to justify depending on a non-portable flex feature. I'm thinking of exposing enough of the

Re: [HACKERS] psql, remove include of psqlscan.c

2012-09-27 Thread Karl O. Pinc
On 09/27/2012 10:07:48 AM, Tom Lane wrote: Karl O. Pinc k...@meme.com writes: This patch (psql_remove_include.patch) eliminates the #include of psqlscan.c at the bottom of mainloop.c. I don't really see that this is enough of an improvement to justify depending on a non-portable flex

Re: [HACKERS] psql, remove include of psqlscan.c

2012-09-27 Thread Alvaro Herrera
Excerpts from Karl O. Pinc's message of jue sep 27 12:29:53 -0300 2012: The reason I want this is because I don't want to have to rewrite the sql parser in PHP for inclusion in phpPgAdmin. (I did this once, and it was such a big ugly patch it never got around to getting into the mainline

Re: [HACKERS] psql, remove include of psqlscan.c

2012-09-27 Thread John R Pierce
On 09/27/12 8:41 AM, Alvaro Herrera wrote: But I think I see what Tom objection to it is: if we export this capability to libpq applications, then we set it in stone to a certain extent: exactly how things are split would become part of the API, so to speak. Upgrading to a newer libpq could

Re: [HACKERS] psql, remove include of psqlscan.c

2012-09-27 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: But I think I see what Tom objection to it is: if we export this capability to libpq applications, then we set it in stone to a certain extent: exactly how things are split would become part of the API, so to speak. Upgrading to a newer libpq

Re: [HACKERS] psql, remove include of psqlscan.c

2012-09-27 Thread Karl O. Pinc
On 09/27/2012 11:02:42 AM, Tom Lane wrote: Alvaro Herrera alvhe...@2ndquadrant.com writes: A larger point is that I don't believe this is actually going to help anybody, because of mismatch of requirements not only implementation language. JDBC couldn't use a libpq lexer implementation even

Re: [HACKERS] psql, remove include of psqlscan.c

2012-09-27 Thread Karl O. Pinc
On 09/27/2012 11:02:42 AM, Tom Lane wrote: Rather, the problem is that the server might know about some newer lexical feature, and so might the application, but if libpq is behind the times then it's broken. If the application knows about the newer feature and wants to use it, is it

Re: [HACKERS] psql, remove include of psqlscan.c

2012-09-27 Thread Tom Lane
Karl O. Pinc k...@meme.com writes: What I'm thinking of in libpq is the ability to give it big string with many sql statements and have it hand back each statement so the client can then submit it to the server for execution. What I really _want_ is to be able get a bit string of many sql

Re: [HACKERS] psql, remove include of psqlscan.c

2012-09-27 Thread Tom Lane
Karl O. Pinc k...@meme.com writes: On 09/27/2012 11:02:42 AM, Tom Lane wrote: Rather, the problem is that the server might know about some newer lexical feature, and so might the application, but if libpq is behind the times then it's broken. If the application knows about the newer feature

Re: [HACKERS] psql, remove include of psqlscan.c

2012-09-27 Thread Karl O. Pinc
On 09/27/2012 02:28:49 PM, Tom Lane wrote: Karl O. Pinc k...@meme.com writes: What I really _want_ is to be able get a bit string of many sql statements from the user and return the results, statuses, etc. of executing each statement. Just what psql does when, say, fed a file from

Re: [HACKERS] psql: tab-completion fails SET var=

2012-08-28 Thread Bruce Momjian
On Fri, Mar 30, 2012 at 08:15:22PM +0200, Erik Rijkers wrote: (in hopes that the current changes to tab-completion will help to get this fixed) tab-completion goes wrong on SET setting=... example: If you want to input set search_path=myschema; without spaces around '=', and you try

Re: [HACKERS] psql \set vs \copy - bug or expected behaviour?

2012-08-25 Thread Bruce Momjian
On Fri, Aug 17, 2012 at 02:01:25PM -0400, Bruce Momjian wrote: On Fri, Aug 17, 2012 at 06:55:14PM +0100, Richard Huxton wrote: Well, it'd be nice to allow substitution there ... What we can't easily do is to allow quotes to prevent variable substitution in these whole-line commands

Re: [HACKERS] psql output locations

2012-08-25 Thread Bruce Momjian
On Fri, Aug 17, 2012 at 12:28:58PM -0400, Bruce Momjian wrote: On Fri, Aug 17, 2012 at 12:22:38PM -0400, Alvaro Herrera wrote: Excerpts from Bruce Momjian's message of vie ago 17 11:17:58 -0400 2012: On Wed, Dec 14, 2011 at 10:57:25AM -0500, Robert Haas wrote: On Wed, Dec 14, 2011 at

Re: [HACKERS] psql output locations

2012-08-17 Thread Bruce Momjian
On Wed, Dec 14, 2011 at 10:57:25AM -0500, Robert Haas wrote: On Wed, Dec 14, 2011 at 4:45 AM, Magnus Hagander mag...@hagander.net wrote: * There are a number of things that are always written to stdout, that there is no way to redirect. In some cases it's interactive prompts - makes sense -

Re: [HACKERS] psql output locations

2012-08-17 Thread Alvaro Herrera
Excerpts from Bruce Momjian's message of vie ago 17 11:17:58 -0400 2012: On Wed, Dec 14, 2011 at 10:57:25AM -0500, Robert Haas wrote: On Wed, Dec 14, 2011 at 4:45 AM, Magnus Hagander mag...@hagander.net wrote: * There are a number of things that are always written to stdout, that there

Re: [HACKERS] psql output locations

2012-08-17 Thread Bruce Momjian
On Fri, Aug 17, 2012 at 12:22:38PM -0400, Alvaro Herrera wrote: Excerpts from Bruce Momjian's message of vie ago 17 11:17:58 -0400 2012: On Wed, Dec 14, 2011 at 10:57:25AM -0500, Robert Haas wrote: On Wed, Dec 14, 2011 at 4:45 AM, Magnus Hagander mag...@hagander.net wrote: * There

Re: [HACKERS] psql \set vs \copy - bug or expected behaviour?

2012-08-17 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: On Fri, Oct 21, 2011 at 05:31:41PM -0400, Robert Haas wrote: I'm not sure whether that's a bug per se, but I can see where a behavior change might be an improvement. I did some research on this and learned a little more about flex rules. Turns out we

Re: [HACKERS] psql \set vs \copy - bug or expected behaviour?

2012-08-17 Thread Richard Huxton
On 17/08/12 18:38, Tom Lane wrote: Bruce Momjianbr...@momjian.us writes: On Fri, Oct 21, 2011 at 05:31:41PM -0400, Robert Haas wrote: I'm not sure whether that's a bug per se, but I can see where a behavior change might be an improvement. I did some research on this and learned a little

Re: [HACKERS] psql \set vs \copy - bug or expected behaviour?

2012-08-17 Thread Bruce Momjian
On Fri, Aug 17, 2012 at 06:55:14PM +0100, Richard Huxton wrote: Well, it'd be nice to allow substitution there ... What we can't easily do is to allow quotes to prevent variable substitution in these whole-line commands because we can't process the quotes because that will remove them.

Re: [HACKERS] psql \set vs \copy - bug or expected behaviour?

2012-08-16 Thread Bruce Momjian
On Fri, Oct 21, 2011 at 05:31:41PM -0400, Robert Haas wrote: On Fri, Oct 21, 2011 at 7:24 AM, Richard Huxton d...@archonet.com wrote: It looks like \copy is just passing the text of the query unadjusted to COPY. I get a syntax error on :x with the \copy below on both 9.0 and 9.1 ===

Re: [HACKERS] psql tab completion for GRANT role

2012-06-19 Thread Peter Eisentraut
On tor, 2012-06-14 at 13:38 -0400, Robert Haas wrote: On Sun, Jan 8, 2012 at 3:48 PM, Peter Eisentraut pete...@gmx.net wrote: psql tab completion currently only supports the form GRANT privilege ON something TO someone (and the analogous REVOKE), but not the form GRANT role TO someone.

Re: [HACKERS] psql tab completion for GRANT role

2012-06-19 Thread Robert Haas
On Tue, Jun 19, 2012 at 3:16 AM, Peter Eisentraut pete...@gmx.net wrote: On tor, 2012-06-14 at 13:38 -0400, Robert Haas wrote: On Sun, Jan 8, 2012 at 3:48 PM, Peter Eisentraut pete...@gmx.net wrote: psql tab completion currently only supports the form GRANT privilege ON something TO someone

Re: [HACKERS] psql tab completion for GRANT role

2012-06-14 Thread Robert Haas
On Sun, Jan 8, 2012 at 3:48 PM, Peter Eisentraut pete...@gmx.net wrote: psql tab completion currently only supports the form GRANT privilege ON something TO someone (and the analogous REVOKE), but not the form GRANT role TO someone.  Here is a patch that attempts to implement the latter. This

Re: [HACKERS] psql bug

2012-05-21 Thread Tom Lane
Teodor Sigaev teo...@sigaev.ru writes: Seems system() call cleanups sigaction state on FreeBSD. The root of problem is a threading library. In FreeBSD there are two versions of sigaction() (system() and others) depending on thread enabled. libpq library is compiled by default with

Re: [HACKERS] psql bug

2012-05-18 Thread Teodor Sigaev
Seems system() call cleanups sigaction state on FreeBSD. The root of problem is a threading library. In FreeBSD there are two versions of sigaction() (system() and others) depending on thread enabled. libpq library is compiled by default with -pthread switch but psql is linked without that.

Re: [HACKERS] psql bug

2012-05-17 Thread Teodor Sigaev
will investigate that Tom Lane wrote: Teodor Sigaevteo...@sigaev.ru writes: After editing query with external editor psql exits on Ctrl-C: FWIW, I failed to reproduce that on any of my machines. Maybe your editor is leaving the tty in a funny state? regards, tom

Re: [HACKERS] psql bug

2012-05-17 Thread Teodor Sigaev
FWIW, I failed to reproduce that on any of my machines. Maybe your editor is leaving the tty in a funny state? Seems system() call cleanups sigaction state on FreeBSD. I've modify void setup_cancel_handler(void) { fprintf(stderr, %p - %p\n, pqsignal(SIGINT, handle_sigint), handle_sigint);

Re: [HACKERS] psql bug

2012-05-16 Thread Tom Lane
Teodor Sigaev teo...@sigaev.ru writes: After editing query with external editor psql exits on Ctrl-C: FWIW, I failed to reproduce that on any of my machines. Maybe your editor is leaving the tty in a funny state? regards, tom lane -- Sent via pgsql-hackers mailing

Re: [HACKERS] psql: server version check for \dO

2012-05-10 Thread Magnus Hagander
On Thu, May 10, 2012 at 7:09 AM, Josh Kupershmidt schmi...@gmail.com wrote: Hi all, I think psql's \dO command is missing the server version check which similar commands such as \dx use. Right now \dO errors out with: test=# \dO ERROR:  relation pg_catalog.pg_collation does not exist when

Re: [HACKERS] psql omits row count under \x auto

2012-05-01 Thread Robert Haas
On Fri, Apr 27, 2012 at 3:05 PM, Noah Misch n...@leadboat.com wrote: On Thu, Apr 26, 2012 at 09:25:25PM +0300, Peter Eisentraut wrote: On m??n, 2012-04-23 at 12:30 -0400, Noah Misch wrote: I've been enjoying \x auto in .psqlrc, but I noticed the row count footer missing when it chooses

Re: [HACKERS] psql omits row count under \x auto

2012-04-27 Thread Noah Misch
On Thu, Apr 26, 2012 at 09:25:25PM +0300, Peter Eisentraut wrote: On m??n, 2012-04-23 at 12:30 -0400, Noah Misch wrote: I've been enjoying \x auto in .psqlrc, but I noticed the row count footer missing when it chooses ordinary output: Looks like the logic in printQuery() needs further

Re: [HACKERS] psql omits row count under \x auto

2012-04-26 Thread Peter Eisentraut
On mån, 2012-04-23 at 12:30 -0400, Noah Misch wrote: I've been enjoying \x auto in .psqlrc, but I noticed the row count footer missing when it chooses ordinary output: Looks like the logic in printQuery() needs further treatment. Hmm, this looks a bit tricky, because at the time we add the

<    2   3   4   5   6   7   8   9   10   11   >