[BUGS] ESQL/C TRUNCATE TABLE results in DROP TABLE

2001-10-01 Thread Lee Kindness

Your name   : Lee Kindness
Your email address  : [EMAIL PROTECTED]

System Configuration
-
  Architecture (example: Intel Pentium) : Intel Pentium
  Operating System (example: Linux 2.0.26 ELF)  : Linux 2.2.16-22, RedHat 7.0
  PostgreSQL version (example: PostgreSQL-7.1.3): PostgreSQL-7.1.3
  Compiler used (example:  gcc 2.95.2)  : RPM

Please enter a FULL description of your problem:


'TRUNCATE TABLE' in embedded SQL results in the table being dropped!


Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible: 
--

Execute the following commands:

 createdb copytest
 echo 'CREATE TABLE copytest (f1 INTEGER, f2 INTEGER);' psql copytest
 echo 'CREATE UNIQUE INDEX copytest_idx ON copytest USING BTREE (f1, f2);' psql 
copytest
 ecpg copy.pgc
 gcc copy.c -I /usr/include/pgsql -lecpg -lpq
 ./a.out

Which will result in the following output from 'a.out':

 Error -400: 'ERROR:  Relation 'copytest' does not exist' in line 17.

given the following source 'copytest.pgc':

 #include 
 #include 
 #include 
 #include 

 EXEC SQL INCLUDE sqlca;

 int main(int argc, char **argv)
 {
  EXEC SQL CONNECT TO copytest;
  if( sqlca.sqlcode != 0 )
return( 1 );

  EXEC SQL TRUNCATE TABLE copytest;
  if( sqlca.sqlcode < 0 )
return( 1 );

  EXEC SQL COPY copytest FROM '/tmp/copytest';
  if( sqlca.sqlcode < 0 )
{
  printf("Error %ld: %s\n", sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);
  return( 1 );
}

  EXEC SQL COMMIT;
  EXEC SQL DISCONNECT;

  return( 0 );
 }

and the following '/tmp/copytest' (not used):

 1  1
 2  2
 3  3
 4  4
 5  5
 6  6

If you add an 'EXEC SQL COMMIT' after the TRUNCATE and then do a '\d'
in psql the table is not shown - it has been dropped.

If you know how this problem might be fixed, list the solution below:
-

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

http://archives.postgresql.org



Re: [BUGS] Website, mailing list

2001-10-01 Thread Bruce Momjian

> Vince Vielhaber <[EMAIL PROTECTED]> writes:
> >> It would seem that that page is out of date.  Vince, can you fix it?
> 
> > Actually the instructions are correct.
> 
> Are they?  The last time I subscribed to a new list, the right
> incantation was to mail 
>   subscribe list-name my-address
> to [EMAIL PROTECTED]  This doesn't square with what the webpage
> says to do ...

It defaults to your current email address and the mailing list address
you used for subscription.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 853-3000
  +  If your life is a hard drive, |  830 Blythe Avenue
  +  Christ can be your backup.|  Drexel Hill, Pennsylvania 19026

---(end of broadcast)---
TIP 3: 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] CVS rejected me

2001-10-01 Thread Vince Vielhaber

On Fri, 21 Sep 2001, John Summerfield wrote:

> On Tue, 18 Sep 2001, Marc G. Fournier wrote:
>
>
> >
> >
> > go to anoncvs.postgresql.org, not postgresql.org ..
>
> See the instructions at 
>http://www.ca.postgresql.org/devel-corner/docs/postgres/cvs.html
>
> If your advice is correct (I've not tried it yet) then the rules are changed and the 
>werbsite's out of date.
>
> As I noted, it was working.

the link to devel-corner is out of date.  But checking the developer's
website I see it hasn't been updated either.


>
> >
> > On Tue, 18 Sep 2001, John Summerfield wrote:
> >
> > > This worked 2-3 days ago: what's changed?
> > >
> > > vs -z9 -q update
> > > cvs update: authorization failed: server postgresql.org rejected access to 
>/home/projects/pgsql/cvsroot for user anoncvs
> > > summer@dugite pgsql$
> > >
> > > The entry's still in ~/.cvspass
> > >
> > >
> > >
> > > ---(end of broadcast)---
> > > TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
> > >
> >
>
>
> ---(end of broadcast)---
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>

-- 
==
Vince Vielhaber -- KA8CSHemail: [EMAIL PROTECTED]http://www.pop4.net
 56K Nationwide Dialup from $16.00/mo at Pop4 Networking
Online Campground Directoryhttp://www.camping-usa.com
   Online Giftshop Superstorehttp://www.cloudninegifts.com
==




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



[BUGS] initdb must have write access to /tmp

2001-10-01 Thread Rich Bodo


Hi,

I was just installing postgres 7.1.2 on my linux mandrake 7.2
system and the build and install went fine up to the point I
had to run:

 initdb -D /usr/local/pgsql/data

which segfaulted.  I changed the permissions on /tmp to 777
and all was well.  I think initdb could use an if statement to
check the permissions on /tmp and report a descriptive bug.

-Rich

Rich Bodo | [EMAIL PROTECTED] | 650-964-4678


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



[BUGS] pg_get_indexdef (PostgreSQL 7.2 Snapshot)

2001-10-01 Thread Dave Page

Hi,

I've been playing with a 7.2 snapshot downloaded from a mirror on 24 Sept.
During the addition of support in pgAdmin II for constraint clauses in index
definitions, I've found that for an index created with:

CREATE UNIQUE INDEX "constraint_index" ON "test" USING btree ("data") WHERE
id < 12345

pg_get_indexdef(oid) returns:

CREATE UNIQUE INDEX constraint_index ON test USING btree (data text_ops);

(and yes I am passing the correct oid!).

Please CC me any replies as I'm not on this list...

Regards, Dave.

-- 
Dave Page ([EMAIL PROTECTED])
pgAdmin Project Leader
http://pgadmin.postgresql.org/ 

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



[BUGS] MM Bug in libecpg

2001-10-01 Thread Sascha Demetrio

Hi,

I'd like to report a bug in the memory management of libecpg
(PostgreSQL version 7.1.3).

The ECPGLog() call in ./src/interfaces/ecpg/lib/connect.c line 428
uses variables pointing to free()'ed storage (`realname', `host',
`port', and `options', see patch below).

regards,
Sascha Demetrio

diff -u connect.c.old connect.c
--- connect.c.old   Sat Sep 29 16:51:41 2001
+++ connect.c   Sat Sep 29 16:53:03 2001
@@ -411,17 +411,6 @@
 
this->connection = PQsetdbLogin(host, port, options, NULL, realname, user, 
passwd);
 
-   if (host)
-   free(host);
-   if (port)
-   free(port);
-   if (options)
-   free(options);
-   if (realname)
-   free(realname);
-   if (dbname)
-   free(dbname);
-
if (PQstatus(this->connection) == CONNECTION_BAD)
{
ecpg_finish(this);
@@ -433,8 +422,31 @@
user ? "for user " : "", user ? user : "",
lineno);
ECPGraise(lineno, ECPG_CONNECT, realname ? realname : "");
+
+   if (host)
+   free(host);
+   if (port)
+   free(port);
+   if (options)
+   free(options);
+   if (realname)
+   free(realname);
+   if (dbname)
+   free(dbname);
+
return false;
}
+
+   if (host)
+   free(host);
+   if (port)
+   free(port);
+   if (options)
+   free(options);
+   if (realname)
+   free(realname);
+   if (dbname)
+   free(dbname);
 
this->committed = true;
this->autocommit = autocommit;


---(end of broadcast)---
TIP 3: 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] pg_get_indexdef (PostgreSQL 7.2 Snapshot)

2001-10-01 Thread Tom Lane

Dave Page <[EMAIL PROTECTED]> writes:
> [ pg_get_indexdef doesn't report the predicate for a partial index ]

Hmm, looks like an oversight.  I agree it should do that.
Thanks for the report!

regards, tom lane

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [BUGS] initdb must have write access to /tmp

2001-10-01 Thread Tom Lane

Rich Bodo <[EMAIL PROTECTED]> writes:
>   I was just installing postgres 7.1.2 on my linux mandrake 7.2
>   system and the build and install went fine up to the point I
>   had to run:
>initdb -D /usr/local/pgsql/data
>   which segfaulted.  I changed the permissions on /tmp to 777
>   and all was well.  I think initdb could use an if statement to
>   check the permissions on /tmp and report a descriptive bug.

I cannot replicate this in current sources; I get

creating directory /home/postgres/testversion/data... ok
creating directory /home/postgres/testversion/data/base... ok
creating directory /home/postgres/testversion/data/global... ok
creating directory /home/postgres/testversion/data/pg_xlog... ok
creating directory /home/postgres/testversion/data/pg_clog... ok
creating template1 database in /home/postgres/testversion/data/base/1... ok
creating configuration files... ok
initializing pg_shadow... /home/postgres/testversion/bin/initdb[505]: /tmp/sh4843.13: 
Cannot find or open the file.

initdb failed.
Removing /home/postgres/testversion/data.

which seems like reasonable behavior to me.  On another machine I get
something about "Cannot create temp file for here document: Permission
denied".

My guess is that the core dump you are seeing is actually your shell's
fault, not Postgres'; probably the shell is not expecting a create of 
its temp file to fail.  If so, it would be inappropriate for us to put
in a test for /tmp writability, since that would be making an
unsupported assumption about where the local shell puts its internal
temp files.

regards, tom lane

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



[BUGS] SPI linking problems on Win32

2001-10-01 Thread Ronald Kuczek

Hi,
I'm using Postgresql 7.1.3 on NTServer. I have tried to compile my functions
using SPI on my Windows box.
Under Linux these functions are compiling and working but Windows
I can't compile (or better say link) even fulltextindex function (from
contrib/fulltextindex) - they are using SPI too.
Error message I get if I try to link:
ft_create.o ../../src/utils/dllinit.o -lcygipc -lcrypt -lplpgsql
ft_create.o(.text+0x4d):ft_create.c: undefined reference to `SPI_exec'
ft_create.o(.text+0x9d):ft_create.c: undefined reference to `SPI_exec'
ft_create.o(.text+0xb0):ft_create.c: undefined reference to `SPI_connect'
ft_create.o(.text+0xc1):ft_create.c: undefined reference to `SPI_finish'
collect2: ld returned 1 exit status
dllwrap: gcc exited with status 1
Any idea ?

Rony



---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [BUGS] CVS rejected me

2001-10-01 Thread Bruce Momjian

> > > > > go to anoncvs.postgresql.org, not postgresql.org ..
> > > >
> > > > See the instructions at 
>http://www.ca.postgresql.org/devel-corner/docs/postgres/cvs.html
> > > >
> > > > If your advice is correct (I've not tried it yet) then the rules are changed 
>and the werbsite's out of date.
> > > >
> > > > As I noted, it was working.
> > >
> > > the link to devel-corner is out of date.  But checking the developer's
> > > website I see it hasn't been updated either.
> >
> > I updated the SGML and updated the HTML on www.ca.postgresql.org.  Seems
> > that didn't fix it.
> 
> Last nite's changes broke a number of things on the developers site.
> They're fixed now.  If you see devel-corner in a link, it's probably
> broken - let me know where you saw it.

I am showing this as not found:

http://www.ca.postgresql.org/devel-corner/docs/postgres/cvs.html

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 853-3000
  +  If your life is a hard drive, |  830 Blythe Avenue
  +  Christ can be your backup.|  Drexel Hill, Pennsylvania 19026

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



Re: [BUGS] CVS rejected me

2001-10-01 Thread Bruce Momjian

> On Fri, 21 Sep 2001, John Summerfield wrote:
> 
> > On Tue, 18 Sep 2001, Marc G. Fournier wrote:
> >
> >
> > >
> > >
> > > go to anoncvs.postgresql.org, not postgresql.org ..
> >
> > See the instructions at 
>http://www.ca.postgresql.org/devel-corner/docs/postgres/cvs.html
> >
> > If your advice is correct (I've not tried it yet) then the rules are changed and 
>the werbsite's out of date.
> >
> > As I noted, it was working.
> 
> the link to devel-corner is out of date.  But checking the developer's
> website I see it hasn't been updated either.

I updated the SGML and updated the HTML on www.ca.postgresql.org.  Seems
that didn't fix it.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 853-3000
  +  If your life is a hard drive, |  830 Blythe Avenue
  +  Christ can be your backup.|  Drexel Hill, Pennsylvania 19026

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

http://archives.postgresql.org