[BUGS] Crash caused by CHECK on child

2001-09-24 Thread Kevin Way

Baldvin posted this greatly simplified test case, which also
crashes the server without even using PL/pgSQL on pgsql-sql.

-- Hi Kevin, and everyone!
-- 
-- I don't think that I only found a minor bug compared to
-- the other you wrote in your last letter: the backend crash
-- is caused by the same CHECK constraint in the child table.
-- 
-- However, for you without time to analyzing Kevin's huge
-- scheme, here is the very simplified, crash-causing script.
-- 


drop table child;
drop table ancestor;

create table ancestor (
  node_id int4,
  a int4
);

create table child (
  b int4 NOT NULL DEFAULT 0 ,
  c int4 not null default 3,
  CHECK ( child.b = 0 OR child.b = 1 )
) inherits (ancestor);

insert into ancestor values (3,4);
insert into child (node_id, a, b) values (5,6,1);

update ancestor set a=8 where node_id=5;

-
-- 
-- I am hunting it, but I have to learn all what this query-executing
-- about, so probably it takes uncomparable longer for me than for
-- a developer.
-- 
-- Regards,
-- Baldvin
-- 



---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Re: [BUGS] Bug #468: psql field separator......

2001-09-24 Thread Peter Eisentraut

> Maurizio Totti ([EMAIL PROTECTED]) reports a bug with a severity of 3

> The option for change the field separator in psql don't work (or I'm not able to use 
>it :-).

> a427137@prometeo:~$ psql -F ';' -c "select * from sd_tab_software" sdlog
>  softid | software |   pack
> +--+--
>   5 | AMM_ALL  | Server
>   6 | ANF  | Client
>   7 | ANF  | srv-ins
>   8 | AOI2.51  | Server
> [snip...]
> 251 | W_SIFITES_ESE| PE_CS_I
> 252 | W_SIFITES_ESE| SD_SR_I
> 253 |  |

The field separator only works in the unaligned output mode (\a).

-- 
Peter Eisentraut   [EMAIL PROTECTED]   http://funkturm.homeip.net/~peter


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



Re: [BUGS] [HACKERS] Server crash caused by CHECK on child

2001-09-24 Thread Kevin Way

> What version are you trying this script on?  I'm not
> seeing a crash on my 7.2 devel system (and the update occurs).

7.1.3.  I'll sup a copy of the 7.2 sources and see if that fixes the test
case, and my actual bug.

-Kevin Way

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



[BUGS] Bug #468: psql field separator......

2001-09-24 Thread pgsql-bugs

Maurizio Totti ([EMAIL PROTECTED]) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
psql field separator..

Long Description
The option for change the field separator in psql don't work (or I'm not able to use 
it :-).
I tried whit -F ';' or -P fieldsep=';' or in interactive mode with \f ';' or \pset 
fieldsep ';' etc. but nothing.
The old version (7.0.3) works fine.
Tanks.

Sample Code
a427137@prometeo:~$ psql -F ';' -c "select * from sd_tab_software" sdlog  
 softid | software |   pack   
+--+--
  5 | AMM_ALL  | Server  
  6 | ANF  | Client  
  7 | ANF  | srv-ins 
  8 | AOI2.51  | Server
[snip...]
251 | W_SIFITES_ESE| PE_CS_I 
252 | W_SIFITES_ESE| SD_SR_I 
253 |  | 
(254 rows)

OR 

sdlog=# select * from sd_tab_software; \pset fieldsep ';'
 softid | software |   pack   
+--+--
  5 | AMM_ALL  | Server  
  6 | ANF  | Client
[snip.]
251 | W_SIFITES_ESE| PE_CS_I 
252 | W_SIFITES_ESE| SD_SR_I 
253 |  | 
(254 rows)

Field separator is ';'.

! The program get the option correctly, but the output is the default.
Tanks

No file was uploaded with this report


---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Re: [BUGS] Bug #467: Can't insert a value of 0 (zero) into a Bytea

2001-09-24 Thread Joe Conway

> > Short Description
> > Can't insert a value of 0 (zero) into a Bytea type.
> >
> > Long Description
> > It does not zeem possible to insert a value of zero (0) into a bytea
type.  A
> > lso, using '\134' (the octal code for a backslash) causes byteain() to
genera
> > te an error message.
> >
> > As a side issue, how can one tell a backslash followed by 3 digits (four
byte
> > s of data) from an encoded byte of data?  It seems to me that byteaout()
shou
> > ld always output an octal escape sequence per byte, even if the
character is
> > printable.  That way the result is unambiguous in meaning (even if it is
wast
> > eful of bytes).
>
> Further investigation provided the following information:
>
> 1.  To insert a zero value the '\\000' sequence is required.
>
> 2.  To insert a backslash, 4 backslashes are required (i.e. '')
>
> Therefore, to insert a backslash followed by the characters 1, 2, and 3
(four
> bytes of data), you would uses the sequence '123'.  On retrieval from
the
> database, the sequence '\\123' would be returned.
>
> Can anyone confirm that this is correct.  If it is, then this bug report
can be closed.

This was recently discussed on hackers (see
http://fts.postgresql.org/db/mw/msg.html?mid=1032591), but the short answer
is that you are correct (and that this is not a bug).

[root@jec-linux /root]# psql -U postgres test
Welcome to psql, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
   \h for help with SQL commands
   \? for help on internal slash commands
   \g or terminate with semicolon to execute query
   \q to quit

test=# create table t1(f1 bytea);
CREATE
test=# insert into t1(f1) values('123');
INSERT 1482289 1
test=# select f1 from t1;
  f1
---
 \\123
(1 row)

test=# select octet_length(f1) from t1;
 octet_length
--
4
(1 row)

test=# insert into t1(f1) values('\\000');
INSERT 1482290 1
test=# select f1 from t1 where f1 = '\\000';
  f1
--
 \000
(1 row)

test=# select octet_length(f1) from t1 where f1 = '\\000';
 octet_length
--
1
(1 row)


HTH,

-- Joe



---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://archives.postgresql.org