Re: [GENERAL] strange stable function behavior

2006-06-01 Thread Dan Black
Thank you very much. It works!!!Where can I read about such features? 2006/6/1, Martijn van Oosterhout <kleptog@svana.org>: On Thu, Jun 01, 2006 at 03:09:47PM +0400, Dan Black wrote:> Hi> I have a stable function test.test_stable> But if I want to display field sid twice>> SEL

[GENERAL] strange stable function behavior

2006-06-01 Thread Dan Black
HiI have a stable function test.test_stableCREATE OR REPLACE FUNCTION test.test_stable(int4)  RETURNS int4 AS$BODY$DECLARE  _param ALIAS FOR $1;BEGIN  RAISE NOTICE 'ID: %, TIME: %', _param, timeofday()::timestamp;   RETURN _param;END$BODY$  LANGUAGE 'plpgsql' STABLE STRICT SECURITY DEFINER;Everythi

Re: [GENERAL] Charset conversion error

2006-05-30 Thread Dan Black
> > > 2006/5/30, Tatsuo Ishii <[EMAIL PROTECTED] >:> > > > > >> > > > > > > Hi, I have an error after updating my database up to 8.1.4version.> > > > > > > "SQL Error: ERROR:  character 0xb9 of encoding "WIN1251

Re: [GENERAL] Charset conversion error

2006-05-29 Thread Dan Black
tuation?> >> > It suggests that Windows-1251's 0xb9 cannot be converted to KOI8. You> > should check your Windows-1251 data. > > --> > Tatsuo Ishii> > SRA OSS, Inc. Japan> >>>>> --> Verba volent, scripta manent> Dan Black -- Verba volent, scripta manentDan Black

Re: [GENERAL] Charset conversion error

2006-05-29 Thread Dan Black
I think you are right. But everything was alright before I updated my database.So there are a lot of "incorrect" values in tables. And errors appear when I execute "SELECT * FROM table". 2006/5/30, Tatsuo Ishii <[EMAIL PROTECTED]>: > Hi, I have an error after updating my database up to 8.1.4 versi

[GENERAL] Charset conversion error

2006-05-29 Thread Dan Black
Hi, I have an error after updating my database up to 8.1.4 version."SQL Error: ERROR:  character 0xb9 of encoding "WIN1251" has no equivalent in "MULE_INTERNAL"'. "My client program encoding is windows-1251 and database encoding is koi8. What can I do to rectify the situation?Verba volent, scripta

[GENERAL] Ответ: how can i view deleted records?

2006-04-30 Thread Dan Black
Thanks. I thought that there are some standard utilities or sql request in postgres to view deleted or modified tuples. 2006/4/30, Steve Atkins <[EMAIL PROTECTED]>: On Apr 29, 2006, at 4:18 PM, Robby Russell wrote: > > On Apr 29, 2006, at 12:49 PM, Dan

[GENERAL] how can i view deleted records?

2006-04-29 Thread Dan Black
Hello, everybody! How can I view deleted records in table? -- Verba volent, scripta manent Dan Black ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Index does not working.

2005-06-13 Thread Dan Black
  (cost=0.00..369.00 rows=2500 width=56)   Index Cond: ((deleted = true) AND (active = true))   2005/6/13, Douglas McNaught <[EMAIL PROTECTED]>: Dan Black <[EMAIL PROTECTED]> writes:> First query does not use index in contrast to two query.>> Why?You don't give enough informat

[GENERAL] Index does not working.

2005-06-13 Thread Dan Black
I created a table CREATE TABLE my_table (   id int4 NOT NULL,   name varchar(64) NOT NULL,   deleted bool NOT NULL,   active bool NOT NULL,   CONSTRAINT my_table_pkey PRIMARY KEY (id) ) and  index CREATE INDEX my_table_index   ON my_table   USING btree   (deleted, active); there is two identi

Re: [GENERAL] Reliably finding temporary table

2005-06-10 Thread Dan Black
Help! I have a similar problem. Does anybody know how to solve a problem2005/6/8, Ian Burrell <[EMAIL PROTECTED]>: We have some functions which need to dynamically create a temporarytable if it does not already exist.  We use the following function:CREATE OR REPLACE FUNCTION test_date_time_exists()

Re: [GENERAL] Foreign keys and slow insert

2005-06-08 Thread Dan Black
I think 21 interns will be enough :)2005/6/8, Scott Marlowe <[EMAIL PROTECTED]>: On Wed, 2005-06-08 at 12:39, Dan Black wrote:> I've observed that inserts into slave table became slower when I use> foreign key than without one.> Can it be related to foreign key?> And I

Re: [GENERAL] Foreign keys and slow insert

2005-06-08 Thread Dan Black
I've observed that inserts into slave table became slower when I use foreign key than without one. Can it be related to foreign key? And I am interested how much  performance of database with foreign keys can be different from performance of database without foreign keys? In other words, how much

[GENERAL] Foreign keys and slow insert

2005-06-08 Thread Dan Black
I read in documentation  that primary key doesn't require additional indexes but I could find nothing about foreign keys. Do I need to create additional indexes when I create foreign keys? Example: create table master {   master_id INT4,   master_name VARCHAR(64),   CONSTRAINT master_pkey PRIMARY K

Re: [GENERAL] Missing numbers

2005-06-01 Thread Dan Black
you can also try this =) select   o1.doc_numero+1 as first,   ((select doc_numero from bdocs where id > o1.doc_numero+1 order by doc_numero limit 1))-1 as last from bdocs as o1 where o1.doc_numero+1 not in (select o2.doc_numero from bdocs as o2) order by doc_numero2005/5/31, josue <[EMAIL PR

Re: [GENERAL] filling database

2005-05-20 Thread Dan Black
EMS PostgreSQL Data Generator http://sqlmanager.net/products/postgresql/datagenerator And you can write you own pgplsql function that fill you database with any random data. I think it would be better and cheaper =) 2005/5/20, [EMAIL PROTECTED] <[EMAIL PROTECTED] >:hi,Does anyone know of a tool

Re: [GENERAL] Problem in creating a table

2005-05-17 Thread Dan Black
Try this CREATE TABLE test.TD_ACCESSCOUNT(    AC_YEAR NUMERIC(4,0)    NOT NULL,    AC_MONTH    NUMERIC(2,0)    NOT NULL,    AC_DAYS NUMERIC(2,0)    NOT NULL,    OFFICE_ID   VARCHAR(7)    NOT NULL,    AC_COUNT    NUMERIC(6,0)   DEFAULT 0,    PRIMARY KEY(AC_YEAR,AC_MONTH,A

[GENERAL] Table and index size

2005-05-12 Thread Dan Black
How can i calculate table and index size on hard disk?