Re: [SQL] Uniform UPDATE queries

2012-04-19 Thread Dennis
Hello Tom, The example you have given is EXACTLY why something like CURRENT is needed to limit the number of unique queries or prepared statements. (or to do a selection of all values before an update meaning two executed queries.) regards,. Dennis On 04/18/2012 06:24 PM, Tom Lane wrote

[SQL] Uniform UPDATE queries

2012-04-18 Thread Dennis
rs with CURRENT when the query is executed. Note the added WHERE clause? The parameter for id is always on the same index. This makes the bookkeeping a lot easier and should reduce the need for generating UPDATE queries or even client JDBC code. -- Dennis Verbeek -- Sent via pgsql-sql mailing lis

Re: [SQL] Help : insert a bytea data into new table

2010-03-15 Thread dennis
Dear Ben thanks for you anwser. I try to add function quote_literal on my sql statement . but it raise other error message (quote_literal not support bytea format): function quote_literal(bytea) does not exist Ben Morrow 提到: Quoth dennis : Hi Ben here is my function , it'

Re: [SQL] Help : insert a bytea data into new table

2010-03-15 Thread dennis
Postgres : 8.1.4 Dennis Ben Morrow wrote: Quoth dennis: Dear Ben thanks for you anwser. I try to add function quote_literal on my sql statement . but it raise other error message (quote_literal not support bytea format): function quote_literal(bytea) does not exist Which

Re: [SQL] Help : insert a bytea data into new table

2010-03-15 Thread dennis
_chunk_table_usersessiontable(); result: NOTICE: /* NUM:42883, DETAILS:operator does not exist: text || bytea */ <<<< NOTICE: select * from usersessiontable order by sessionid limit 1 offset 1 check_missing_chunk_table_usersessiontable

Re: [SQL] Help : insert a bytea data into new table

2010-03-15 Thread dennis
here is example table name is "mail": column| type - sender|char subject |char content |bytea I want copy some record into new table 'mail_new'. sql: create table mail_new as select * from mail sender='dennis' result has an

Re: [HACKERS] [SQL] Case Preservation disregarding case

2006-12-02 Thread Dennis Bjorklund
fiers instead of lower casing them as pg do. The sql standard say that they should be upper cased. But as far as I know there are no plan at the moment to add such an option either. Some time in the future I expect it to be implemented only because it's the standard. /Dennis

Re: [HACKERS] [SQL] Case Preservation disregarding case

2006-12-02 Thread Dennis Bjorklund
R int); INSERT INTO foo VALUES (42); SELECT BaR, bar, BAR, "bar" FROM foo; But using "Bar" wont work. /Dennis ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL]

2005-02-01 Thread Dennis Sacks
imited text to be indexed & searched. Dennis Sacks [EMAIL PROTECTED]

Re: [SQL] BLOBs vs BYTEA

2005-01-31 Thread Dennis Sacks
filesystem (which is what filesystems are designed for) and store the metadata in the database. Dennis Sacks [EMAIL PROTECTED] ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command

Re: [SQL] same question little different test MSSQL vrs Postgres

2005-01-26 Thread Dennis Sacks
Bruno Wolff III wrote: On Tue, Jan 25, 2005 at 21:21:08 -0700, Dennis Sacks <[EMAIL PROTECTED]> wrote: One of the things you'll want to do regularly is run a "vacuum analyze". You can read up on this in the postgresql docs. This is essential to the indexes being use

Re: [SQL] same question little different test MSSQL vrs Postgres

2005-01-25 Thread Dennis Sacks
you'll want to run vacuum analyze. Dennis Sacks [EMAIL PROTECTED]

Re: [SQL] Moving from Transact SQL to PL/pgSQL

2005-01-25 Thread Dennis Sacks
ting from TSQL to PL/pgSQL, but then I've not looked for any. They may exist. Best of luck, Dennis Sacks [EMAIL PROTECTED]

Re: [SQL] converting Oracle scripts to PostgreSQL

2005-01-25 Thread Dennis Sacks
may need to be rewritten if they use the Oracle syntax for outer joins. Also the NVL function can be replaced with coalesce and DECODE will need to be rewritten with CASE. SYSDATE can be replaced with NOW() Also check out this doc for more hints: http://www-2.cs.cmu.edu/~pmerson/docs/OracleToPost

[SQL] simulating global temp tables in plpgsql functions

2004-12-28 Thread Dennis Sacks
or those of us porting from Oracle. Dennis [EMAIL PROTECTED] ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

[SQL] commit inside plpgsql function

2004-12-24 Thread Dennis Sacks
sense in plpgsql? Does it make sense to do a commit in plpgsql? Thanks, Dennis ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

[SQL] commit in plpgsql function?

2004-12-21 Thread Dennis Sacks
in plpgsql? Does it make sense to do a commit in plpgsql? Thanks, Dennis ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] returning multiple values and ref cursors

2004-05-04 Thread Dennis
Dennis writes: What are your thoughts on the best way to approach this? Break up the stored proc into ten different stored procs that return ref cursors? I guess another question here is whether I can return a row type or record type with (integer, varchar, refcursor) and then make use of the

[SQL] returning multiple values and ref cursors

2004-05-03 Thread Dennis
approach this? Break up the stored proc into ten different stored procs that return ref cursors? Thanks, Dennis dennis at calico dash consulting dot com ---(end of broadcast)--- TIP 6: Have you searched our list archives? http

Re: [SQL] lifetime of temp schema versus compiled image of plpgsql proc

2004-04-22 Thread Dennis
Bruce Momjian writes: There is an FAQ item on this --- use EXECUTE. So I should be using EXECUTE for all access to the temp tables? ie inserts, and selects (in this case). Should I use execute for the table creation? Dennis ---(end of broadcast

[SQL] lifetime of temp schema versus compiled image of plpgsql proc

2004-04-22 Thread Dennis
the transaction ends? I'm not explicitly referencing pg_temp_8 in my stored function. Can someone explain what is going on? Have I given enough information? dennis pg-user at calico dash consulting dot com ---(end of broadcast)--- TIP 9: the

Re: [SQL] function returning array

2004-04-15 Thread Dennis
Joe Conway writes: dennis'# pParsed varchar[]; Make that last line: pParsed varchar[] := ''{}''; That initializes pParsed to an *empty* array. Otherwise pParsed is NULL, and when you attempt to extend a NU

Re: [SQL] function returning array

2004-04-15 Thread Dennis
Tom Lane writes: "Dennis" <[EMAIL PROTECTED]> writes: I am trying to return an array from a function and don't seem to be having luck. Seems to work for me ... what PG version are you using? pg 7.4.1 I should have listed the source for the function. Here is a simplified par

[SQL] function returning array

2004-04-13 Thread Dennis
'm not sure if that is still the case or if I am doing something wrong. Do I need to go with returning a set instead? Dennis S [EMAIL PROTECTED] ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [SQL] cursors and for loops?

2004-04-11 Thread Dennis
t is documented? Also, I am not getting the results I think I should be getting. Is there any kind of debug setting, or if not that, a way to output text (i.e. printf) from plpgsql? Thanks, Dennis [EMAIL PROTECTED] ---(end of broadcast)--- TIP 4:

[SQL] cursors and for loops?

2004-04-11 Thread Dennis
Hello, I am wondering if I can use a cursor in a for loop. I haven't been able to get it to work. I am just beginning plpgsql and I am struggling here. I am trying to do this: create or replace function ttest(varchar) RETURNS varchar AS ' DECLARE parId ALIAS FOR $1; denn

Re: [SQL] [GENERAL] MD5() function not available ??

2003-09-13 Thread Dennis Bjorklund
n for example do dennis=# SELECT encode (digest ('the string', 'md5'), 'hex'); 44d5a3f30f0328e0cf60cd275ed3aac9 -- /Dennis ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] [GENERAL] plPGSQL bug in function creation

2003-09-09 Thread Dennis Gearon
Marek Lewczuk wrote: Hello, I think that there is a bug in plPGSQL - or maybe I don't know something about this language. Try to create this function Ok., this is the function created in plPGSQL: CREATE FUNCTION "public"."test" (text, text) RETURNS text AS' BEGIN IF $1 THEN RETURN $1; ELSE

Re: [SQL] sequence

2003-08-15 Thread Dennis Björklund
sql.org/docs/7.3/static/datatype.html#DATATYPE-SERIAL then you can do insert into table_name (field_name) values (DEFAULT); -- /Dennis ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] loop query results

2002-12-04 Thread Dennis Björklund
aps, but it doesn't hurt to know that it works as intended here. -- /Dennis ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

Re: [SQL] Min and Max

2002-12-02 Thread Dennis Björklund
dren.id_father = r.id_father and children.min = r.min; -- /Dennis ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

[SQL] Calculating with sql

2002-06-27 Thread Dennis Kaarsemaker
from tracks,albums where tracks.DISCID = albums.DISCID group by tracks.DISCID ); What is the correct way of selecting the album? -- Dennis K. ~.. It is impossible to make anything foolproof, .>>. because fools are so ingenious -Roger Berg- |\ --

[SQL] Forein Key Problem

2001-06-07 Thread Dennis
ntial integrity violation?? ie: ERROR: fk_col1 referential integrity violation - key referenced from B not found in A. Is there a way to make this type of constraint work with the update? If not, is there a way to create a constraint so that col1 != col2 is inforced? Thanks in advance.. D

[SQL] Foreign Keys and Inheritance

2001-06-06 Thread Dennis Muhlestein
If I have table A, which contains a primary key, and table B which inherits from A. How can I Create a Foreign Key on table C that references A, but will also pass if a record in inserted in to B. for instance: create table A ( prim_key char(20) not null primary key ); create table B