Adding terminal title support for psqlrc

2018-08-01 Thread ik
Hello,

Is there a way to add terminal title information for psqlrc that cn display
what schema I am, operation that is execute and stuff like that?

Thank you


Re: Adding terminal title support for psqlrc

2018-08-01 Thread ik
hi,

Thank you, it does not effect the terminal title.

As Adrian answered me, it is not supported :/



On Wed, Aug 1, 2018 at 4:47 PM, Tom Lane  wrote:

> ik  writes:
> > Is there a way to add terminal title information for psqlrc that cn
> display
> > what schema I am, operation that is execute and stuff like that?
>
> Most terminal programs recognize escape sequences to set the window
> title.  So you could set values for PROMPTn that cause updates in
> the title.  There's an example in
>
> https://www.postgresql.org/docs/devel/static/app-psql.
> html#APP-PSQL-PROMPTING
>
> although it's just talking about a color change.
>
> regards, tom lane
>


Re: Adding terminal title support for psqlrc

2018-08-02 Thread ik
Thank you, it works :)

https://github.com/ik5/dotfiles/blob/master/psqlrc

On Wed, Aug 1, 2018 at 9:15 PM, Adrian Klaver 
wrote:

> On 08/01/2018 10:55 AM, ik wrote:
>
>> hi,
>>
>> Thank you, it does not effect the terminal title.
>>
>> As Adrian answered me, it is not supported :/
>>
>
> I was wrong:
>
> https://petereisentraut.blogspot.com/2009/09/how-to-set-
> xterm-titles-in-psql.html
>
>
> To get this to work in Konsole I had to edit the profile to have Tab title
> format use %w (Window title set by shell).
>
>
>
>>
>>
>> On Wed, Aug 1, 2018 at 4:47 PM, Tom Lane > t...@sss.pgh.pa.us>> wrote:
>>
>> ik mailto:ido...@gmail.com>> writes:
>> > Is there a way to add terminal title information for psqlrc that cn
>> display
>> > what schema I am, operation that is execute and stuff like that?
>>
>> Most terminal programs recognize escape sequences to set the window
>> title.  So you could set values for PROMPTn that cause updates in
>> the title.  There's an example in
>>
>> https://www.postgresql.org/docs/devel/static/app-psql.html#
>> APP-PSQL-PROMPTING
>> <https://www.postgresql.org/docs/devel/static/app-psql.html#
>> APP-PSQL-PROMPTING>
>>
>> although it's just talking about a color change.
>>
>>  regards, tom lane
>>
>>
>>
>
> --
> Adrian Klaver
> adrian.kla...@aklaver.com
>


Query act different when doing by hand and by using a driver in app

2018-09-14 Thread ik
Hello,

Not sure that this is the right mailing list, so sorry from advance.

I have a program that when it does a query I have one raw returns, but when
I execute the same query with the same conditions, I get the right number
of rows back.

I'm using gonlang and https://github.com/jackc/pgx .
The query inside is inside an already open cursor of another "select" query
that I iterate over.

Is there a way to debug just that inside pg-logs without having all
possible queries logged in?

Thank you
Ido


Re: Query act different when doing by hand and by using a driver in app

2018-09-15 Thread ik
Hi

Thank you for the answer, after a longer tracing, (go based and printing pg
queries to log, I realize that it happens on a different place that I
thought it does.

Ido

On Sat, Sep 15, 2018 at 12:13 AM Adrian Klaver 
wrote:

> On 9/14/18 12:11 PM, ik wrote:
> > Hello,
> >
> > Not sure that this is the right mailing list, so sorry from advance.
> >
> > I have a program that when it does a query I have one raw returns, but
> > when I execute the same query with the same conditions, I get the right
> > number of rows back.
>
> The above is going to need more information to work out:
>
> 1) The query that returns one row is running in a Go program using the
> Go driver below, correct?
>
> 2) The other query that returns correctly is being run where and how?
>
> 3) What is the actual query?
>
> 4) How is the query setup in the program?
>
> 5) Are you sure the incorrect and correct queries are running against
> the same database?
>
> >
> > I'm using gonlang and https://github.com/jackc/pgx .
> > The query inside is inside an already open cursor of another "select"
> > query that I iterate over.
> >
> > Is there a way to debug just that inside pg-logs without having all
> > possible queries logged in?
>
> If it is a SELECT query then no.
>
> >
> > Thank you
> > Ido
>
>
> --
> Adrian Klaver
> adrian.kla...@aklaver.com
>