Re: [BUGS] [GENERAL] Should SERIAL column have MAXVAL set on sequence

2007-07-24 Thread Jim Nasby

Moving to -bugs.

On Jul 23, 2007, at 9:02 AM, Woody Woodring wrote:
I have a table in our DB that functions as a queue with a SERIAL  
column for

its primary key.  At 4am this weekend I started getting the error:

ERROR:  integer out of range

Which was attributed to the sequence incrementing past the size of  
the int4

serial column after several years of operation.

I was able to set the sequence back to 1 and everything was happy.

I was wondering if the SERIAL column should set the  
MAXVAL=2147483647 when

it creates the sequence?

I ended up fixing my queue table with the following to avoid the  
issue in

the future:

ALTER SEQUENCE transfer_transferid_seq MAXVALUE 2147483647 CYCLE;


I can confirm this is still the case in HEAD:

decibel=# select max_value from s_s_seq ;
  max_value
-
9223372036854775807
(1 row)

This does seem like a bug...
--
Jim Nasby[EMAIL PROTECTED]
EnterpriseDB  http://enterprisedb.com  512.569.9461 (cell)



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

  http://archives.postgresql.org


[BUGS] Autovacuum vacuums not setting start time in pg_stat_activity

2007-06-12 Thread Jim Nasby
This is on a 8.2.3 database; vacuums started by autovacuum don't get  
their query_start time set.


select * from pg_stat_activity where current_query like 'VACUUM%';
-[ RECORD 1 ]-+-
datid | 16384
datname   | emma2
procpid   | 8674
usesysid  | 10
usename   | postgres
current_query | VACUUM public.userdata_2409_messages_history
waiting   | f
query_start   |
backend_start | 2007-06-12 15:29:53.376641-05
client_addr   |
client_port   |

--
Jim Nasby   [EMAIL PROTECTED]
EnterpriseDB  http://enterprisedb.com  512.569.9461 (cell)




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

  http://archives.postgresql.org


Re: [BUGS] BUG #2802: Feature request: tinyint and unsigned types

2006-12-08 Thread Jim Nasby

On Dec 4, 2006, at 4:11 PM, Bruno Wolff III wrote:
You can already use "char" to store 1 byte values, though unless  
there are
several of these in a row, you won't save any space because of  
alignment.


There's also boolean...

Is there any technical reason why we don't support unsigned ints or  
tinyint? Just a matter of no one feeling the itch?

--
Jim Nasby[EMAIL PROTECTED]
EnterpriseDB  http://enterprisedb.com  512.569.9461 (cell)



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

  http://archives.postgresql.org


Re: [BUGS] BUG #2661: select time with time zone not converting

2006-10-05 Thread Jim Nasby

On Sep 28, 2006, at 3:54 PM, Harry Hehl wrote:

Bug reference:  2661
Logged by:  Harry Hehl
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.1.3
Operating system:   Linux
Description:select time with time zone not converting
Details:

The "select timestamp with time zone" is working as expected  
converting the

timestamp to the local time zone.

"select time with time zone" returns the same timezone.

Example:

CREATE TABLE test
(
   mytime  TIME (6) WITH TIME ZONE,
   mytimestamp  TIMESTAMP (6) WITH TIME ZONE
);

SET time zone -5;

INSERT INTO test VALUES ('00:00:00', '2006-02-01 00:00:00');

select * from test where mytimestamp = timestamp with time zone  
'2006-02-01

05:00:00-00';

-- returns inserted row.

select * from test where mytime = time with time zone '05:00:00-00';

-- nothing returned.


select timestamp with time zone '2006-02-01 05:00:00-00';

--  timestamptz

-- 2006-02-01 00:00:00-05
--(1 row)

select time with time zone '05:00:00-00';
--   timetz
-
-- 05:00:00+00 This should be '00:00:00-05'
--(1 row)


Confirmed in 8.1.4 and HEAD, though I'm not sure what date it's from  
since I'm on a plane right now (is there any way to get that info out  
of the local repository?)

--
Jim Nasby[EMAIL PROTECTED]
EnterpriseDB  http://enterprisedb.com  512.569.9461 (cell)



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

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


Re: [BUGS] Transactions from Visual C++

2006-08-26 Thread Jim Nasby
On Aug 23, 2006, at 7:31 AM, <[EMAIL PROTECTED]>  
<[EMAIL PROTECTED]> wrote:

Let us assume that the second statement fails because value 'b' is
illegal.
Either the ODBC driver or the DBMS now rejects all follow-on queries
with the error message:
Error while executing the query;
ERROR:  current transaction is aborted, commands ignored until
end of transaction block

I would have expected that it would still be possible to run queries
inside this transaction (in fact, the same code continues to run in
Sybase and MSSQL Server).
Otherwise it is not possible to write your own transaction logic or  
your

own error handling in this environment.


Why continue to run commands if you're just going to roll them back?

In any case, I fail to see how this makes it impossible to control  
transactions. Perhaps you need to look into savepoints?

--
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461



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

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


Re: [BUGS] Website issue

2006-08-26 Thread Jim Nasby

On Aug 18, 2006, at 11:02 AM, Joel Stevenson wrote:
Is this the correct list to report issues with the  
www.postgresql.org website and it's related sites?  If not, I  
apologize, could someone point me in the right direction?


-www would be better...

There seems to be a problem with list archive searching, the result  
set item links do not always point to the actual message that is  
indicated in the list page.


I believe this has been fixed.

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

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


Re: [BUGS] referential integrity violation - key referenced from

2006-08-22 Thread Jim Nasby

On Aug 15, 2006, at 8:50 AM, Luiz Henrique wrote:
my problem was problably corrupted index files. I recreated the  
index and it's ok now. The hardware was being unpluged from power  
source without shuthing down, I guess that's the cause.


What version are you using? In recent versions, indexes are supposed  
to be safe from corruption, even through crashes.

--
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461



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

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


Re: [BUGS] BUG #2558: initDB failed to run

2006-08-09 Thread Jim Nasby



Please cc the list 
so others can learn.
 
Yes, I think a 
patch for this was recently committed. I know it was at least discussed 
somewhere...

  -Original Message-From: dror 
  [mailto:[EMAIL PROTECTED]Sent: Wednesday, August 09, 2006 2:17 
  AMTo: Jim NasbySubject: RE: [BUGS] BUG #2558: initDB 
  failed to runHi Jim,I have already solved the 
  problem, as it is mentioned before, the problem was that on some windows 2003 
  machine there is no access to the nul device for non administrators 
  users.The initDB.c redirect the output to > DEVNUL which 
  on windows defined has "nul".I changed the initDB source by canceling the redirection.I think 
  this is the easiest way.I could also solve it by open a file , give W 
  permission to the user to this file and redirect the output to that 
  file.  I think postgres must solve this issue, as more 
  and more windows 2003 machine will be discovered with this limitation which 
  prevent from the users to install the DB.Attached you can find the fixed 
  initDB.c fileRegardsDror
  
  > CC: pgsql-bugs@postgresql.org> From: 
  [EMAIL PROTECTED]> Subject: Re: [BUGS] BUG #2558: initDB failed to 
  run> Date: Tue, 8 Aug 2006 12:30:56 -0500> To: 
  [EMAIL PROTECTED]> > 
  Does V_MYUSER have access to the PGDATA directory? This might be an  > 
  issue of it not having access to the directory you're running initdb  > 
  from...> > 
  On Aug 1, 2006, at 12:57 PM, Dror wrote:> 
  > The following bug has been logged online:> 
  >> 
  > Bug reference:  2558> 
  > Logged by:  Dror> 
  > Email address:  [EMAIL PROTECTED]> 
  > PostgreSQL version: 8.1.4> 
  > Operating system:   win 2003> 
  > Description:initDB failed to run> 
  > Details:> >> 
  > On one of mine win 2003 machine ( on any other win2003 machine  > 
  > everything> 
  > work as expected), I failed to install postgress in service mode  > 
  > using the> 
  > MSI package , after short investigation i found a failure in the  > 
  > initDB> 
  > phase, so I install postgress without running the initDB and then  > 
  > ran the> 
  > initDB manually with the debug option set, (The user is not an> 
  > Administrator).> 
  > The strange thing is that EnterpriseDB which is based on postgres  > 
  > works> > fine.> 
  > The problem seems to be in the initDB.c source file in the> 
  > test_connections(void) and test_buffers(void) functions.> 
  > Here is the procedures and the output of the initDB.> 
  >> 
  > After the installation I did:> 
  >> > - Runas /user:V_MYUSER CMD> 
  >> 
  > - initDB -D "E:\Postgres\Data" -d -U V_MYUSER> 
  >> > Running in debug mode.> 
  > The files belonging to this database system will be owned by user> 
  > "V_MYUSER".> 
  > This user must also own the server process.> 
  >> 
  > The database cluster will be initialized with locale English_United> 
  > States.1252.> >> 
  > fixing permissions on existing directory E:/Postgres\Data ... ok> 
  > creating directory E:/Postgres\Data/global ... ok> 
  > creating directory E:/Postgres\Data/pg_xlog ... ok> 
  > creating directory E:/Postgres\Data/pg_xlog/archive_status ... ok> 
  > creating directory E:/Postgres\Data/pg_clog ... ok> 
  > creating directory E:/Postgres\Data/pg_subtrans ... ok> 
  > creating directory E:/Postgres\Data/pg_twophase ... ok> 
  > creating directory E:/Postgres\Data/pg_multixact/members ... ok> 
  > creating directory E:/Postgres\Data/pg_multixact/offsets ... ok> 
  > creating directory E:/Postgres\Data/base ... ok> 
  > creating directory E:/Postgres\Data/base/1 ... ok> 
  > creating directory E:/Postgres\Data/pg_tblspc ... ok> 
  > selecting default max_connections ... Access is denied.> 
  > Access is denied.> 
  > Access is denied.> 
  > Access is denied.> 
  > Access is denied.> 
  > Access is denied.> > 10> 
  > selecting default shared_buffers ... Access is denied.> 
  > Access is denied.> 
  > Access is denied.> 
  > Access is denied.> 
  > Access is denied.> 
  > Access is denied.> 
  > Access is denied.> 
  > Access is denied.> 
  > Access is denied.> 
  > Access is denied.> 
  > Access is denied.> > 50> 
  > creating configuration files ... ok> 
  > creating template1 database in E:/Postgres\Data/base/1 ...  > 
  > VERSION=8.1.4> > PGDATA=E:/Postgres\Data> 
  > share_path=E:/Program Files/postgres/Database/share> 
  > PGPATH=E:/Program Files/postgres/Database/bin> 
  > POSTGRES_SUPERUSERNAME=V_MYUSER> 
  > POSTGRES_BKI=E:/Program Files/postgres/Database/share/postgres.bki> 
  > POSTGRES_DESCR=E:/Program> 
  > Files/postgres/Database/share/postgres.description> 
  > POSTGRESQL_CONF_SAMPLE=E:/Program> 
  > Files/postgres/Database/share/postgresql.conf.sample> 
  > PG_HBA_SAMPLE=E:/Program Files/postgres/Database/share/ > 
  > pg_hba.conf.sample> 
  > PG_IDENT_SAMPLE=E:/Program> 
  > Files/postgres/Database/share/pg_ident.conf.sample> 
  > DEBUG:  TZ "Asia/Jerusalem" matches Windows timezone "Jerusalem  > 
  > Standard> > Time"> 
  > DEBUG:  invoking IpcMemoryCreate(size=132

Re: [BUGS] BUG #2530: Some columns not visible when select from table (via odbc only)

2006-08-08 Thread Jim Nasby

Have you tried with another client and ODBC driver?

On Jul 13, 2006, at 2:02 PM, Dusan Halicky wrote:

The following bug has been logged online:

Bug reference:  2530
Logged by:  Dusan Halicky
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.1.4-1
Operating system:   Windows XP
Description:Some columns not visible when select from table  
(via

odbc only)
Details:

I create this table:

create table foo (aaa serial, bbb integer, ccc char(20));

insert into foo values (1, 24, 'John');

And when i make select (in SQL Explorer which use ODBC), there is  
only first

2 columns:

select * from foo;

aaa bbb
1   24

The same select in psql give me correct results:

aaa bbb ccc
1   24  John

The odbc is psqlODBC 08.02.0002, advanced options in odbc  
administrator

(screenshots) is stored here:

http://senzory.ahoj.sk/pg/index.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



--
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461



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

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


Re: [BUGS] BUG #2522: while executing pgdump - error occurs

2006-08-08 Thread Jim Nasby
This may have been fixed in a later version of 7.4. In any case,  
you're exposing yourself to data loss bugs; you need to upgrade to  
the latest 7.4 immediately.


On Jul 10, 2006, at 10:15 AM, Sudhakar wrote:

The following bug has been logged online:

Bug reference:  2522
Logged by:  Sudhakar
Email address:  [EMAIL PROTECTED]
PostgreSQL version: psql 7.4.2
Operating system:   SUSE LINUX Enterprise Server 9 (i586)
Description:while executing pgdump - error occurs
Details:

HI,

 The following is the error while executing pgdump command.
magellan_154_db_postgres_10july2006_1149amist.sql
pg_dump: ERROR:  invalid memory alloc request size 4294967293
pg_dump: SQL command to dump the contents of table "ctblankcall"  
failed:

PQendcopy() failed.
pg_dump: Error message from server: ERROR:  invalid memory alloc  
request

size 4294967293
pg_dump: The command was: COPY public.ctblankcall (ctblcaseid, ctiplc,
ctacdlogin, ctcustomername, cttelephone, ctcallstatus, ctreason,
ctcreatedon, ctcreatedby, ctupdatedon, ctupdatedby, ctdeletestatus) TO
stdout;

Can anybody help me out to solve the issue
Thanks In Advance
Regards
Sudakar Srinivasan

---(end of  
broadcast)---

TIP 5: don't forget to increase your free space map settings



--
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461



---(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 #2552: wrong sql dump?

2006-08-08 Thread Jim Nasby
Try using pg_dump from 8.1.4, which is the recommended procedure for  
upgrading. You might have to go to an intermediate version first,  
such as 7.4.13.


On Jul 26, 2006, at 11:15 AM, Boris wrote:



The following bug has been logged online:

Bug reference:  2552
Logged by:  Boris
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.1.4
Operating system:   win 2000
Description:wrong sql dump?
Details:

Hi!

data base lives from pg7.2
before upgrade to 8.1.2 I used pgdump from 7.2
then I go to pg 8.1.4 and pgAdmin III 1.4.3 (Jul 19 2006)

The sequence for primry key (PK) of some (not all) was missed and  
PK become

wrong - allways 0.

I export all base as sql script (1).

When I import this script I see no sequences for sope PK.

I see no commands to create sequences in this (1)sql script.

ForEx: table "auth"."access_policy_list" has a PK but no sequence is
created.

See sql dump here http://www.bdr.kiev.ua/tmpboris/bdr_v0_plain.zip

ICQ 176869864 for any more info, please. :)

---(end of  
broadcast)---

TIP 4: Have you searched our list archives?

   http://archives.postgresql.org



--
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461



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

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


Re: [BUGS] BUG #2558: initDB failed to run

2006-08-08 Thread Jim Nasby
Does V_MYUSER have access to the PGDATA directory? This might be an  
issue of it not having access to the directory you're running initdb  
from...


On Aug 1, 2006, at 12:57 PM, Dror wrote:

The following bug has been logged online:

Bug reference:  2558
Logged by:  Dror
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.1.4
Operating system:   win 2003
Description:initDB failed to run
Details:

On one of mine win 2003 machine ( on any other win2003 machine  
everything
work as expected), I failed to install postgress in service mode  
using the
MSI package , after short investigation i found a failure in the  
initDB
phase, so I install postgress without running the initDB and then  
ran the

initDB manually with the debug option set, (The user is not an
Administrator).
The strange thing is that EnterpriseDB which is based on postgres  
works

fine.
The problem seems to be in the initDB.c source file in the
test_connections(void) and test_buffers(void) functions.
Here is the procedures and the output of the initDB.

After the installation I did:

- Runas /user:V_MYUSER CMD

- initDB -D "E:\Postgres\Data" -d -U V_MYUSER

Running in debug mode.
The files belonging to this database system will be owned by user
"V_MYUSER".
This user must also own the server process.

The database cluster will be initialized with locale English_United
States.1252.

fixing permissions on existing directory E:/Postgres\Data ... ok
creating directory E:/Postgres\Data/global ... ok
creating directory E:/Postgres\Data/pg_xlog ... ok
creating directory E:/Postgres\Data/pg_xlog/archive_status ... ok
creating directory E:/Postgres\Data/pg_clog ... ok
creating directory E:/Postgres\Data/pg_subtrans ... ok
creating directory E:/Postgres\Data/pg_twophase ... ok
creating directory E:/Postgres\Data/pg_multixact/members ... ok
creating directory E:/Postgres\Data/pg_multixact/offsets ... ok
creating directory E:/Postgres\Data/base ... ok
creating directory E:/Postgres\Data/base/1 ... ok
creating directory E:/Postgres\Data/pg_tblspc ... ok
selecting default max_connections ... Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
10
selecting default shared_buffers ... Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
Access is denied.
50
creating configuration files ... ok
creating template1 database in E:/Postgres\Data/base/1 ...  
VERSION=8.1.4

PGDATA=E:/Postgres\Data
share_path=E:/Program Files/postgres/Database/share
PGPATH=E:/Program Files/postgres/Database/bin
POSTGRES_SUPERUSERNAME=V_MYUSER
POSTGRES_BKI=E:/Program Files/postgres/Database/share/postgres.bki
POSTGRES_DESCR=E:/Program
Files/postgres/Database/share/postgres.description
POSTGRESQL_CONF_SAMPLE=E:/Program
Files/postgres/Database/share/postgresql.conf.sample
PG_HBA_SAMPLE=E:/Program Files/postgres/Database/share/ 
pg_hba.conf.sample

PG_IDENT_SAMPLE=E:/Program
Files/postgres/Database/share/pg_ident.conf.sample
DEBUG:  TZ "Asia/Jerusalem" matches Windows timezone "Jerusalem  
Standard

Time"
DEBUG:  invoking IpcMemoryCreate(size=1327104)
LOG:  database system was shut down at 2006-08-01 14:36:37 Jerusalem
Standard Time
LOG:  checkpoint record is at 0/20
LOG:  redo record is at 0/20; undo record is at 0/20; shutdown TRUE
LOG:  next transaction ID: 3; next OID: 1
LOG:  next MultiXactId: 1; next MultiXactOffset: 0
LOG:  database system is ready
DEBUG:  StartTransaction
DEBUG:  name: unnamed; blockState:   DEFAULT; state: INPROGR,
xid/subid/cid: 1/1/0, nestlvl: 1, children: <>
DEBUG:  start transaction
DEBUG:  creating bootstrap relation pg_proc 1255
DEBUG:  column proname name



Regards
DROR

---(end of  
broadcast)---

TIP 4: Have you searched our list archives?

   http://archives.postgresql.org



--
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461



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


Re: [BUGS] BUG #2556: ODBC driver version 2.00 doesn't publish functions correctly

2006-08-08 Thread Jim Nasby
Have you tried with a different client? In any case, you'll probably  
get more help on pgsql-odbc.


On Jul 29, 2006, at 3:44 PM, Jon Watte wrote:

The following bug has been logged online:

Bug reference:  2556
Logged by:  Jon Watte
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 7.3
Operating system:   Linux 2.4
Description:ODBC driver version 2.00 doesn't publish functions
correctly
Details:

Define a function using pgAdmin III. Let's say we call it "next_id 
()" and

it's defined as "select max(id)+1 as next from sometable;".

In Data Sources view in Visual Studio 2005, "configure dataset" on  
a dataset

that connects to this database.

Notice that the function doesn't show up under "functions" but it  
does show

up under "stored procedures".

Check the stored procedure checkbox for the "next_id" function, to  
include

it in your data set view.

You will get an error from visual studio saying that the "next_id"  
stored

procedure wasn't actually found.

It seems to me as if the ODBC driver has some confusion as to  
whether it's a
function or a stored procedure, and this confusion means that  
Visual Studio

can't use it.

---(end of  
broadcast)---

TIP 4: Have you searched our list archives?

   http://archives.postgresql.org



--
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461



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

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


Re: [BUGS] Fwd: Strange behaviour of RULE (selecting last inserted ID of 'sequenced' column)

2006-08-08 Thread Jim Nasby
More of a gotcha than a bug... basically, your select rule is hitting  
the sequence again. I think there's a section in the rules chapter  
that talks about this. GeneralBits might also have info.


Probably a better question is, what are you trying to do?

On Aug 4, 2006, at 4:50 AM, Nikolay Samokhvalov wrote:


I still think that this is quite strange behaviour. When I write
'...SELECT NEW.id...' I don't expect that another calling of column's
default expr will take place. I just want to have access to "id"
column of just-created row.

Any thoughts?

-- Forwarded message --
From: Nikolay Samokhvalov <[EMAIL PROTECTED]>
Date: Jul 13, 2006 6:15 PM
Subject: Strange behaviour of RULE (selecting last inserted ID of
'sequenced' column)
To: PostgreSQL-general 


Is this a bug?

test=> create sequence strange_seq;
CREATE SEQUENCE
test=> create table strange(id integer not null default
nextval('strange_seq') primary key, data text);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
"strange_pkey" for table "strange"
CREATE TABLE
test=> create rule strange_rule as on insert to strange do select  
new.id as id;

CREATE RULE
test=> insert into strange(data) values('adas');
id

 2
(1 row)

test=> select * from strange;
id | data
+--
 1 | adas
(1 row)

test=> insert into strange(data) values('adas');
id

 4
(1 row)

test=> insert into strange(data) values('adas');
id

 6
(1 row)

test=> select * from strange;
id | data
+--
 1 | adas
 3 | adas
 5 | adas
(3 rows)


--
Best regards,
Nikolay


--
Best regards,
Nikolay

---(end of  
broadcast)---

TIP 5: don't forget to increase your free space map settings



--
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461



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

  http://archives.postgresql.org


Re: [BUGS] BUG #2555: runtime error 80040e21

2006-08-08 Thread Jim Nasby
I don't know VB very well, but I'm guessing that you can't update a  
recordset that's the product of a SELECT. In any case, it's certainly  
not a PostgreSQL bug. If you need more help, try pgsql-general.


On Jul 28, 2006, at 11:54 PM, Jonas Bruhn wrote:

The following bug has been logged online:

Bug reference:  2555
Logged by:  Jonas Bruhn
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.1.4
Operating system:   Windows 2000 Pro
Description:runtime error 80040e21
Details:

I'm using VB6, and trying to update a table. It is all happening on  
my home
pc with IIS running too. I can download the table to a datagrid,  
bit I can't
type any text i a textbox and update it whith out the error  
occuring. Here

is the code and some remarks afterwards:

Private Sub command2_click()

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

Set cn = New ADODB.Connection

cn.Open "Provider=PostgreSQL.1;Password=***;User ID=postgres;Data
Source=localhost;Location=***" ';Extended Properties="""

Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "select tilbudspris, materialer from efterkalk", cn,
adOpenKeyset, adLockOptimistic

rs.AddNew
debug here ---  rs("tilbudspris").Value = Text1.Text
rs("materialer").Value = Text2.Text
rs.Update

Set rs.ActiveConnection = Nothing
Set rs = Nothing
cn.Close
Set cn = Nothing

End Sub

Remarks:
The columns in the table is set to text.
I've tried to write rs!tilbudspris and rs!materialer.
I've tried to trim(text1.text)
I've tried adopenstatic
I've tried rs.movefirst

I can't recognise where the problem should be, if it isn't a bug.

Best regards

Jonas Bruhn

---(end of  
broadcast)---

TIP 3: Have you checked our extensive FAQ?

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



--
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461



---(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] pg_restore

2006-08-08 Thread Jim Nasby

On Aug 1, 2006, at 7:24 AM, Jan Cruz wrote:

I am having problem with pg_restore 8.1.4

pg_restore: [custom archiver] out of memory
pg_restore: *** aborted because of error


Is that the only output you get?

What's maintenance_work_mem set to, and how much memory and swap do  
you have? Is the machine swapping when this happens?

--
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461



---(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] BUG #2492: "unexpected EOF on client connection" message in log

2006-06-27 Thread Jim Nasby
On Jun 23, 2006, at 1:14 AM, "" <[EMAIL PROTECTED]>  
<[EMAIL PROTECTED]> wrote:
I make all connections and manipulations with tables by file with  
commands.

ex: file contain many "INSERT" or several "ANALYZE ".
then I do: cat  | psql base -U postgres.
Then past some time I see often message "unexpected EOF on client
connection".


I believe that means that the file ended in the middle of a command  
(or the pipe broke, though that's rather unlikely).

--
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461



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


Re: [BUGS] BUG #2491: Database crash and restart

2006-06-27 Thread Jim Nasby
Without a core dump or a repeatable test case, there's not really  
anything we can do to help you here.


On Jun 23, 2006, at 12:42 AM, "" <[EMAIL PROTECTED]>  
<[EMAIL PROTECTED]> wrote:




The following bug has been logged online:

Bug reference:  2491
Logged by:
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.1.4
Operating system:   Debian sid unstable
Description:Database crash and restart
Details:

Situation:
I have running transaction which makes a frequently calls to a pl/ 
pgSQL
functions via several triggers. All in one transaction. Transaction  
running
for a 30 sec - 1 min time longs. Then I have a file with this  
functions.

CREATE OR REPLACE FUNCTION 
I made this: cat  | psql  -U postgres

SQL server crashed.
When no transaction active, all fine.
I can not wait a transaction to finish, because it may begin again
immediately, and again, and again. Untill "system" decided to make  
some

waiting for a some event.

---(end of  
broadcast)---

TIP 4: Have you searched our list archives?

   http://archives.postgresql.org



--
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461



---(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] BUG #2372: dblink_exec doesn't return. NEVER!

2006-04-06 Thread Jim Nasby

On Apr 5, 2006, at 7:28 AM, William Leite Araújo wrote:


On 4/3/06, Tom Lane <[EMAIL PROTECTED]> wrote:
(...)
You need to read up on SECURITY DEFINER functions.

regards, tom lane


  Ok, I'll do this way, but still don't understand why it doesn't  
returns.
   I'm doing things simillar to this to create users automatically,  
and works fine...


As Tom mentioned, it's probably an issue of waiting on a lock that it  
can't acquire. Just because it worked for creating users doesn't mean  
it's a good idea. It's certainly less efficient than a SECURITY  
DEFINER function, for starters...

--
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461



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

  http://archives.postgresql.org


Re: [BUGS] PostgreSQL 8.1.3.6044 crashes randomly.

2006-04-06 Thread Jim Nasby

On Apr 2, 2006, at 8:36 PM, Anthony Ransley wrote:
The Windows version of PostgreSQL 8.1.3.6044 has randomly crashed a  
few times now. Can anyone supply me with the symbol set for the  
8.1.3.6044 Windows release, so I can provide more information and  
maybe even debug it.





What's the data contained in the error report (the "click here" link)?
--
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461



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


Re: [BUGS] BUG #2364: DB Error: connect failed ... PHP/PostgreSql

2006-04-03 Thread Jim Nasby

I fail to see how this is a bug, but...

Are you running the webserver as root? Most systems don't do that  
(for good reason!). You should turn on log_connections and  
log_disconnections in postgresql.conf and see what it shows is  
happening (you might need to turn up log_min_messages).


On Mar 30, 2006, at 1:08 PM, manashi wrote:



The following bug has been logged online:

Bug reference:  2364
Logged by:  manashi
Email address:  [EMAIL PROTECTED]
PostgreSQL version: psql (PostgreSQ
Operating system:   Linux
Description:DB Error: connect failed ... PHP/PostgreSql
Details:

hi...
 I am working on PHP using postgreSQl as DB...
  Both r very new to me
  i logged in as root and
created a user root
the command i hav used : createuser root
and
database sample : createdb sample
then to check list of database i used command : psql -l
the  RESULT was

  List of databases
   Name|  Owner   | Encoding
---+--+--
 sample| root | UNICODE
 template0 | postgres | UNICODE
 template1 | postgres | UNICODE
(3 rows)

  then i created a table in DB sample name "login"

 using normal sql query and inserted two datas

i created file "show.php" to display the content on web page
 the code is as follows :-

";

$con = DB::connect($dsn);
echo "The Connection Object : $con";

if(DB::isError($con))
{
  $valu = DB::isError($con);
  echo "Error Number : $valu ";

  $val1 = $con->getMessage($valu);
  echo "The Message : $val1";
}
else
{
  echo "Connection established ";
}

$sql="SELECT id,name FROM login";
echo "$sql";

echo "$rs = $con->query($sql);";
echo "$rs";

if(DB::isError($rs))
{
  die($rs->getMessage());
}

while($row = $rs->fetchRow(DB_FETCHMODE_ASSOC))
{
  $fulid = $row['id']." ";
  $fulname = $row['name']." ";
  echo "Details : $fulid $fulname";
}
$con->disconnect();
?>

i created a directory name example in /var/www/html
   and saved show.php there

when i am executing this file as

http://localhost/example/show.php

its displaying :

The DSN : pgsql://root:@localhost/sample
The Connection Object : Object id #2
Error Number : 1
The Message : DB Error: connect failed
SQL QUERY : SELECT id,name FROM login

i hav tried a lot to find out the error but unable to find it

 PostgreSQL version installed in my system :
  psql (PostgreSQL) 8.0.3
contains support for command-line editing

PHP version installed in my system :
PHP 5.0.4 (cli) (built: May  9 2005 11:21:11)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies

Operating System : LINUX

 Waiting for the REply...

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



--
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461



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


Re: [BUGS] BUG #2365: can't install

2006-04-03 Thread Jim Nasby
You'll probably get better help from the windows installer folks  
(there should be a mailing list somewhere on pgFoundry)... Have you  
tried removing the postgres account? That would probably at least get  
you running. The names and IDs thing sounds like a bug, but you'd  
have to talk to the installer folks about that...


Perhaps the installer should do a better job of pointing people at  
where to report install bugs...


On Mar 31, 2006, at 9:19 AM, Bujic Nikola wrote:



The following bug has been logged online:

Bug reference:  2365
Logged by:  Bujic Nikola
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.1
Operating system:   windows xp
Description:can't install
Details:

I getting mesage that postgres account already exists, but I install
postgresql for the first time. whwn I change the name of account  
message is

that account nemes and security IDs don't match. What to do?

---(end of  
broadcast)---

TIP 4: Have you searched our list archives?

   http://archives.postgresql.org



--
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461



---(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] BUG #2308: pg_dump -a does not respect referential dependencies

2006-03-08 Thread Jim Nasby

On Mar 8, 2006, at 3:01 PM, Tom Lane wrote:


"Matthew George" <[EMAIL PROTECTED]> writes:
The best practice is to do standard schema+data dumps, wherein the
ordering problem can be handled properly by not creating the FK
constraints until after the data is loaded.  If you really want to
do a data-only restore, I'd suggest dropping the FK constraints
and re-adding them afterwards (which will be a lot faster than
row-by-row retail checks would be, anyway).


BTW, it would be really nice if we provided a better way to do this  
than manually dropping all the FK constraints and adding them back in  
later. Would it be difficult to allow deferring all constraints in  
the database during a specified transaction? That would allow for  
loading the data in a transaction and doing the constraint checking  
later...

--
Jim C. Nasby, Database Architect[EMAIL PROTECTED]
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"



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