[SQL] have you feel anything when you read this ?

2006-03-20 Thread Eugene E.
http://dev.mysql.com/doc/refman/5.0/en/news-5-0-19.html --- cut --- mysql no longer terminates data value display when it encounters a NUL byte. Instead, it displays NUL bytes as spaces. (Bug #16859) --- cut --- ---(end of broadcast)--- TIP 2: Don

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread PFC
have you feel anything when you read this ? Business as usual... It's more fun to grep "crash" on this page, which gets about 27 results... ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Eugene E.
PFC wrote: have you feel anything when you read this ? Business as usual... It's more fun to grep "crash" on this page, which gets about 27 results... i am not trying to fight against or for any brandname: not Mesql nor postgres. just sed 's/MySQL/SomeDBMS/g' and concentrate o

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Peter Eisentraut
Eugene E. wrote: > PFC wrote: > >> have you feel anything when you read this ? > > > > Business as usual... > > > > It's more fun to grep "crash" on this page, which gets about 27 > > results... > > i am not trying to fight against or for any brandname: not Mesql nor > postgres. > > just se

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Eugene E.
Peter Eisentraut wrote: Eugene E. wrote: PFC wrote: have you feel anything when you read this ? Business as usual... It's more fun to grep "crash" on this page, which gets about 27 results... i am not trying to fight against or for any brandname: not Mesql nor postgres. just sed '

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Peter Eisentraut
Eugene E. wrote: > you may decide to print something else, aint'you ? > BUT > if they print them then they at least OUTPUT them. I'm not sure what you are getting at here. The only data type in PostgreSQL that has a notion of null bytes is bytea, and bytea prints out null bytes in unambigious f

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Eugene E.
Peter Eisentraut wrote: Eugene E. wrote: you may decide to print something else, aint'you ? BUT if they print them then they at least OUTPUT them. I'm not sure what you are getting at here. The only data type in PostgreSQL that has a notion of null bytes is bytea, and bytea prints out nul

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Peter Eisentraut
Eugene E. wrote: > the bytea does not output NULs at all. > don't mock me. peter=# create table test (a bytea); CREATE TABLE peter=# insert into test values ('a\\000b'); INSERT 0 1 peter=# select * from test; a a\000b -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Achilleus Mantzios
O Peter Eisentraut έγραψε στις Mar 20, 2006 : > Eugene E. wrote: > > the bytea does not output NULs at all. > > don't mock me. > > peter=# create table test (a bytea); > CREATE TABLE > peter=# insert into test values ('a\\000b'); > INSERT 0 1 > peter=# select * from test; >a > > a\0

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Alvaro Herrera
Achilleus Mantzios wrote: > dynacom=# SELECT '\000\150\145\154\154\157'::text; > text > -- > > (1 row) > > dynacom=# > > Oops! text is not bytea. alvherre=# SELECT $$\000\150\145\154\154\157$$::bytea; bytea --- \000hello (1 fila) -- Alvaro Herrera

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Eugene E.
Peter Eisentraut wrote: Eugene E. wrote: the bytea does not output NULs at all. don't mock me. peter=# create table test (a bytea); CREATE TABLE peter=# insert into test values ('a\\000b'); INSERT 0 1 peter=# select * from test; a a\000b are you kidding ? where is NUL-byte in

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Achilleus Mantzios
O Alvaro Herrera έγραψε στις Mar 20, 2006 : > Achilleus Mantzios wrote: > > > dynacom=# SELECT '\000\150\145\154\154\157'::text; > > text > > -- > > > > (1 row) > > > > dynacom=# > > > > Oops! > > text is not bytea. > > alvherre=# SELECT $$\000\150\145\154\154\157$$::bytea; >

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Alvaro Herrera
Achilleus Mantzios wrote: > O Alvaro Herrera ?? Mar 20, 2006 : > > > text is not bytea. > > > > alvherre=# SELECT $$\000\150\145\154\154\157$$::bytea; > >bytea > > --- > > \000hello > > (1 fila) > > Sure, but we are trying to reproduce the mysql phaenomenon right? :) I

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Achilleus Mantzios
O Eugene E. έγραψε στις Mar 20, 2006 : > Peter Eisentraut wrote: > > Eugene E. wrote: > > > >>the bytea does not output NULs at all. > >>don't mock me. > > > > > > peter=# create table test (a bytea); > > CREATE TABLE > > peter=# insert into test values ('a\\000b'); > > INSERT 0 1 > > peter=# s

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Eugene E.
Alvaro Herrera wrote: Achilleus Mantzios wrote: dynacom=# SELECT '\000\150\145\154\154\157'::text; text -- (1 row) dynacom=# Oops! text is not bytea. source says: typedef text varlena; typedef bytea varlena; :-) ---(end of broadcast)

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Alvaro Herrera
Eugene E. wrote: > Alvaro Herrera wrote: > >text is not bytea. > > source says: > > typedef text varlena; > typedef bytea varlena; This means that as far as the C type system is concerned, both bytea and text are treated as "struct varlena". It doesn't mean that they are processed by the same

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Eugene E.
Achilleus Mantzios wrote: a a\000b are you kidding ? where is NUL-byte in "a\000b" ??? Null byte is a byte of value zero, and allow me to say that the \000 in "a\000b" is exactly this. if ("\0"=="\\000") printf("congratulations!!!"); NOTE: I am not care about a _display_ N

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Eugene E.
Alvaro Herrera wrote: Eugene E. wrote: Alvaro Herrera wrote: text is not bytea. source says: typedef text varlena; typedef bytea varlena; This means that as far as the C type system is concerned, both bytea and text are treated as "struct varlena". It doesn't mean that they are proce

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Peter Eisentraut
Eugene E. wrote: > the problem is: you'll get this four byte sequence '\000' _instead_ > of NUL-byte anyway. What you seem to be missing is that PostgreSQL data can be represented in textual and in binary form. What you in psql is the textual form. If you want the binary form you need to selec

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Peter Eisentraut
Eugene E. wrote: > input. then what a difference bitween those types except strlen() ? bytea does not consider character set encodings and locales, and it handles null bytes. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)-

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread PFC
the problem is: you'll get this four byte sequence '\000' _instead_ of NUL-byte anyway. http://www.postgresql.org/docs/8.1/interactive/datatype-binary.html says : "A binary string is a sequence of octets (or bytes). Binary strings are distinguished from character strings by two characteri

Re: [SQL] update before drop causes OID problems in transaction?

2006-03-20 Thread Richard Huxton
Jeff Frost wrote: On Sat, 18 Mar 2006, Tom Lane wrote: IIRC you'd have to drop the underlying plpgsql function, not only the trigger object that connects the function to a table. We cache stuff with respect to the function. Tom, sorry it took me a little while to make a test case. The test

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Eugene E.
I wrote: the problem is: you'll get this four byte sequence '\000' _instead_ of NUL-byte anyway. You wrote: Your client library should take care of escaping and de-escaping. We both agree as you see. Then i am asking: WHY should a client take care of de-escaping ? Why not to get his data

[SQL] pgsql2shp - Could not create dbf file

2006-03-20 Thread Fay Du
Hi everyone: I got an error when I use pgsal2shp. My server is Linux The command I used is: pgsql2shp -f newroads gisdb testarea Where, newroads is my out put file name, gisdb is database name, and testarea is table name. After hit enter button, I got the mess

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Rod Taylor
On Mon, 2006-03-20 at 17:53 +0300, Eugene E. wrote: > I wrote: > > >> the problem is: you'll get this four byte sequence '\000' _instead_ > >> of NUL-byte anyway. > > You wrote: > > > Your client library should take care of escaping and de-escaping. > > We both agree as you see. > > Then i

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Scott Marlowe
On Mon, 2006-03-20 at 02:06, Eugene E. wrote: > http://dev.mysql.com/doc/refman/5.0/en/news-5-0-19.html > --- cut --- > mysql no longer terminates data value display when it encounters a NUL > byte. Instead, it displays NUL bytes as spaces. (Bug #16859) > --- cut --- Everyone here realizes that t

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread PFC
I wrote: the problem is: you'll get this four byte sequence '\000' _instead_ of NUL-byte anyway. You wrote: Your client library should take care of escaping and de-escaping. We both agree as you see. Then i am asking: WHY should a client take care of de-escaping ? Why not to get his d

Re: [SQL] update before drop causes OID problems in transaction?

2006-03-20 Thread Jeff Frost
On Mon, 20 Mar 2006, Richard Huxton wrote: I stripped the tables and queries down to the minimum that demonstrated the error. Interestingly, the problem was not reproducible until I added the credit_card_audit_account_id constraint below: CONSTRAINT credit_card_audit_account_id_fkey FOREI

Re: [SQL] update before drop causes OID problems in transaction?

2006-03-20 Thread Richard Huxton
Jeff Frost wrote: Another problem might well be with your plpgsql trigger function. If you're dropping/re-creating credit_card_audit then that'll give you the error you're seeing. The trigger shouldn't be firing at all in this scenario as it is on credit_card and not credit_card_audit. Are y

Re: [SQL] update before drop causes OID problems in transaction?

2006-03-20 Thread Richard Huxton
Jeff Frost wrote: Another problem might well be with your plpgsql trigger function. If you're dropping/re-creating credit_card_audit then that'll give you the error you're seeing. The trigger shouldn't be firing at all in this scenario as it is on credit_card and not credit_card_audit. Are

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > text is not bytea. Indeed. I wonder whether we shouldn't tweak the SQL string literal parser to reject \000, because AFAICS that isn't going to do anything useful for any datatype, and it leads to what are at best questionable results. (bytea's proces

[SQL] Power cut and performance problem

2006-03-20 Thread Daniel Caune
Hi, We had a power cut lastly and it seems that our PostgreSQL database suffers from performance since. For example, a simple query such as "SELECT MIN(a-primary-key-column) FROM a-table" takes quite a very long time; actually I gave up before getting the result. I shutdown and started up the da

Re: [SQL] Power cut and performance problem

2006-03-20 Thread Jeff Frost
I see you're running autovacuum. What's your disk subsytem look like? By chance is it sitting on a RAID 5 that's running in degraded mode right now while it scrubs? On Mon, 20 Mar 2006, Daniel Caune wrote: Hi, We had a power cut lastly and it seems that our PostgreSQL database suffers from

Re: [SQL] Power cut and performance problem

2006-03-20 Thread Daniel Caune
> I see you're running autovacuum. What's your disk subsytem look like? By > chance is it sitting on a RAID 5 that's running in degraded mode right now > while it scrubs? > Yes, that should be the problem. I will check that tomorrow morning with a Linux administrator. Thanks.

Re: [SQL] Power cut and performance problem

2006-03-20 Thread Jeff Frost
On Mon, 20 Mar 2006, Daniel Caune wrote: I see you're running autovacuum. What's your disk subsytem look like? By chance is it sitting on a RAID 5 that's running in degraded mode right now while it scrubs? Yes, that should be the problem. I will check that tomorrow morning with a Linux

[SQL] Update counter when row SELECT'd ... ?

2006-03-20 Thread Marc G. Fournier
I have a simple table: name, url, counter I want to be able to do: SELECT * FROM table ORDER BY counter limit 5; But, I want counter to be incremented by 1 *if* the row is included in that 5 ... so that those 5 basically move to the bottom of the list, and the next 5 come up ... I've chec

Re: [SQL] Update counter when row SELECT'd ... ?

2006-03-20 Thread Daniel CAUNE
> I have a simple table: > > name, url, counter > > I want to be able to do: > > SELECT * FROM table ORDER BY counter limit 5; > > But, I want counter to be incremented by 1 *if* the row is included in > that 5 ... so that those 5 basically move to the bottom of the list, and > the next 5 come

[SQL] Unable to connect To Database...

2006-03-20 Thread manashi chakraborty
  hi...     I am doin my project in PHP with PostgreSQL as backend...         Both r very new to me My OS is LINUX    I am trying to connect to the database bt its not getin connected...   By using     "su posgres" command   i hav created user "root" and database "sample"     By using