Re: [HACKERS] storing binary data

2001-10-23 Thread Alex Pilosov
Use bytea. Search archives. On Sun, 21 Oct 2001, Jason Orendorff wrote: > Reply-To: sender > > Hi. I was surprised to discover today that postgres's > character types don't support zero bytes. That is, > Postgres isn't 8-bit clean. Why is that? > > More to the point, I need to store about 1

Re: [HACKERS] Feature Request - PL/PgSQL

2001-10-14 Thread Alex Pilosov
You already can return a cursor. Support for returning a record set is being worked on. -alex On Sun, 14 Oct 2001, Gavin Sherry wrote: > Hi all, > > It would be very nice if PL/PgSQL could return a record set (ie, set of > tuples). This could be done in two ways as far as I can imagine: either

Re: [HACKERS] Suitable Driver ?

2001-10-11 Thread Alex Pilosov
On Thu, 11 Oct 2001, Balaji Venkatesan wrote: > Now i need to install DBD For PGSQL .Is > this the driver i have to work on for pgsql ?. > Or do I have any other option to connect to pgsql > from perl . Indeed i've found out an other way > to use Pg driver

Re: [HACKERS] RFD: access to remore databases: altername suggestion

2001-10-02 Thread Alex Pilosov
You are attacking here two things: a) schemas, which should be done in 7.3, thus multiple databases on same host would be unnecessary. b) connections to remote host' databases, which is partially implemented already (in a ugly way, but...) see contrib/dblink What you described is a syntactic s

Re: [HACKERS] Spinlock performance improvement proposal

2001-09-26 Thread Alex Pilosov
On Wed, 26 Sep 2001, D. Hageman wrote: > Oh, man ... am I reading stuff into what you are writing or are you > reading stuff into what I am writing? Maybe a little bit of both? My > original contention is that I think that the best way to get the full > potential out of SMP machines is to us

Re: [HACKERS] Spinlock performance improvement proposal

2001-09-26 Thread Alex Pilosov
On Wed, 26 Sep 2001, D. Hageman wrote: > > > Save for the fact that the kernel can switch between threads faster then > > > it can switch processes considering threads share the same address space, > > > stack, code, etc. If need be sharing the data between threads is much > > > easier then s

Re: [HACKERS] Changing data types

2001-09-24 Thread Alex Pilosov
On Mon, 24 Sep 2001, Rod Taylor wrote: > Out of curiosity how was option a) implemented? I could envision > supporting multiple versions of a tuple style to be found within a > table (each described in pg_attribute). Gradually these would be > upgraded through normal use. Check the archives (lo

Re: [HACKERS] Changing data types

2001-09-24 Thread Alex Pilosov
On Mon, 24 Sep 2001, mlw wrote: > To be honest I am very surprised that MS SQL supports that, but then > again Microsoft is so used to doing everything so utterly wrong, they > have to design all their products with the ability to support > fundamental design error corrections on the fly. > > I

Re: [HACKERS] [SQL] outer joins strangeness

2001-09-24 Thread Alex Pilosov
[moved to hackers] On Mon, 24 Sep 2001, Stephan Szabo wrote: > > Postgres should understand that left outer join does not constrict join > > order... > > But it can. If your condition was a joining between the other table > and the right side of the left outer join, you'd have the same conditi

Re: [HACKERS] Changing data types

2001-09-24 Thread Alex Pilosov
This is not for -hackers. And the answer is "no, you can't". Recreate the table with correct types and insert the old values into it. On Mon, 24 Sep 2001, Gowey, Geoffrey wrote: > I posted this in my last message, but have not heard anything yet so I'm > wondering if it was overlooked. I need

Re: [HACKERS] [SQL] outer joins strangeness

2001-09-23 Thread Alex Pilosov
On Sun, 23 Sep 2001, Stephan Szabo wrote: > On Sun, 23 Sep 2001, Alex Pilosov wrote: > > > It may be just me, or I am grossly misunderstanding syntax of outer joins, > > but I see that plans for my queries are different depending on how I place > > join conditions and so

Re: [HACKERS] [PATCH] [LARGE] select * from cursor foo

2001-09-21 Thread Alex Pilosov
On Fri, 21 Sep 2001, Tom Lane wrote: > > I've looked this over, and I think it's not mature enough to apply at > this late stage of the 7.2 cycle; we'd better hold it over for more work > during 7.3. Major problems: > 1. Insufficient defense against queries that outlive the cursors they > selec

Re: [HACKERS] cvsup trouble

2001-09-21 Thread Alex Pilosov
On Fri, 21 Sep 2001, Thomas Lockhart wrote: > > $ ping cvsup.postgresql.org > > PING rs.postgresql.org: 64 byte packets > > 64 bytes from 64.39.15.238: icmp_seq=0. time=57. ms > > 64 bytes from 64.39.15.238: icmp_seq=1. time=70. ms > > Perhaps there is a routing problem somewhere between you and

CVS/CVSup problems (was Re: [HACKERS] [PATCH] [LARGE] )

2001-09-20 Thread Alex Pilosov
On Thu, 20 Sep 2001, Alex Pilosov wrote: > CVS repository also seems broken right now, I'm unable to log in (cvs > login: authorization failed: server cvs.postgresql.org rejected access > to /home/projects/pgsql/cvsroot for user anoncvs) in both > cvs.postgresql.org and anonc

Re: [HACKERS] [PATCH] [LARGE] select * from cursor foo

2001-09-20 Thread Alex Pilosov
On Mon, 17 Sep 2001, Tom Lane wrote: > Alex Pilosov <[EMAIL PROTECTED]> writes: > > Attached patch does the above. > > Alex, could we have this resubmitted in "diff -c" format? Plain diff > format is way too risky to apply. Tom, postgresql.org cvsup reposit

Re: [HACKERS] Beta timing

2001-09-11 Thread Alex Pilosov
(cough) Could someone look at my 'select from cursor foo' patch...? tnx On Tue, 11 Sep 2001, Marc G. Fournier wrote: > > Wait until everyone is ready/finished with their existing projects ... > this past week has thrown alot of turmoil into several lives that wasn't > entirely unexpected, but

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

2001-08-30 Thread Alex Pilosov
It is. Application is responsible to call PGescapeString (included in the patch in question) to escape command that may possibly have user-specified data... This function isn't called automatically. On Thu, 30 Aug 2001, Mitch Vincent wrote: > Perhaps I'm not thinking correctly but isn't it the j

[HACKERS] Re: Toast,bytea, Text -blob all confusing

2001-08-29 Thread Alex Pilosov
up. > OK it's probably not the same, but having to put four backslashes when two > should be enough to quote one makes me rather puzzled and uneasy. Double parsing, hence double escaping. -- Alex Pilosov| http://www.acedsl.com/home.html CTO - Acecape, Inc. | AceDSL:T

[HACKERS] [PATCH] [LARGE] select * from cursor foo

2001-08-29 Thread Alex Pilosov
Patch not attached, apparently mail server rejects large files. Patch can be found on www.formenos.org/pg/cursor.fix1.diff Notes: 1. Incompatible changes: CURSOR is now a keyword and may not be used as an identifier (tablename, etc). Otherwise, we get shift-reduce conflicts in grammar. 2. Majo

Re: [HACKERS] [PATCH] tiny fix for plperlu

2001-08-29 Thread Alex Pilosov
Nevermind this patch then... On Wed, 29 Aug 2001, Peter Eisentraut wrote: > Alex Pilosov writes: > > > Attached patch fixes following problem: createlang.sh expects one handler > > for each PL. If a handler function for a new PL is found in pg_languages, > > PL won'

[HACKERS] [PATCH] tiny fix for plperlu

2001-08-28 Thread Alex Pilosov
Attached patch fixes following problem: createlang.sh expects one handler for each PL. If a handler function for a new PL is found in pg_languages, PL won't be created. So you need to have plperl_call_handler and plperlu_call_handler. This patch just does that. -alex Index: src/bin/scripts/crea

Re: [HACKERS] Upcoming events

2001-08-28 Thread Alex Pilosov
Aiiye. I'm sending a _large_ (60k) patch to add 'select * from cursor foo' tonight. I'm hoping that it could possibly get included... -alex On Mon, 27 Aug 2001, Tom Lane wrote: > "Christopher Kings-Lynne" <[EMAIL PROTECTED]> writes: > > Do we want ADD PRIMARY KEY? > > If you can get it done in

Re: [HACKERS] Toast,bytea, Text -blob all confusing

2001-08-27 Thread Alex Pilosov
On Thu, 23 Aug 2001 [EMAIL PROTECTED] wrote: > THIS IS WHAT I CANT SEEM TO FIGURE OUT IN POSTGRESQL > 1. I cant get a clear answer on what kind of data type to use for my large > text string? TEXT, ???, ??? or something about TOAST > I have seen in the e-mail archive but cant find any documentai

Re: [HACKERS] Re: AW: Re: OID wraparound: summary and proposal

2001-08-06 Thread Alex Pilosov
On Mon, 6 Aug 2001, mlw wrote: > Zeugswetter Andreas SB SD wrote: > > > > > It seems to me, I guess and others too, that the OID mechanism should > > be on a > > > per table basis. That way OIDs are much more likely to be unique, and > > TRUNCATE > > > on a table should reset it's OID counter to

Re: AW: [HACKERS] Re: OID wraparound: summary and proposal

2001-08-06 Thread Alex Pilosov
On Mon, 6 Aug 2001, mlw wrote: > I think you are focusing too much on "ROWID" and not enough on OID. The issue > at hand is OID. It is a PostgreSQL cluster wide limitation. As data storage > decreases in price, the likelihood of people running into this limitation > increases. I have run into OID

Re: [HACKERS] pg_depend

2001-07-16 Thread Alex Pilosov
On Mon, 16 Jul 2001, Peter Eisentraut wrote: > Bruce Momjian writes: > > > I have found that many TODO items would benefit from a pg_depend table > > that tracks object dependencies. TODO updated. > > I'm not so convinced on that idea. Assume you're dropping object foo. > You look at pg_depen

Re: [HACKERS] pg_depend

2001-07-16 Thread Alex Pilosov
On Tue, 17 Jul 2001, Peter Eisentraut wrote: > Alex Pilosov writes: > > > > I'm not so convinced on that idea. Assume you're dropping object foo. > > > You look at pg_depend and see that objects 145928, 264792, and 1893723 > > > depend on it. Great

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Alex Pilosov
On Thu, 12 Jul 2001, Jan Wieck wrote: > Alex Pilosov wrote: > > I remember awhile ago, someone floated the idea of a dependency view which > > would list all objects and what OIDs they have in their plan. (i.e. what > > do they depend on). > > > > I'm defini

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Alex Pilosov
On Thu, 12 Jul 2001, Peter Eisentraut wrote: > Jan Wieck writes: > > > For most objects, there is no such "recompile" possible - at > > least not without storing alot more information than now. > > Create a function and based on that an operator. Then you > > drop the

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Alex Pilosov
On Thu, 12 Jul 2001, Jan Wieck wrote: > Mikheev, Vadim wrote: > > > > In good world rules (PL functions etc) should be automatically > > > > marked as dirty (ie recompilation required) whenever referenced > > > > objects are changed. > > > > > > Yepp, and it'd be possible for rules (just n

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Alex Pilosov
I remember awhile ago, someone floated the idea of a dependency view which would list all objects and what OIDs they have in their plan. (i.e. what do they depend on). I'm definitely no expert in this, but to me, one possible implementation would be to enhance outfuncs to provide for creation tr

[HACKERS] selecting from cursor/function

2001-07-10 Thread Alex Pilosov
I have 'select ... from cursor foo, tables ...' working, and halfway done with functions-as-result sets. A few questions to gurus: a) Currently, I have a shift-reduce conflict, because cursor is a valid TokenId. It can be resolved by removing it from list of TokenId, but if someone was naming on

Re: [HACKERS] selecting from cursor

2001-07-07 Thread Alex Pilosov
On Mon, 2 Jul 2001, Alex Pilosov wrote: > Erm, forgot to attach the patch. Here it is. (yow) don't even bother looking at this patch. mail server delayed this message by almost a week, and by now, the code is totally changed. I took Tom's suggestion and made RTE a union. So, the b

Re: [HACKERS] New SQL Datatype RECURRINGCHAR

2001-07-07 Thread Alex Pilosov
On Sat, 7 Jul 2001, Rod Taylor wrote: > This would be a potential feature of being able to insert into views > in general. Reversing the CREATE VIEW statement to accept inserts, > deletes and updates. Definitely not a 'potential' feature, but a existing and documented one. Read up on rules, esp

RE: [HACKERS] New SQL Datatype RECURRINGCHAR

2001-07-07 Thread Alex Pilosov
On Sat, 7 Jul 2001, David Bennett wrote: > - > In a nutshell you are recommending: > - > > create table contact_type ( > codeint2, > typechar(16), > PRIMARY KEY ( code ) > ); > > create table contact ( > numberserial, > name char(32), >

RE: [HACKERS] New SQL Datatype RECURRINGCHAR

2001-07-06 Thread Alex Pilosov
On Fri, 6 Jul 2001, David Bennett wrote: > In either model you would: > > update master_table set status='OPEN_PENDING_SOMETHING' where status='OPEN' > > This would not change, in fact, even in a normalized design you > wouldn't change the lookup table (parent) key. Perhaps you are > mi

[HACKERS] force of last XID

2001-05-18 Thread Alex Pilosov
Hi, I managed to drop really important table. Fortunately, I had a backup of the table (raw file, not a ascii file). After putting that table into freshly initdb'd database, postgres doesn't see new transactions even though 'vacuum' sees the tuples alright. So, question. I'd like to force

[HACKERS] operators and indices?

2001-05-17 Thread Alex Pilosov
Hello, I've noticed that all custom operators or inet type (such as <<, <<=, etc) cannot use an index, even though it is possible to define such an operation on an index, for ex: X << Y can be translated to "X >= network(Y) && X <= broadcast(Y)" (or so) According to docs, postgres has hard-cod

Re: [HACKERS] [BUG] views and functions on relations

2001-04-18 Thread Alex Pilosov
Here's more info on the bug: background: function cust_name(customers) returns varchar; Query in question: SELECT cust_name(a) FROM customers AS a, addresses AS b WHERE b.cust_id=a.cust_id and b.oid=get_billing_record(a.cust_id) and cust_balance(a.cust_id)>0 First, my idea of what's happening:

Re: [HACKERS] [BUG] views and functions on relations

2001-04-18 Thread Alex Pilosov
On Wed, 18 Apr 2001, Alex Pilosov wrote: > This is a far harder to trigger bug, and actually, it doesn't happen in > this simple case (oops), and the only test case I have involves 2 tables > and 3 stored procedures. It is not related to views at all, just doing the > underly

Re: [HACKERS] [BUG] views and functions on relations

2001-04-18 Thread Alex Pilosov
On Wed, 18 Apr 2001, Tom Lane wrote: > The ruleutils.c bug cannot explain this however, since ruleutils won't > even be invoked. Can you find a sequence to reproduce it? Sorry, I was mistaken. The error I get for select is this: ERROR: cache lookup for type 0 failed This is a far harder to tri

[HACKERS] [BUG] views and functions on relations

2001-04-17 Thread Alex Pilosov
In latest 7.1 (checked out 2 days ago from CVS), I see following behaviour: create table foo(x int4); create function xx(foo) returns int4 as ' return 0;' language 'plpgsql'; create view tv2 as select xx(foo) from foo; users=# \d tv2 ERROR: cache lookup of attribute 0 in relation 21747 failed

RE: [HACKERS] Proposed WAL changes

2001-03-07 Thread Alex Pilosov
On Wed, 7 Mar 2001, Mikheev, Vadim wrote: > But what can be done if fsync returns before pages flushed? No, it won't. When fsync returns, data is promised by the OS to be on disk. -alex ---(end of broadcast)--- TIP 6: Have you searched our list a

Re: [HACKERS] Plan for straightening out the include-file mess

2001-02-12 Thread Alex Pilosov
o or three other include files, such as lib/dllist.h, that are > needed on the client side only because libpq-int.h includes them, and we > want to support client code that includes libpq-int.h. I am going to look > at skinnying that list down too. libpq-fs.h, in particular, looks like > mostly legacy junk ... > > As we discussed, there'll be an additional install target (or RPM) that > installs these files and everything else from the src/include tree. > > Comments? > > regards, tom lane > > -- -- Alex Pilosov| http://www.acecape.com/dsl CTO - Acecape, Inc. | AceDSL:The best ADSL in Bell Atlantic area 325 W 38 St. Suite 1005 | (Stealth Marketing Works! :) New York, NY 10018 |

Re: [HACKERS] Plan for straightening out the include-file mess

2001-02-08 Thread Alex Pilosov
On Thu, 8 Feb 2001, Tom Lane wrote: > Alex Pilosov <[EMAIL PROTECTED]> writes: > > when I include files needed for SPI, it drags also a lot of other > > garbage in, which conflicts with other things (namely, trying to get a > > file to simultaneously include SPI and

Re: [HACKERS] Plan for straightening out the include-file mess

2001-02-08 Thread Alex Pilosov
On Thu, 8 Feb 2001, Alex Pilosov wrote: > Great! :) > > It might also clean up something that I've been fighting against for > awhile: when I include files needed for SPI, it drags also a lot of other > garbage in, which conflicts with other things (namely, tryin

Re: [HACKERS] Should I look elsewhere??

2001-02-05 Thread Alex Pilosov
post the rest of the traceback. 0x40* is the address inside some shared library, most likely libc. full traceback will show what happened before it got to libc -alex On Mon, 5 Feb 2001, Mathieu Dube wrote: > So... > If after recompiling postgres with -g in the CFLAGS and still getting 0x400

Re: [HACKERS] TODO list: Allow Java server-side programming

2001-02-03 Thread Alex Pilosov
On Sat, 3 Feb 2001, Peter Mount wrote: > It's been a while since I delved into the backend, but unless it's > changed from fork() to threading, I don't really see this happening, > unless someone who knows C that well knows of a portable way of > communicating between two processes - other than R

Re: [HACKERS] TODO list: Allow Java server-side programming

2001-02-02 Thread Alex Pilosov
On Fri, 2 Feb 2001, tomasz konefal wrote: > could someone please clarify what "Allow Java > server-side programming" actually means? what are the > limitations of using java and jdbc with pgsql? It means to embed Java interpreter inside postgres, and allow writing stored procedures and trigge

Re: [HACKERS] pg_shadow.usecatupd attribute

2001-01-23 Thread Alex Pilosov
Just to clarify for stupid me: you want to remove it and forbid catalog updates or remove it and allow catalog updates? (I hope its latter :) On Tue, 23 Jan 2001, Tom Lane wrote: > Peter Eisentraut <[EMAIL PROTECTED]> writes: > > While I'm at it and before I forget the 76 places one needs to edi

Re: [HACKERS] Nothing larger then int8?

2001-01-17 Thread Alex Pilosov
To answer your question, wouldn't numeric(30,0) be the correct? -alex On Thu, 18 Jan 2001, The Hermit Hacker wrote: > > hrrmm ... ignore this ... I'm suspecting that what I did was copied in > sum() data from an old table that had bytes declared as int4, without > casting it to int8 before stor

[HACKERS] renaming indices?

2001-01-16 Thread Alex Pilosov
I'm running into a problem where I have to create an index with a name that doesn't conflict with any existing index. Currently, its not possible to do in postgres. It'd be nice if either of 3 were implemented: 1) alter index to rename it 2) alter table would rename index with some option(?)

Re: [HACKERS] Well, we seem to be proof against cache-inval problemsnow

2001-01-05 Thread Alex Pilosov
On Fri, 5 Jan 2001, Tom Lane wrote: > I just finished running the parallel regress tests with inval.c rigged > to flush the relcache and syscache at every available opportunity, > that is anytime we could recognize a shared-cache-inval message from > another backend (see diff below). This setup

Re: [HACKERS] GNU readline and BSD license

2000-12-30 Thread Alex Pilosov
On Sat, 30 Dec 2000, Peter Bierman wrote: > At 7:15 PM -0500 12/29/00, Tom Lane wrote: > >Alfred Perlstein <[EMAIL PROTECTED]> writes: > >> Rasmus Lerdorf warned one of you guys that simply linking to GNU > >> readline can contaminate code with the GPL. > > > >> Readline isn't LGPL which permits

Re: [HACKERS] GNU readline and BSD license

2000-12-29 Thread Alex Pilosov
On 29 Dec 2000, Michael Alan Dorman wrote: > Peter Eisentraut <[EMAIL PROTECTED]> writes: > > If there is something functionally wrong with Readline then let's talk > > about it, but let's not replace it with something because some PHP dude > > said that RMS said something. > > ncftp used to be

Re: [HACKERS] GNU readline and BSD license

2000-12-23 Thread Alex Pilosov
On Sat, 23 Dec 2000, Bruce Momjian wrote: > OK, but does shipping our code with hooks obligate us? We don't ship > readline. Oh, oops. I didn't know readline wasn't in the postgres tree. Then, obviously, distribution of .tar.gz does not obligate postgres to anything, HOWEVER, the problem arises

Re: [HACKERS] GNU readline and BSD license

2000-12-23 Thread Alex Pilosov
On Sat, 23 Dec 2000, Bruce Momjian wrote: > Rasmus Lerdorf, the big PHP developer, told me that the existance of GNU > readline hooks in our source tree could cause RMS/GNU to force us to a > GNU license. > > Obviously, we could remove readline hooks and ship a BSD line editing > library, but do

Re: [HACKERS] CIDR output format

2000-12-21 Thread Alex Pilosov
On Thu, 21 Dec 2000, Tom Lane wrote: > Value Default output text() abbrev() > > '127.0.0.1/32'::inet 127.0.0.1 127.0.0.1/32127.0.0.1 > '127.0.0.1/32'::cidr 127.0.0.1/32127.0.0.1/32127.0.0.1/32 > '127/8'::cidr 127.0.0.0/8 127.0.0.0/8 1

Re: [HACKERS] performance modality in 7.1 for large text attributes?

2000-12-19 Thread Alex Pilosov
Paul, 1) Have you ran vacuum analyze after all these inserts to update database statistics? :) Without vacuum, pgsql will opt to table scan even when there's an index. 2) I'm not sure if you are executing pgcat 70k times or executing inner loop in pgcat 70k times. Postgres connection establishme

Re: [HACKERS] beta testing version

2000-11-30 Thread Alex Pilosov
On Thu, 30 Nov 2000, Nathan Myers wrote: > After a power outage on an active database, you may have corruption > at low levels of the system, and unless you have enormous redundancy > (and actually use it to verify everything) the corruption may go > undetected and result in (subtly) wrong answe

Re: [HACKERS] Summary: what to do about INET/CIDR

2000-11-03 Thread Alex Pilosov
Agreed with all of it, but how about incorporating conversion from inet to int8? (first octet*256*256*256+second octet*256*256+third octet*256+fourth octet). This will allow to do a lot of magic with addresses using plain math. Also, I'd still like netmask_length, length of netmask in bits. -a

RE: [HACKERS] relation ### modified while in use

2000-11-02 Thread Alex Pilosov
On Fri, 3 Nov 2000, Hiroshi Inoue wrote: > PL/pgSQL already prepares a plan at the first execution > time and executes the plan repeatedly after that. > We would have general PREPARE/EXECUTE feature in the > near fututre. IMHO another mechanism to detect plan invali > dation is needed. Excellent

Re: [HACKERS] Summary: what to do about INET/CIDR

2000-10-27 Thread Alex Pilosov
On Fri, 27 Oct 2000, Tom Lane wrote: > BTW, does it strike anyone else as peculiar that the host(), > broadcast(), network(), and netmask() functions yield results > of type text, rather than type inet? Seems like it'd be considerably > more useful if they returned values of type inet with mask

Re: [HACKERS] Summary: what to do about INET/CIDR

2000-10-27 Thread Alex Pilosov
On Fri, 27 Oct 2000, Tom Lane wrote: > A more interesting question is whether the system needs to provide any > assisting functions that aren't there now. The lookup function you guys > are postulating seems like it would be (in the simple cases) > create function my_network(inet) returns

Re: [HACKERS] Re: [GENERAL] A rare error

2000-10-27 Thread Alex Pilosov
> (SELECT * INTO newtable FROM table1) UNION (SELECT * FROM table2); Possibly a silly (and definitely not standards-conformant) suggestion: Maybe grammar should be amended to allow for (SELECT * FROM table1) UNION (SELECT * FROM table2) INTO newtable i.e. union_expr: (select_expr) union (unio

Re: [HACKERS] Summary: what to do about INET/CIDR

2000-10-27 Thread Alex Pilosov
one more small request: int8_inet(inet) and inet_int8(int8): functions to convert an inet to an int8 and back. (not an int4, since postgres int4s are signed) This allows me to do some additional manipulations on values. (ie. given a host, determine its default gateway, for us, it is always first

Re: [HACKERS] Summary: what to do about INET/CIDR

2000-10-27 Thread Alex Pilosov
On Fri, 27 Oct 2000, Tom Lane wrote: > BTW, does it strike anyone else as peculiar that the host(), > broadcast(), network(), and netmask() functions yield results > of type text, rather than type inet? Seems like it'd be considerably > more useful if they returned values of type inet with maskl

Re: [HACKERS] Summary: what to do about INET/CIDR

2000-10-27 Thread Alex Pilosov
Please read below if the whole thing with inet/cidr doesn't make you puke yet ;) The semi-longish proposal is at the bottom. On Fri, 27 Oct 2000, Tom Lane wrote: > Alex Pilosov <[EMAIL PROTECTED]> writes: > > We should have as much error-checking as possible. > > How

Re: [HACKERS] Summary: what to do about INET/CIDR

2000-10-27 Thread Alex Pilosov
On Fri, 27 Oct 2000, Larry Rosenman wrote: > Not necessarily, especially for novices. Some people may want to > store the netmask with the IP of a host (think ifconfig being > AUTOGEN'd). For a single host? Or for a network of hosts? But yes, I see your point if a single host has x interfaces,

Re: [HACKERS] Summary: what to do about INET/CIDR

2000-10-27 Thread Alex Pilosov
On Fri, 27 Oct 2000, Tom Lane wrote: > Alex Pilosov <[EMAIL PROTECTED]> writes: > > Also, I agree with Larry that cidr _must_ be printed with 4 octets in > > them, whether they are 0 or not. (i.e. it should print 207.158.72.0/24) > > > This is the standard way

Re: [HACKERS] Summary: what to do about INET/CIDR

2000-10-27 Thread Alex Pilosov
On Fri, 27 Oct 2000, Tom Lane wrote: > The way I'm visualizing this, INET is a generalized type that will store > any 4-octet address plus any netmask width from 1 to 32. This includes > not only host addresses, but network specs and broadcast addresses. > CIDR is a subset type that only accepts

Re: [HACKERS] Summary: what to do about INET/CIDR

2000-10-27 Thread Alex Pilosov
On Fri, 27 Oct 2000, Tom Lane wrote: > Larry Rosenman <[EMAIL PROTECTED]> writes: > > OK, what I really meant was a way to coerce a CIDR entity to INET so > > that host() can work with a CIDR type to print all 4 octets. > > Hm. I don't see any really good reason why host() rejects CIDR input

Re: [HACKERS] Summary: what to do about INET/CIDR

2000-10-27 Thread Alex Pilosov
On Fri, 27 Oct 2000, Larry Rosenman wrote: > and network(cidr) should print ONLY the octets, not the mask... Agreed. There's a function to get the mask size, and the network should just return the network. Otherwise, it is impossible to use. -alex

Re: [HACKERS] Summary: what to do about INET/CIDR

2000-10-27 Thread Alex Pilosov
On Fri, 27 Oct 2000, Larry Rosenman wrote: > ler=# select * from ler_test; > net | host > ---+-- > 207.158.72/24 | 207.158.72.11/24 > (1 row) > > ler=# select host(net::inet) from ler_test; > ERROR: CIDR type has no host part > ERROR: CIDR type has

[HACKERS] sanity of using -current?

2000-10-26 Thread Alex Pilosov
I need some of features (union in views, in particular) which are only available in 7.1-current. How insane would be to try it on production server? Are there known bugs that could cause loss of data or loss of updates? Or just newer features aren't polished yet? Also, where is cvs repository? Is

Re: [HACKERS] relation ### modified while in use

2000-10-22 Thread Alex Pilosov
On Mon, 23 Oct 2000, Tom Lane wrote: > begin; > select * from foo; -- gets AccessShareLock > LOCK TABLE foo; -- gets AccessExclusiveLock > ... > end; > > this will work currently because the SELECT releases AccessShareLock > when done, but it will deadlock if S

Re: [HACKERS] relation ### modified while in use

2000-10-22 Thread Alex Pilosov
On Mon, 23 Oct 2000, Alex Pilosov wrote: > On Mon, 23 Oct 2000, Tom Lane wrote: > > > when done, but it will deadlock if SELECT does not release that lock. > > > > That's annoying but I see no way around it, if we are to allow > > concurrent transactions t

Re: [HACKERS] relation ### modified while in use

2000-10-22 Thread Alex Pilosov
On Mon, 23 Oct 2000, Tom Lane wrote: > when done, but it will deadlock if SELECT does not release that lock. > > That's annoying but I see no way around it, if we are to allow > concurrent transactions to do schema modifications of tables that other > transactions are using. I might be in above

Re: [HACKERS] relation ### modified while in use

2000-10-22 Thread Alex Pilosov
ers" NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE "RI_FKey_noaction_del" ('', 'cc_charges', 'customers', 'UNSPECIFIED', 'cust_id', 'cust_id'); CREATE CONSTRAINT TRIGGER "" AFTER UPDATE ON "cus

[HACKERS] relation ### modified while in use

2000-10-22 Thread Alex Pilosov
I'm having the error 'relation modified while in use' fairly often. It is the same relation that's always giving a problem. Usually after all currently-running backends die away with that error, error disappears. If I shutdown, ipcclean, start up postgres, it also disappears. What causes this?

Re: [HACKERS] time stops within transaction

2000-10-18 Thread Alex Pilosov
On Wed, 18 Oct 2000, Tom Lane wrote: > I think what you are advocating is recomputing now() at each statement > boundary within a transaction, but that's not as simple as it looks > either. Consider statement boundaries in an SQL function --- the > function is probably being called from some out

[HACKERS] time stops/workaround

2000-10-17 Thread Alex Pilosov
Strangely, the same thing does not happen when I do timenow() instead of time(). This is very counter-intuitive, if this is the way it is supposed to work, at least docs should be saying that. Also, I checked, and its probably not the fmgr cache, since now() is set to be noncacheable... -alex

[HACKERS] time stops within transaction

2000-10-17 Thread Alex Pilosov
I just ran into a strangest thing: within transaction, select now() will always return time when transaction started. Same happens with select 'now'::timestamp. This is with 7.0. I have not tested it with CVS. I am not sure what causes this. I assume that result of now() is cached by fmgr. Is th

[HACKERS] bug: alter table/FK

2000-10-17 Thread Alex Pilosov
I don't know if this has been fixed or not, but alter table will not adjust RI/FK triggers on the table. I.E: create table foo (a int4 primary key) create table bar (b int4 references foo) alter table foo rename to foo2 now, updates to foo will either crash or hang postgres. What needs to be

[HACKERS] newbieish exception/multilevel transactions

2000-10-08 Thread Alex Pilosov
Hi, I was wondering, is it a possibility/projected to have nested transactions in postgres? Would MVCC support that? What I would like is following: begin tran a; do some work; begin tran b; do some other work rollback b; ... commit a; Alternatively, is there a way to trap an except

Re: [HACKERS] What's happening with pgsql-committers?

2000-10-07 Thread Alex Pilosov
On Sat, 7 Oct 2000, The Hermit Hacker wrote: > On Tue, 3 Oct 2000, Tom Lane wrote: > > > Peter Eisentraut <[EMAIL PROTECTED]> writes: > > > Has anybody been getting pgsql-committers messages the last few days? > > > > Coming through fine for me (at least when hub.org isn't wedged > > completely

[HACKERS] inheritance question 2/ref integrity

2000-10-07 Thread Alex Pilosov
Can I do following? create table foo ( x int4 references bar* ) Or, since 7.1 will have bar* as default for bar, will using 'references bar' do what I want? -alex

[HACKERS] inheritance/oid questions

2000-10-07 Thread Alex Pilosov
Suppose I have table a and b (b inherits a). Then I do select * from a*; Now, I'd like to know which table this particular row came from (a or b). Is this possible? Or do I have to have a column where I'd store what kind of object this is? -alex

Re: [HACKERS] Patch for TNS services

2000-10-07 Thread Alex Pilosov
Sorry for replying to the fairly old messages, but I just had time to open my pgsql mailbox: I would _love_ if your implementation can also implement TNS-style failover, i.e. having multiple /etc/pg_service.conf entries with same name. When replication is available, this will provide a efficient