[BUGS] BUG #2044: OLEDB Driver error

2005-11-15 Thread balamuralikn

The following bug has been logged online:

Bug reference:  2044
Logged by:  balamuralikn
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.0.4
Operating system:   Win 2000
Description:OLEDB Driver error
Details: 

iam facing the following error on execution of the given c# code using
pgoledb driver 1.0.0.19

Error :
-
F:\CSharpTest\OLEDBTest>customermanager
Befor ExecuteReader
OleDb Exception System.Data.OleDb.OleDbException: No error information
availab
le: 0x80040155.
   at System.Data.OleDb.OleDbDataReader.ProcessResults(Int32 hr)
   at System.Data.OleDb.OleDbDataReader.NextResult()
   at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
beh
avior, String method)
   at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior
behavior)
   at Customer.FindByName(String strName)

Source Code:( File - CustomerManager.cs)
--
using System;
using System.Data.OleDb;
public class Customer{
string strName;
string strAddr;
String strCon = "Provider=PostgreSQL OLE DB Provider;Password=relax;User
ID=postgres; Data Source=anu;Location=test;Extended Properties=";
//  String strCon = "Provider=SQLOLEDB;User
ID=sa;pwd=;Server=anu;Database=test";

OleDbConnection con  ; 

public Customer(){
con = new OleDbConnection(strCon);
con.Open();
}
public String Name{
get {
return strName;
}
set {
strName = value;
}
}
public String Address{
get {
return strAddr;
}
set {
strAddr = value;
}
}
public void Add() {
String strInsert =  "Insert into customers (Name, Address) 
values (";
strInsert += "'" +Name +"', ";
strInsert += "'" +Address +"')";
OleDbCommand cmd = new OleDbCommand(strInsert);
cmd.Connection = con;
cmd.ExecuteNonQuery();
}

public Customer FindByName(String strName) {
try{
String strSql =  "Select * from Customers where Name =  
'"+ strName +
"'";
OleDbCommand cmd = new OleDbCommand(strSql, con);
Console.WriteLine("Befor ExecuteReader");
OleDbDataReader objReader =
cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
Console.WriteLine("Befor 'Read'");
if (objReader.Read()){
Console.WriteLine("After 'Read'");
Name = objReader.GetString(0);
Address = objReader.GetString(1);
Console.WriteLine("After 'Fetch'");
}
else{
throw new Exception("Customer not found");
}
}catch(OleDbException e){
Console.WriteLine("OleDb Exception " +e);
throw e;
}catch(Exception e){
Console.WriteLine("Application Exception " +e);
throw e;
}
return this;
}
};

public class CustomerManager{
public static void Main(String [] a){
/*  //Test for adding new customer - perfectly working with postgre 
if (a.Length > 0){
try{
Customer cust = new Customer();
cust.Name = a[0];
cust.Address = a[1];
cust.Add();
Console.WriteLine("Sucess");
}catch(Exception e){
Console.WriteLine("Error : " + e);
}
}
else{
Console.WriteLine("Invalid arguments");
} */
// Test for finding customer - not working with postgre
try{
Customer cust = new Customer() ;
cust = cust.FindByName("Murali");
Console.WriteLine("Name : " + cust.Name);
Console.WriteLine("Address : " + cust.Address);
}catch(OleDbException ex){
//  Console.WriteLine("Data Error :"+ ex.StackTrace);
}catch(Exception ex){
//  Console.WriteLine("Application Error :"+ ex.StackTrace);
}
}
};

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings

[BUGS] Double sequence increase on single insert with RULE on targeted table

2005-11-15 Thread Sarunas Krisciukaitis

Dear All,

A program produces the wrong output for any given input.
Here comes bug report:
1. Database dump is attached.
2. Input: "BEGIN; INSERT INTO test1(some_text) VALUES ('test1'); SELECT 
lastval() as id; END;"

3. Output:
INSERT 0 1
id

 3
(1 row)
4. Exspected Output:
id

 2
(1 row)
5. Environment:
ANT_HOME=/usr/share/ant-core
BASH=/bin/bash
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="3" [1]="00" [2]="16" [3]="2" [4]="release" 
[5]="i686-pc-linux-gnu")

BASH_VERSION='3.00.16(2)-release'
CLASSPATH=.
COLORTERM=gnome-terminal
COLUMNS=124
CONFIG_PROTECT='/usr/lib/mozilla/defaults/pref /usr/lib/X11/xkb 
/usr/kde/3.4/share/config /usr/kde/3.4/env /usr/kde/3.4/shutdown 
/usr/share/config'

CONFIG_PROTECT_MASK='/etc/gconf /etc/terminfo /etc/splash'
CVS_RSH=ssh
DCCC_PATH=/usr/lib/distcc/bin
DESKTOP_SESSION=default
DESKTOP_STARTUP_ID=
DIRSTACK=()
DISPLAY=:0.0
DISTCC_LOG=
DISTCC_VERBOSE=0
DM_CONTROL=/var/run/xdmctl
EDITOR=/bin/nano
EUID=1000
FLTK_DOCDIR=/usr/share/doc/fltk-1.1.6/html
GCC_SPECS=
GDK_USE_XFT=1
GROUPS=()
GS_LIB=/home/sarunas/.fonts
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/sarunas/.gtkrc-2.0:/home/sarunas/.kde3.4/share/config/gtkrc
GTK_RC_FILES=/etc/gtk/gtkrc:/home/sarunas/.gtkrc:/home/sarunas/.kde3.4/share/config/gtkrc
G_BROKEN_FILENAMES=1
HISTCONTROL=ignorespace
HISTFILE=/home/sarunas/.bash_history
HISTFILESIZE=500
HISTSIZE=500
HOME=/home/sarunas
HOSTNAME=sarunas
HOSTTYPE=i686
IFS=$' \t\n'
INFOPATH=/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.15.92.0.2/info:/usr/share/gcc-data/i686-pc-linux-gnu/3.4.4/info
JAVAC=/opt/sun-jdk-1.5.0.05/bin/javac
JAVA_HOME=/opt/sun-jdk-1.5.0.05
JDK_HOME=/opt/sun-jdk-1.5.0.05
KDEDIRS=/usr
KDE_FULL_SESSION=true
KDE_MULTIHEAD=false
KDE_NO_IPV6=1
LESS=-R
LESSOPEN='|lesspipe.sh %s'
LINES=45
LOGNAME=sarunas
MACHTYPE=i686-pc-linux-gnu
MAILCHECK=60
MANPATH=/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.15.92.0.2/man:/usr/share/gcc-data/i686-pc-linux-gnu/3.4.4/man::/opt/sun-jdk-1.5.0.05/man:/usr/qt/3/doc/man
MC_TMPDIR=/tmp/mc-sarunas
MOZILLA_FIVE_HOME=/usr/lib/mozilla
OLDPWD=/home/sarunas
OPENGL_PROFILE=xorg-x11
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PAGER=/usr/bin/less
PATH=/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.4.4:/opt/sun-jdk-1.5.0.05/bin:/opt/sun-jdk-1.5.0.05/jre/bin:/usr/qt/3/bin:/usr/kde/3.4/bin:/usr/games/bin
PERLIO=stdio
PIPESTATUS=([0]="0")
PPID=9438
PRELINK_PATH_MASK='/usr/lib/gstreamer-0.8:/opt:/lib/modules:/usr/lib/locale:/usr/lib/wine:/usr/lib/valgrind:/usr/bin/mencoder:*.la:*.png:*.py:*.pl:*.pm:*.sh:*.xml:*.xslt:*.a:*.js'
PROMPT_COMMAND='pwd>&8;kill -STOP $$'
PS1='\[\033[01;[EMAIL PROTECTED] \[\033[01;34m\]\w \$ \[\033[00m\]'
PS2='> '
PS4='+ '
PWD=/home/sarunas/Cargo2Net
PYTHONPATH=/usr/lib/portage/pym
QMAKESPEC=linux-g++
QTDIR=/usr/qt/3
SESSION_MANAGER=local/sarunas:/tmp/.ICE-unix/8550
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=3
SSH_AGENT_PID=8504
SSH_ASKPASS=/usr/bin/gtk2-ssh-askpass
SSH_AUTH_SOCK=/tmp/ssh-SGMtSU8503/agent.8503
TERM=xterm
UID=1000
USER=sarunas
WINDOWID=29373840
XCURSOR_THEME=gentoo-silver
XDG_CONFIG_DIRS=/usr/kde/3.4/etc/xdg
XDG_DATA_DIRS=/usr/kde/3.4/share:/usr/share
XDM_MANAGED=/var/run/xdmctl/xdmctl-:0,maysd,mayfn,sched,rsvd,method=classic
XINITRC=/etc/X11/xinit/xinitrc
_=/etc/profile
safe_term=xterm
use_color=true
6. Postmaster startup options:
su - postgres -c '/usr/bin/pg_ctl start -D 
'\''/var/lib/postgresql/data'\'' -s -l 
'\''/var/lib/postgresql/data/postgresql.log'\'' -o '\'''\'''

7. PostgreSQL version:
PostgreSQL 8.1.0 on i686-pc-linux-gnu, compiled by GCC 
i686-pc-linux-gnu-gcc (GCC) 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, 
pie-8.7.8)

8. Platform information:
   8.1. Kernel: 2.6.12-gentoo-r10
   8.2. GlibC: GNU C Library stable release version 2.3.5, by Roland 
McGrath et al.

Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, 
pie-8.7.8).

Compiled on a Linux 2.6.11 system on 2005-10-17.
Available extensions:
   GNU libio by Per Bothner
   crypt add-on version 2.1 by Michael Glad and others
   Native POSIX Threads Library by Ulrich Drepper et al
   The C stubs add-on version 2.1.2.
   GNU Libidn by Simon Josefsson
   BIND-8.2.3-T5B
   NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Thread-local storage support included.
For bug reporting instructions, please see:
.
   8.3. Processor: Intel(R) Pentium(R) 4 CPU 2.80GHz
   8.4. Memmory: 1024 GB
   8.5. Linux ver: Gentoo 2005.1

Sincerely,
Sarunas


--
-- PostgreSQL database dump
--

SET client_encoding = 'UTF8';
SET check_function_bodies = false;
SET client_min_messages = warning;

--
-- Name: testdb; Type: DATABASE; Sche

[BUGS] BUG #2046: defective date_trunc

2005-11-15 Thread Chris

The following bug has been logged online:

Bug reference:  2046
Logged by:  Chris
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.0
Operating system:   Windows
Description:defective date_trunc
Details: 

Postgresql 8.0

select date_trunc('week',TO_DATE('2005-01-01','-mm-dd'))


result


"2006-01-02 00:00:00+01"

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

   http://archives.postgresql.org


[BUGS] BUG #2043: Documentation is incorrect...

2005-11-15 Thread Man-Chicken

The following bug has been logged online:

Bug reference:  2043
Logged by:  Man-Chicken
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.0
Operating system:   BSD
Description:Documentation is incorrect...
Details: 

http://www.postgresql.org/docs/8.0/interactive/functions-string.html claims
that strpos() returns text... yet strpos() returns integer.

---(end of broadcast)---
TIP 1: 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


[BUGS] [postgres] pgcluster

2005-11-15 Thread Stephan Fischer
Hi,

ich bin dabei DB-Server zu einem Cluster zusammen zuführen mit
PGCLUSTER. Hat schon jemand von euch damit gearbeitet und kann mir mal
seine Meinung/Erfahrung dazu sagen (positiv oder negativ).

Werde auch meine Erfahrung noch Erfolg hier mal posten.

Server: 7.4.1 (suse9.0)
pgcluster-1.1

Grüsse aus Berlin.
Stephan.
 




Wenn Sie Ihr Abonnement fuer diese Gruppe kuendigen moechten, senden 
Sie eine E-Mail an:
[EMAIL PROTECTED]

 
Yahoo! Groups Links

<*> Besuchen Sie Ihre Group im Web unter:
http://de.groups.yahoo.com/group/postgres/

<*> Um sich von der Group abzumelden, senden Sie eine Mail an:
[EMAIL PROTECTED]

<*> Mit der Nutzung von Yahoo! Groups akzeptieren Sie unsere:
http://de.docs.yahoo.com/info/utos.html
 



---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


[BUGS] BUG #2045: test_fsync "-f" option

2005-11-15 Thread Akio Iwaasa

The following bug has been logged online:

Bug reference:  2045
Logged by:  Akio Iwaasa
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.0 , 8.1
Operating system:   RedHat EL ES 3.0
Description:test_fsync "-f" option
Details: 

Dear Sirs,

This is a bug report of fsync test tool 
(src/tools/fsync/test_fsync.c), not of 
PostgreSQL server.

This tool's "-f filename" option is ignored. 
This tool always uses FSYNC_FILENAME 
(/var/tmp/test_fsync.out) when open file.

Sincerely yours,
Akio Iwaasa

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [BUGS] BUG #2046: defective date_trunc

2005-11-15 Thread Alvaro Herrera
Chris wrote:

> Postgresql 8.0
> 
> select date_trunc('week',TO_DATE('2005-01-01','-mm-dd'))

Upgrade to 8.0.4.  This bug is fixed there.

alvherre=# select date_trunc('week',TO_DATE('2005-01-01','-mm-dd'));
   date_trunc   

 2004-12-27 00:00:00-03
(1 fila)

alvherre=# select version();
version 
   
---
 PostgreSQL 8.0.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.0.2 
20050806 (prerelease) (Debian 4.0.1-4)
(1 fila)

alvherre=# 

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [BUGS] BUG #2045: test_fsync "-f" option

2005-11-15 Thread Bruce Momjian
Akio Iwaasa wrote:
> 
> The following bug has been logged online:
> 
> Bug reference:  2045
> Logged by:  Akio Iwaasa
> Email address:  [EMAIL PROTECTED]
> PostgreSQL version: 8.0 , 8.1
> Operating system:   RedHat EL ES 3.0
> Description:test_fsync "-f" option
> Details: 
> 
> Dear Sirs,
> 
> This is a bug report of fsync test tool 
> (src/tools/fsync/test_fsync.c), not of 
> PostgreSQL server.
> 
> This tool's "-f filename" option is ignored. 
> This tool always uses FSYNC_FILENAME 
> (/var/tmp/test_fsync.out) when open file.

Fixed in 8.1.X and CVS HEAD.  Thanks for the report.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  pgman@candle.pha.pa.us   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [BUGS] BUG #2046: defective date_trunc

2005-11-15 Thread Bruce Momjian
Chris wrote:
> 
> The following bug has been logged online:
> 
> Bug reference:  2046
> Logged by:  Chris
> Email address:  [EMAIL PROTECTED]
> PostgreSQL version: 8.0
> Operating system:   Windows
> Description:defective date_trunc
> Details: 
> 
> Postgresql 8.0
> 
> select date_trunc('week',TO_DATE('2005-01-01','-mm-dd'))
> 
> 
> result
> 
> 
> "2006-01-02 00:00:00+01"

Are you on 8.0.4?  If not, you need to upgrade because we fixed this.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  pgman@candle.pha.pa.us   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [BUGS] BUG #2043: Documentation is incorrect...

2005-11-15 Thread Bruce Momjian
Man-Chicken wrote:
> 
> The following bug has been logged online:
> 
> Bug reference:  2043
> Logged by:  Man-Chicken
> Email address:  [EMAIL PROTECTED]
> PostgreSQL version: 8.0
> Operating system:   BSD
> Description:Documentation is incorrect...
> Details: 
> 
> http://www.postgresql.org/docs/8.0/interactive/functions-string.html claims
> that strpos() returns text... yet strpos() returns integer.

Thanks.  I have patched the fix back to release 7.3.X.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  pgman@candle.pha.pa.us   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 1: 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] Double sequence increase on single insert with RULE on targeted table

2005-11-15 Thread Tomas Zerolo
On Tue, Nov 15, 2005 at 11:39:37AM +0200, Sarunas Krisciukaitis wrote:
> Dear All,
> 
> A program produces the wrong output for any given input.
> Here comes bug report:
> 1. Database dump is attached.
> 2. Input: "BEGIN; INSERT INTO test1(some_text) VALUES ('test1'); SELECT 
> lastval() as id; END;"
> 3. Output:
> INSERT 0 1
> id
> 
>  3
> (1 row)
> 4. Exspected Output:
> id
> 
>  2
> (1 row)
[snip]

AFAIK, serials are not guaranteed to produce sequential values; tehy
will produce unique values. That means that they can (and sometimes
will) jump.

Think about it: how could a database achieve that when the rollback of
an ongoing transaction is always possible?

Regards
-- tomas


signature.asc
Description: Digital signature


Re: [BUGS] Double sequence increase on single insert with RULE on targeted table

2005-11-15 Thread Michael Fuhr
On Wed, Nov 16, 2005 at 06:29:40AM +0100, Tomas Zerolo wrote:
> AFAIK, serials are not guaranteed to produce sequential values; tehy
> will produce unique values. That means that they can (and sometimes
> will) jump.

In this particular case, however, the behavior is due to the rule
on test1:

CREATE RULE test1_on_insert AS ON INSERT TO test1
  DO INSERT INTO test_log1 (qid) VALUES (new.id);

This "gotcha" comes up occasionally; it's due to the fact that rules
are macros.  Search the archives for past discussion.

-- 
Michael Fuhr

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [BUGS] Double sequence increase on single insert with RULE on targeted table

2005-11-15 Thread Tomas Zerolo
On Tue, Nov 15, 2005 at 10:51:10PM -0700, Michael Fuhr wrote:
> On Wed, Nov 16, 2005 at 06:29:40AM +0100, Tomas Zerolo wrote:
> > AFAIK, serials are not guaranteed to produce sequential values; tehy
> > will produce unique values. That means that they can (and sometimes
> > will) jump.
> 
> In this particular case, however, the behavior is due to the rule
> on test1:
> 
> CREATE RULE test1_on_insert AS ON INSERT TO test1
>   DO INSERT INTO test_log1 (qid) VALUES (new.id);

[...]

Oops, I didn't see that. Your eyes are sharper than mine ;-)

thanks
-- tomas


signature.asc
Description: Digital signature