Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 12:19 AM
Bruce Momjian
 
Posts: n/a
Default Re: [COMMITTERS] pgsql: Allow psql multi-line column values to align


OK, I have applied your patch to psql and Teodor has adjusted the
tsearch2 expected results. I can't seem to run pgcrypto without getting
PRNG errors, so I expect my SSL is too old. Would you send me your
pgcrypto/regression.diff? Thanks.

---------------------------------------------------------------------------

Kris Jurka wrote:
>
>
> On Thu, 9 Feb 2006, Bruce Momjian wrote:
>
> > Log Message:
> > -----------
> > Allow psql multi-line column values to align in the proper columns
> >

>
> There is a problem with this on AIX.
>
> http://pgbuildfarm.org/cgi-bin/show_...-10%2006:23:00
>
> For tables that have no columns AIX thinks it has an out of memory error.
> src/bin/psql/print.cg_local_calloc bails out if calloc returns NULL. I
> believe AIX is returning NULL for calloc with a count of zero. Efforts
> are made not to call pg_local_calloc with a count of zero, but one place
> is missed, the attached patch fixes that.
>
> Additionally there are a whole lot of of signedness warnings introduced
> which I've attached.
>
> Kris Jurka


Content-Description:

[ Attachment, skipping... ]

Content-Description:

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly


--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 12:19 AM
Tom Lane
 
Posts: n/a
Default Re: [COMMITTERS] pgsql: Allow psql multi-line column values to align

Bruce Momjian <pgman@candle.pha.pa.us> writes:
> OK, I have applied your patch to psql and Teodor has adjusted the
> tsearch2 expected results. I can't seem to run pgcrypto without getting
> PRNG errors, so I expect my SSL is too old. Would you send me your
> pgcrypto/regression.diff? Thanks.


I fixed that already. Please see about fixing the compiler warnings you
introduced. On a 64-bit machine there are even more, and the int vs
size_t ones are definitely portability problems.

regards, tom lane

print.c: In function 'print_aligned_text':
print.c:408: warning: pointer targets in passing argument 4 of 'pg_wcssize' differ in signedness
print.c:428: warning: pointer targets in passing argument 4 of 'pg_wcssize' differ in signedness
print.c:479: warning: pointer targets in passing argument 4 of 'pg_wcssize' differ in signedness
print.c:588: warning: pointer targets in passing argument 1 of 'format_numeric_locale' differ in signedness
print.c:589: warning: field width should have type 'int', but argument 3 has type 'size_t'
print.c: In function 'print_aligned_vertical':
print.c:690: warning: pointer targets in passing argument 4 of 'pg_wcssize' differ in signedness
print.c:714: warning: pointer targets in passing argument 4 of 'pg_wcssize' differ in signedness
print.c:823: warning: pointer targets in passing argument 1 of 'format_numeric_locale' differ in signedness
print.c:827: warning: field width should have type 'int', but argument 4 has type 'size_t'
print.c: In function 'printQuery':
print.c:1753: warning: pointer targets in passing argument 1 of 'mbvalidate' differ in signedness
print.c:1753: warning: pointer targets in assignment differ in signedness
print.c:1764: warning: pointer targets in passing argument 1 of 'mbvalidate' differ in signedness
print.c:1764: warning: pointer targets in assignment differ in signedness
mbprint.c: In function 'pg_wcswidth':
mbprint.c:161: warning: pointer targets in passing argument 1 of 'PQmblen' differ in signedness
mbprint.c:165: warning: pointer targets in passing argument 1 of 'PQdsplen' differ in signedness
mbprint.c: In function 'pg_wcssize':
mbprint.c:194: warning: pointer targets in passing argument 1 of 'PQmblen' differ in signedness
mbprint.c:197: warning: pointer targets in passing argument 1 of 'PQdsplen' differ in signedness
mbprint.c: In function 'pg_wcsformat':
mbprint.c:260: warning: pointer targets in initialization differ in signedness
mbprint.c:264: warning: pointer targets in passing argument 1 of 'PQmblen' differ in signedness
mbprint.c:267: warning: pointer targets in passing argument 1 of 'PQdsplen' differ in signedness
mbprint.c:281: warning: pointer targets in assignment differ in signedness
print.c: In function 'print_aligned_text':
print.c:408: warning: pointer targets in passing argument 4 of 'pg_wcssize' differ in signedness
print.c:428: warning: pointer targets in passing argument 4 of 'pg_wcssize' differ in signedness
print.c:479: warning: pointer targets in passing argument 4 of 'pg_wcssize' differ in signedness
print.c:588: warning: pointer targets in passing argument 1 of 'format_numeric_locale' differ in signedness
print.c:589: warning: field width should have type 'int', but argument 3 has type 'size_t'
print.c: In function 'print_aligned_vertical':
print.c:690: warning: pointer targets in passing argument 4 of 'pg_wcssize' differ in signedness
print.c:714: warning: pointer targets in passing argument 4 of 'pg_wcssize' differ in signedness
print.c:823: warning: pointer targets in passing argument 1 of 'format_numeric_locale' differ in signedness
print.c:827: warning: field width should have type 'int', but argument 4 has type 'size_t'
print.c: In function 'printQuery':
print.c:1753: warning: pointer targets in passing argument 1 of 'mbvalidate' differ in signedness
print.c:1753: warning: pointer targets in assignment differ in signedness
print.c:1764: warning: pointer targets in passing argument 1 of 'mbvalidate' differ in signedness
print.c:1764: warning: pointer targets in assignment differ in signedness
mbprint.c: In function 'pg_wcswidth':
mbprint.c:161: warning: pointer targets in passing argument 1 of 'PQmblen' differ in signedness
mbprint.c:165: warning: pointer targets in passing argument 1 of 'PQdsplen' differ in signedness
mbprint.c: In function 'pg_wcssize':
mbprint.c:194: warning: pointer targets in passing argument 1 of 'PQmblen' differ in signedness
mbprint.c:197: warning: pointer targets in passing argument 1 of 'PQdsplen' differ in signedness
mbprint.c: In function 'pg_wcsformat':
mbprint.c:260: warning: pointer targets in initialization differ in signedness
mbprint.c:264: warning: pointer targets in passing argument 1 of 'PQmblen' differ in signedness
mbprint.c:267: warning: pointer targets in passing argument 1 of 'PQdsplen' differ in signedness
mbprint.c:281: warning: pointer targets in assignment differ in signedness

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 12:19 AM
Martijn van Oosterhout
 
Posts: n/a
Default Re: [COMMITTERS] pgsql: Allow psql multi-line column values to align

On Fri, Feb 10, 2006 at 11:02:41AM -0500, Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > OK, I have applied your patch to psql and Teodor has adjusted the
> > tsearch2 expected results. I can't seem to run pgcrypto without getting
> > PRNG errors, so I expect my SSL is too old. Would you send me your
> > pgcrypto/regression.diff? Thanks.

>
> I fixed that already. Please see about fixing the compiler warnings you
> introduced. On a 64-bit machine there are even more, and the int vs
> size_t ones are definitely portability problems.


Ouch. I submitted this patch so long ago I figured it'd gotten lost. I
was actually considering preparing a new version against HEAD.

I'll try to address these warnings (unless someone beats me to it).
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.


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

iD8DBQFD7MYkIB7bNG8LQkwRAgdKAKCC9g2BEXE2+TZ4A2VWd2 SZdz7/GwCfUPqP
9KxSyQnKEMmGePqwH9jqVHA=
=eaB0
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-18-2008, 12:19 AM
Bruce Momjian
 
Posts: n/a
Default Re: [COMMITTERS] pgsql: Allow psql multi-line column values

Martijn van Oosterhout wrote:
-- Start of PGP signed section.
> On Fri, Feb 10, 2006 at 11:02:41AM -0500, Tom Lane wrote:
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > OK, I have applied your patch to psql and Teodor has adjusted the
> > > tsearch2 expected results. I can't seem to run pgcrypto without getting
> > > PRNG errors, so I expect my SSL is too old. Would you send me your
> > > pgcrypto/regression.diff? Thanks.

> >
> > I fixed that already. Please see about fixing the compiler warnings you
> > introduced. On a 64-bit machine there are even more, and the int vs
> > size_t ones are definitely portability problems.

>
> Ouch. I submitted this patch so long ago I figured it'd gotten lost. I
> was actually considering preparing a new version against HEAD.


We loose nothing! :-)

> I'll try to address these warnings (unless someone beats me to it).


I am looking at it now but I can't find the compiler flag to get those
warnings. I am gcc 2.95.3.


--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-18-2008, 12:19 AM
Tom Lane
 
Posts: n/a
Default Re: [COMMITTERS] pgsql: Allow psql multi-line column values to align

Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Martijn van Oosterhout wrote:
>> I'll try to address these warnings (unless someone beats me to it).


> I am looking at it now but I can't find the compiler flag to get those
> warnings. I am gcc 2.95.3.


You'd need a newer compiler.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-18-2008, 12:19 AM
Bruce Momjian
 
Posts: n/a
Default Re: [COMMITTERS] pgsql: Allow psql multi-line column values

Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Martijn van Oosterhout wrote:
> >> I'll try to address these warnings (unless someone beats me to it).

>
> > I am looking at it now but I can't find the compiler flag to get those
> > warnings. I am gcc 2.95.3.

>
> You'd need a newer compiler.


gcc -pedantic is showing it to me.

--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-18-2008, 12:19 AM
Martijn van Oosterhout
 
Posts: n/a
Default Re: [COMMITTERS] pgsql: Allow psql multi-line column values to align

On Fri, Feb 10, 2006 at 12:09:13PM -0500, Bruce Momjian wrote:
> Tom Lane wrote:
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > Martijn van Oosterhout wrote:
> > >> I'll try to address these warnings (unless someone beats me to it).

> >
> > > I am looking at it now but I can't find the compiler flag to get those
> > > warnings. I am gcc 2.95.3.

> >
> > You'd need a newer compiler.

>
> gcc -pedantic is showing it to me.


Thanks for the tip. I'm currently merging CVS with my version and
getting a lot of conflicts (whitespace variations).

It's fairly simple changes AFAICS. Just need to fix the declarations of
a few variables.
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.


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

iD8DBQFD7MpXIB7bNG8LQkwRAtFPAJ9b5SgZLdluERioe6WSdG xNMqvJ9ACcD4hD
LbdAotyghGodaCdtIhQxE1M=
=32yK
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-18-2008, 12:19 AM
Martijn van Oosterhout
 
Posts: n/a
Default Re: [COMMITTERS] pgsql: Allow psql multi-line column values to align

On Fri, Feb 10, 2006 at 06:16:07PM +0100, Martijn van Oosterhout wrote:
> Thanks for the tip. I'm currently merging CVS with my version and
> getting a lot of conflicts (whitespace variations).
>
> It's fairly simple changes AFAICS. Just need to fix the declarations of
> a few variables.


Does PostgreSQL have a policy on the signedness of strings? When I was
making the patch I generally used "unsigned char" to try to emphasise
that these are not characters, they are bytes of an encoding. But this
doesn't play well with existing functions like PQdsplen and PQmblen.

At this point I'm thinking of dropping the "unsigned" everywhere and
just being really careful of comparisons. OTOH, it's really those two
functions being inconsistant because the underlying functions do use
unsigned. Thoughts?

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-18-2008, 12:19 AM
Tom Lane
 
Posts: n/a
Default Re: [COMMITTERS] pgsql: Allow psql multi-line column values to align

Martijn van Oosterhout <kleptog@svana.org> writes:
> Does PostgreSQL have a policy on the signedness of strings?


For the most part we say "char" where we can and "unsigned char" only
where it really matters, which is mostly inside code that's
encoding-aware anyway.

It was only fairly recently that we cleaned the code up to avoid
signedness warnings, but now that that's done I don't want to backtrack
on it. What I'd suggest is taking a close look at the set of functions
you have and trying to identify a layer that should be "unsigned char"
versus upper layers that can just say "char".

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-18-2008, 12:19 AM
Martijn van Oosterhout
 
Posts: n/a
Default Re: [COMMITTERS] pgsql: Allow psql multi-line column values to align

On Fri, Feb 10, 2006 at 02:13:26PM -0500, Tom Lane wrote:
> For the most part we say "char" where we can and "unsigned char" only
> where it really matters, which is mostly inside code that's
> encoding-aware anyway.


Well, I've done this and avoided changing any public interfaces. ie the
libpq interface remains unsigned, as does the psql formatting code, but
the printTable stuff only is for the parts that actually do
formatting...

Patch attached. Passes -pedantic on gcc 3.3.5

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.


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

iD8DBQFD7QpYIB7bNG8LQkwRAiFkAJwK2c/wIph8jwBR56i+oD1RHI3kLwCfbY9D
xyt6jefKmplPP82E6WXrOnM=
=Cbb4
-----END PGP SIGNATURE-----

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 12:49 AM.


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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481