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

2006-04-06 Thread Eugene E.
Markus Schaber wrote: Hi, Eugene, Eugene E. wrote: Okay, now pass that to strcmp or a %s format. AFAIK, the "textual-form" of values is meant to be a c-string. "ab\0cd\0" is not a c-string containing ab\0cd, it's a c-string containing ab. WHY strcmp ?! do you r

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

2006-04-06 Thread Eugene E.
Stephan Szabo wrote: What would you expect it to do given a single result format argument? If you want to propose a new function (set of functions) that have different behavior, make a coherent proposal. > Statements like it should > do X because I want it to aren't coherent proposals. AFAIK,

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

2006-04-06 Thread Eugene E.
Praescriptum: If my english is ugly and something is written unclear, please complaint, and i'll try to rephrase. anyway i am trying to be understood. I said >> WHY SHOULD I RETRIVE A SINGLE BYTEA FIELD IN A SEPARATE QUERY ??? Stephan Szabo wrote: What would you expect it to do given a si

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

2006-04-05 Thread Eugene E.
Stephan Szabo wrote: On Wed, 5 Apr 2006, Eugene E. wrote: Stephan Szabo wrote: On Tue, 4 Apr 2006, Eugene E. wrote: Stephan Szabo wrote: On Fri, 31 Mar 2006, Eugene E. wrote: Peter Eisentraut wrote: Eugene E. wrote: the problem is: you'll get this four byte seq

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

2006-04-04 Thread Eugene E.
Stephan Szabo wrote: On Tue, 4 Apr 2006, Eugene E. wrote: Stephan Szabo wrote: On Fri, 31 Mar 2006, Eugene E. wrote: Peter Eisentraut wrote: Eugene E. wrote: the problem is: you'll get this four byte sequence '\000' _instead_ of NUL-byte anyway. What you seem t

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

2006-04-04 Thread Eugene E.
Stephan Szabo wrote: On Fri, 31 Mar 2006, Eugene E. wrote: Peter Eisentraut wrote: 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 textua

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

2006-03-30 Thread Eugene E.
Peter Eisentraut wrote: 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.

Re: [SQL] Permission to Select

2006-03-27 Thread Eugene E.
Markus Schaber wrote: Hi, Eugene, Eugene E. wrote: This means that some privileges are NOT INDEPENDENT. No, it means that the UPDATE operation needs both UPDATE and SELECT privileges. Markus thanx. I already clear this to me. ---(end of broadcast

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

2006-03-21 Thread Eugene E.
Scott Marlowe wrote: 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

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

2006-03-21 Thread Eugene E.
PFC 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 am asking: WHY should a client take care of de-escaping ? Why no

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

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 mea

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: 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 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

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 p

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 post

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

[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] PostgreSQL Handling of Special Characters

2006-03-19 Thread Eugene E.
Christian Paul B. Cosinas wrote: Hi Markus, Can you please elaborate more on this. I'm really lost. Be sure that postgresql ITSELF is handling all chars transparently except ZEROES. Look for the error in the media layer ---(end of broadcast)-

Re: [SQL] Permission to Select -- I am wrong

2006-03-13 Thread Eugene E.
Eugene E. wrote: PFC wrote: What information can be retrieved from a structure by being able to update all rows? Write a plpgsql function snoop(x) which inserts x into a table 'log' created by you, and also returns x. UPDATE users SET password=snoop(password).

Re: [SQL] Permission to Select

2006-03-13 Thread Eugene E.
PFC wrote: What information can be retrieved from a structure by being able to update all rows? Write a plpgsql function snoop(x) which inserts x into a table 'log' created by you, and also returns x. UPDATE users SET password=snoop(password). Read log table. Done. This

Re: [SQL] Permission to Select

2006-03-13 Thread Eugene E.
Tom Lane wrote: "Eugene E." <[EMAIL PROTECTED]> writes: db=# REVOKE all ON t FROM u; db=# GRANT update,insert,delete ON t TO u; db=# \c - u db=> INSERT INTO t VALUES (1,'x'); INSERT db=> UPDATE t SET a='y' WHERE i=1; ERROR: Permission denied for r

[SQL] Permission to Select

2006-03-13 Thread Eugene E.
Hi all the serious problem with permissions is encountered NOTE: the following example is really useful but there is no room to describe it's use. db=# CREATE USER u; db=# CREATE TABLE t (i int, a text); db=# REVOKE all ON t FROM u; db=# GRANT update,insert,delete ON t TO u; db=# \c - u db=>

[SQL] what is going on in the PostgreSQL

2005-11-23 Thread Eugene E.
Hello all ! look template1=> \set a select template1=> \set b 1 template1=> :a :b; column -- 1 hope this is only psql's feathure not the server's one; ---(end of broadcast)--- TIP 4: Have you searched our list archives? http

Re: [SQL] query to file

2005-10-18 Thread Eugene E.
Judith Altamirano Figueroa wrote: Excuse me, how can I send a query to a file?, for example the result of this query: select id_articulo, articulo, color_code from articulos; if you mean psql \o filename and try to read output of a command \? ---(end of broadcast)---

Re: [SQL] catching errors in function

2005-10-06 Thread Eugene E.
i have written function in which while executing it may throw error. if the error thrown i want rollback the transaction if not i want commit. BEGIN; SELECT you_function(args); ... many sql commands; ... COMMIT; that's all if your function raises an error whole transaction will be aborted whe

Re: [SQL] How do I convert an integet to a timestamp?

2005-09-13 Thread Eugene E.
Wei wrote: Hi. I followed the doc and tried "select CAST(1126547334 AS timestamp)" and I only got an error response that says: ERROR: cannot cast type integer to timestamp without time zone. What is the proper way to do the conversion? select 123456789::abstime::timestamp; -

Re: [SQL] a "catch all" type ... such a thing?

2005-09-08 Thread Eugene E.
Marc G. Fournier wrote: Are there any data types that can hold pretty much any type of character? UTF-16 isn't supported (or its missing from teh docs), and UTF-8 doesn't appear to have a big enough range ... PLEASE Note: type of caracter is generally not a matter of _datatype_

[SQL] REINDEX DATABASE

2005-07-26 Thread Eugene E.
Hello Would you like to advice to use REINDEX DATABASE on regular basis ? if (yes) how it should be connected with VACUUM FULL ANALYZE which is run regularly ? (reindex before vacuum or vacuum before reindex?) else haw to determine _when_ to run REINDEX ? many thanks -