Re: [HACKERS] Escaping strings for inclusion into SQL queries

2001-09-04 Thread Florian Weimer
Bruce Momjian <[EMAIL PROTECTED]> writes: > Patch removed at the request of the author. Author will resubmit. I've attached the fixed version of the patch below. After the discussion on pgsql-hackers (especially the frightening memory dump in <[EMAIL PROTECTED]>), we decided that it is best no

[HACKERS] Referential Integrity Stress Problem

2001-09-04 Thread Mike Cianflone
We're running Postgres 7.0.3.2. We're running into a referential integrity violation that seems to crop up randomly, and only when stress testing the system for a day or so. We've created some stress test code to fill the tables with about 500 nodes, then delete them from the top

Re: [HACKERS] Bad behaviour when inserting unspecified variable length datatypes

2001-09-04 Thread Tom Lane
>> Uh, what did your CREATE TYPE command look like, exactly? This sounds >> like you specified a default value for the datatype. > [ no, he didn't ] Now that I look at it, CREATE TYPE is totally whacked out about default values for user-defined datatypes. The reason the system-defined types al

Re: [HACKERS] [JDBC] Troubles using German Umlauts with JDBC

2001-09-04 Thread Barry Lind
Rene, I would like to add one additional comment. In current sources the jdbc driver detects (through a hack) that the server doesn't have multibyte enabled and then ignores the SQL_ASCII return value and defaults to the JVM's character set instead of using SQL_ASCII. The problem boils down

Re: [HACKERS] Bytea/Base64 encoders for libpq - interested?

2001-09-04 Thread Bruce Momjian
> Bruce Momjian <[EMAIL PROTECTED]> writes: > > Let me ask a bigger question. We have the length of the text string in > > the varlena header. Are we concerned about backend code not handling > > NULL in text fields, or frontend code returning strings with embedded > > nulls? > > The former. >

Re: [HACKERS] Escaping strings for inclusion into SQL queries

2001-09-04 Thread Bruce Momjian
Patch removed at the request of the author. Author will resubmit. > It has come to our attention that many applications which use libpq > are vulnerable to code insertion attacks in strings and identifiers > passed to these applications. We have collected some evidence which > suggests that th

Re: [HACKERS] Bytea/Base64 encoders for libpq - interested?

2001-09-04 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Let me ask a bigger question. We have the length of the text string in > the varlena header. Are we concerned about backend code not handling > NULL in text fields, or frontend code returning strings with embedded > nulls? The former. > I see problem

Re: [HACKERS] Bytea/Base64 encoders for libpq - interested?

2001-09-04 Thread Larry Rosenman
* Tom Lane <[EMAIL PROTECTED]> [010904 12:01]: > They're pretty ugly, but more importantly they're only suitable if we > have exactly one conversion function each way. If we have two, what > will we call the second one? > > I think it's okay to let the argument type be implicit in the function >

Re: [HACKERS] Bad behaviour when inserting unspecified variable length

2001-09-04 Thread Dave Blasby
> Uh, what did your CREATE TYPE command look like, exactly? This sounds > like you specified a default value for the datatype. Okay, here's two examples; CREATE TYPE WKB ( internallength = VARIABLE, input = WKB_in, output = WKB_out, storage= extended ); CREAT

Re: [HACKERS] Bytea/Base64 encoders for libpq - interested?

2001-09-04 Thread Bruce Momjian
> You're right, as usual (I was tired when I wrote this last night ;). But I > think we have to escape/unescape both null and '\', don't we? Yes, I think backslashes need special escapes too. Let me ask a bigger question. We have the length of the text string in the varlena header. Are we conc

Re: [HACKERS] [JDBC] Troubles using German Umlauts with JDBC

2001-09-04 Thread Rene Pijlman
[forwarding to pgsql-hackers and Bruce as Todo list maintainer, see comment below] [insert with JDBC converts Latin-1 umlaut to ?] On 04 Sep 2001 09:54:27 -0400, Dave Cramer wrote: >You have to set the encoding when you make the connection. > >Properties props = new Properties(); >props.put("user

Re: [HACKERS] Bytea/Base64 encoders for libpq - interested?

2001-09-04 Thread Tom Lane
"Joe Conway" <[EMAIL PROTECTED]> writes: > You're right, as usual (I was tired when I wrote this last night ;). But I > think we have to escape/unescape both null and '\', don't we? Yeah, you're right. My turn to have not thought hard enough. > I agree that it would be better to *not* allow imp

Re: [HACKERS] [PATCHES] to_char and Roman Numeral (RN) bug

2001-09-04 Thread Bruce Momjian
> On Fri, Aug 31, 2001 at 07:28:50PM -0700, Command Prompt, Inc. wrote: > > > In documenting the to_char() function for transformation of numbers to > > text, I noticed that the "RN" template character sequence was displaying > > some unusual behavior; specifically, unless in fill mode (with the

Re: [HACKERS] Bytea/Base64 encoders for libpq - interested?

2001-09-04 Thread Joe Conway
> Ugh ... if the conversion functions are not inverses then I think they > lose much of their value. I could see doing either of these: > > 1. Conversion functions based on byteaout/byteain. > > 2. Bytea to text escapes *only* null bytes, text to bytea treats only > "\0" as an escape sequence. >

Re: [HACKERS] [PATCHES] to_char and Roman Numeral (RN) bug

2001-09-04 Thread Karel Zak
On Tue, Sep 04, 2001 at 11:37:48AM -0400, Bruce Momjian wrote: > > On Fri, Aug 31, 2001 at 07:28:50PM -0700, Command Prompt, Inc. wrote: > > > > > In documenting the to_char() function for transformation of numbers to > > > text, I noticed that the "RN" template character sequence was displaying

Re: [HACKERS] Postgres is eating my CPU

2001-09-04 Thread Tom Lane
[EMAIL PROTECTED] (James Thornton) writes: > As you can see from the ps output, there are several INSERT statements > -- these return after restarting Postgres and even rebooting the > system. Postgres backends don't just appear out of nowhere. Somewhere you have a client app that is connecting

Re: [HACKERS] [GENERAL] getting the oid for a new tuple in a BEFORE

2001-09-04 Thread Bruce Momjian
> > we need to control database changes within BEFORE triggers. > > There is no problem with triggers called by update, but there is > > a problem with triggers called by insert. > > > > We strongly need to know the oid of a newly inserted tuple. > > In this case, we use tg_newtuple of the Trigge

Re: [HACKERS] Bytea/Base64 encoders for libpq - interested?

2001-09-04 Thread Joe Conway
> > On a related note, are there any other bytea functions we should have in the > > backend before freezing for 7.2? > > The SQL standards has a lot of functions for BLOB... > OK - thanks. I'll take a look. > > I was thinking it would be nice to have a > > way to cast bytea into text and vice-v

Re: [HACKERS] Table vs. row level locks confusion

2001-09-04 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > The following section > http://www.ca.postgresql.org/devel-corner/docs/postgres/locking-tables.html > titled "Locking and Tables", has two subsections, "Table-level locks" and > "Row-level locks". Under table-level locks we find lock names such as >

Re: [HACKERS] [BUGS] Build problem with CVS version

2001-09-04 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > This is a very valid concern, and it's been bugging us, too. The problem > is that by default, the majority of users would probably want the Perl and > Python modules to be put in the default place where they're easy to find > for the interpreter. (

Re: [HACKERS] Fw: Random strings

2001-09-04 Thread Doug McNaught
"Joe Conway" <[EMAIL PROTECTED]> writes: > > Having said that, I'm not married to the idea that we should provide > access > > to both /dev/random and /dev/urandom. I'd be happy to roll another patch, > > limited to just urandom, and renaming the function if you feel strongly > > about it. (shoul

Re: [HACKERS] Bytea/Base64 encoders for libpq - interested?

2001-09-04 Thread Tom Lane
"Joe Conway" <[EMAIL PROTECTED]> writes: > Well, ISTM the simplest (if not the most efficient) way to do bytea-to-text > would be a function that takes the escaped string value from byteaout, and > creates a text value directly from it. The only danger I can think of is > that very long strings mi

Re: [HACKERS] [PATCHES] to_char and Roman Numeral (RN) bug

2001-09-04 Thread Karel Zak
On Fri, Aug 31, 2001 at 07:28:50PM -0700, Command Prompt, Inc. wrote: > In documenting the to_char() function for transformation of numbers to > text, I noticed that the "RN" template character sequence was displaying > some unusual behavior; specifically, unless in fill mode (with the "FM" > seq

Re: [HACKERS] [BUGS] Build problem with CVS version

2001-09-04 Thread Peter Eisentraut
John Summerfield writes: > To my dismay some components don't honour the "--prefix=/tmp/postgresql" > specification and try to install in some other location. > > I'd much prefer for the perl and python components to install into the > location I specified, and to leave me to discuss with Perl a

[HACKERS] Postgres is eating my CPU

2001-09-04 Thread James Thornton
Postmaster is eating my CPU -- see ps and top output at http://jamesthornton.com/misc/postgres.txt or below (it wraps too much when posting to Google, but my server keeps getting overloaded). As you can see from the ps output, there are several INSERT statements -- these return after restarting

[HACKERS] [PATCHES] to_char and Roman Numeral (RN) bug

2001-09-04 Thread Command Prompt, Inc.
Good day, Sorry to post to this list about a patch, but I seem to be having some difficult getting on the pgsql-patches list; keep getting an "illegal command" when I send it "subscribe", for some reason. At any rate: In documenting the to_char() function for transformation of numbers to text, I

[HACKERS] BIG problem !!:fatal 1:set user id user admin is not in eg shadow

2001-09-04 Thread johan27
We have postgres running on a linux machine and we connect with 15 winnt 4.0 machines running ACCESS2000 When we change from access 97 to access 2000 we get every 15 minutes following problem after a process query - fatal 1:set user id user admin is not in eg sh

Re: [HACKERS] Porting to Native WindowsNT/2000

2001-09-04 Thread Dave Page
> -Original Message- > From: Tom Lane [mailto:[EMAIL PROTECTED]] > Sent: 04 September 2001 06:43 > To: dave Page > Subject: Re: [HACKERS] Porting to Native WindowsNT/2000 > > > I thought this might interest you. > ** Thanks Tom, > "Ken Hirsch" <[

[HACKERS] ODBC TODO list is way out of date

2001-09-04 Thread Oliver Elphick
There is a TODO list at src/interfaces/odbc/TODO.txt which was last updated in 1998. Do any of the things in this list remain to be done? If not, perhaps the file should be removed. -- Oliver Elphick[EMAIL PROTECTED] Isle of Wight htt

[HACKERS] Table vs. row level locks confusion

2001-09-04 Thread Peter Eisentraut
The following section http://www.ca.postgresql.org/devel-corner/docs/postgres/locking-tables.html titled "Locking and Tables", has two subsections, "Table-level locks" and "Row-level locks". Under table-level locks we find lock names such as RowShareLock and RowExclusiveLock -- are those table-

Re: [HACKERS] Bytea/Base64 encoders for libpq - interested?

2001-09-04 Thread Peter Eisentraut
Joe Conway writes: > On a related note, are there any other bytea functions we should have in the > backend before freezing for 7.2? The SQL standards has a lot of functions for BLOB... > I was thinking it would be nice to have a > way to cast bytea into text and vice-versa, so that the normal

Re: [HACKERS] Bytea/Base64 encoders for libpq - interested?

2001-09-04 Thread Karel Zak
On Mon, Sep 03, 2001 at 08:48:22PM -0400, Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > Where did we leave this? > > I don't think adding a datatype just to provide base64 encoding is > a wise approach. The overhead of a new datatype (in the sense of > providing operators/funct