Unix Technical Forum

Re: [NOVICE] encoding problems

This is a discussion on Re: [NOVICE] encoding problems within the pgsql Hackers forums, part of the PostgreSQL category; --> On Tue, Mar 11, 2008 at 12:41:35PM -0400, Tom Lane wrote: > > If I create the same function ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-15-2008, 10:46 PM
Martijn van Oosterhout
 
Posts: n/a
Default Re: [NOVICE] encoding problems

On Tue, Mar 11, 2008 at 12:41:35PM -0400, Tom Lane wrote:
> > If I create the same function on my computer running PostgreSQL 8.3.0 and try
> > the \df+ then the Source Code shows:

>
> > \x09DECLARE
> > \x09\x09result text;
> > ...

>
> That's not an encoding problem, that's an intentional behavioral change
> in the way that psql formats strings for display.
>
> I guess it's a bit annoying if you were hoping that tabs would be useful
> for pretty-printing purposes. Should we reconsider what's done with a
> tab in mbprint.c?


At the time that patch was introduced there was discussion about this.
The problem being that psql has no idea what will actually happen to
the cursor when it emits a tab. You can guess but in the end we decided
it was more important to have the display not messed up than displaying
tabs as is.

The other alternative is to convert tabs to spaces on output. Can't
remember why we didn't do that.

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFH15FbIB7bNG8LQkwRArj/AJ0QthTz84r676hpmLzXjT75eJCLBACfXfS5
0Ffat1UyWLGKzDOHDZrVwAk=
=z6OX
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-07-2008, 10:18 AM
Guillaume Smet
 
Posts: n/a
Default Re: [NOVICE] encoding problems

On Wed, Mar 12, 2008 at 4:35 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Martijn van Oosterhout <kleptog@svana.org> writes:
> > The other alternative is to convert tabs to spaces on output. Can't
> > remember why we didn't do that.

>
> Yeah. The idea I had was to invent a parameter specifying the number of
> spaces a tab should expand to --- setting this to zero would give you
> the current \x09 behavior. I'm not sure how painful it would be to
> expand tabs properly in mbprint, but it seems possible.


Is there any plan to fix this behaviour in 8.3 branch? For instance,
the pg_stat_activity output is far less readable than before when
people use tabs to indent the SQL queries in their applications. From
my experience, it's pretty common and it's really a regression from
the usability point of view.

Regards,

--
Guillaume

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:56 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com