Re: [GENERAL] testing castability of VARCHAR data to INET/CIDR

2005-07-23 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-07-23 06:04:55 -0600: > On Sat, Jul 23, 2005 at 11:31:23AM +0200, Roman Neuhauser wrote: > > > > I have a VARCHAR column containing mostly ip addresses, with an > > occasional piece of junk, and would like to transfer this data to an > > I

[GENERAL] testing castability of VARCHAR data to INET/CIDR

2005-07-23 Thread Roman Neuhauser
Hello, I have a VARCHAR column containing mostly ip addresses, with an occasional piece of junk, and would like to transfer this data to an INET column. The UPDATE (SET inet_col = CAST(vc_col AS INET)) aborts as soon as it hits an invalid datum. I'm looking for a way to add something like WHERE IS

Re: [GENERAL] Wishlist?

2005-07-22 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-07-22 12:41:25 +1000: > Tom Lane wrote: > >Bruno Wolff III <[EMAIL PROTECTED]> writes: > >>What happens if there is more than one existing function with that name > >>already. Do all of the old functions get deleted? > > > >What happens if there are existing references to

Re: [GENERAL] problem casting varchar to inet

2005-07-22 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-07-22 06:50:58 -0600: > On Fri, Jul 22, 2005 at 02:20:31PM +0200, Roman Neuhauser wrote: > > > > select cast(coalesce(nullif('', trim(callingip)), '127.0.0.1') as inet) > > > > ERROR: invalid input syntax for type ine

[GENERAL] problem casting varchar to inet

2005-07-22 Thread Roman Neuhauser
select cast(coalesce(nullif('', trim(callingip)), '127.0.0.1') as inet) ERROR: invalid input syntax for type inet: "" what is it trying to tell me? -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. htt

Re: [GENERAL] Insert into ... Select ... From ... too intelligent transaction

2005-07-22 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-07-22 13:04:27 +0200: > > > > # [EMAIL PROTECTED] / 2005-07-22 09:10:01 +0200: > > > > # [EMAIL PROTECTED] / 2005-07-21 19:11:04 +0200: > > > > > I use some updateable views to handle my data (which are > > > > > amazingly slow), which gives me ultimate flexibility to

Re: [GENERAL] Insert into ... Select ... From ... too intelligent transaction

2005-07-22 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-07-22 09:10:01 +0200: > > # [EMAIL PROTECTED] / 2005-07-21 19:11:04 +0200: > > > I use some updateable views to handle my data (which are amazingly > > > slow), which gives me ultimate flexibility to handle my data. > > > > > > there are some insert rules which use curr

Re: [GENERAL] Insert into ... Select ... From ... too intelligent transaction

2005-07-21 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-07-21 19:11:04 +0200: > I use some updateable views to handle my data (which are amazingly > slow), which gives me ultimate flexibility to handle my data. > > there are some insert rules which use currval() to get the last > sequence id for my data which I have to inser

Re: [GENERAL] function execution problem - plpgsql

2005-07-21 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-07-21 10:18:05 +0200: > I have two functions: funcA() drops a row from table A, funcB() drops a > row from table B that references table A. funcA() calls funcB() and > issues a delete command after returning from funcB(). I get an error, > stating that it can not be done,

Re: [GENERAL] Quotation marks in queries

2005-07-20 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-07-20 12:43:48 +0100: > Tony Caduto wrote: > >The easiest solution is just not to use caps or spaces in your > >table/object names, there is no advantage to doing so. > >People just need to get over the fact that having caps in a name make it > >easier to read. > > > >M

Re: [GENERAL] Case insensitive unique constraint

2005-07-14 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-07-14 02:14:16 -0500: > I have a simple table to store account names... I want each name to be > unique in a case insensitive manner... but I want the case the user > enters to be remembered so I can't do a simple lower() on the data's way in. CREATE TABLE tbl (col

Re: [GENERAL] To Postgres or not

2005-07-13 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-07-14 00:57:57 -0400: > On Thu, Jul 14, 2005 at 02:46:01PM +1000, Neil Conway wrote: > > Vivek Khera wrote: > > >The first sentence rules out MySQL, so the second sentence should read > > >"So that leaves Postgres". Your problem is solved ;-) > > > > > >(If you are acc

Re: [GENERAL] 7.4.7: strange planner decision

2005-07-13 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-07-13 15:58:09 +0200: > # dev@archonet.com / 2005-07-13 14:09:34 +0100: > > Roman Neuhauser wrote: > > >callrec32=# \d fix.files > > > Table "fix.files" > > >

Re: [GENERAL] 7.4.7: strange planner decision

2005-07-13 Thread Roman Neuhauser
# dev@archonet.com / 2005-07-13 14:09:34 +0100: > Roman Neuhauser wrote: > >callrec32=# \d fix.files > > Table "fix.files" > > Column | Type | Modifiers > >++--- &

Re: [GENERAL] 7.4.7: strange planner decision

2005-07-13 Thread Roman Neuhauser
# dev@archonet.com / 2005-07-13 12:57:31 +0100: > Roman Neuhauser wrote: > >Why does the planner want to crawl the table that has 5M rows instead of > >the one > >with 176k rows? Both tables are freshly vacuum-full-analyzed. > > Because you don't have an ind

[GENERAL] 7.4.7: strange planner decision

2005-07-13 Thread Roman Neuhauser
Why does the planner want to crawl the table that has 5M rows instead of the one with 176k rows? Both tables are freshly vacuum-full-analyzed. 7.4.7 on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 3.4.3 20041212 (Red Hat 3.4.3-9.EL4) callrec32=# explain select fd.base from fix.dups fd join f

Re: [GENERAL] Update more than one table

2005-07-12 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-07-12 12:11:45 -0500: > On Tue, Jul 12, 2005 at 17:35:35 +0200, > Roman Neuhauser <[EMAIL PROTECTED]> wrote: > > # [EMAIL PROTECTED] / 2005-07-12 10:08:37 -0500: > > > On Sun, Jul 10, 2005 at 15:05:30 -0300, > > > David Pratt <

Re: [GENERAL] Update more than one table

2005-07-12 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-07-12 10:08:37 -0500: > On Sun, Jul 10, 2005 at 15:05:30 -0300, > David Pratt <[EMAIL PROTECTED]> wrote: > > Hi Roman. Many thanks for your reply. This is interesting and will I > > give this a try and let you know how it works out. With

Re: [GENERAL] Update more than one table

2005-07-10 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-07-09 22:55:26 -0300: > Hi. I have a form that collects information from the user but then I > need to update three separate tables from what the user has submitted. > I could do this with application logic but I would feel it would be > best handled in Postgres as a t

Re: [GENERAL] Postfix/Maildrop and too many connections issues

2005-06-27 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-06-23 17:25:03 -0400: > On Thu, 2005-06-23 at 03:39 +, Karl O. Pinc wrote: > > On 06/22/2005 08:23:43 AM, Sven Willenberger wrote: > > > On Wed, 2005-06-22 at 01:30 +0200, Roman Neuhauser wrote: > > > > # [EMAIL PROTECTED] / 2005-06-2

Re: [GENERAL] Postfix/Maildrop and too many connections issues

2005-06-21 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-06-21 15:00:12 -0400: > We have a system set up whereby postfix and maildrop gather user info > from a pg database (7.4.2 on FreeBSD 5.2.1) to do local mail acceptance > and delivery. I have configured max connections at 512 but I find that > this is not enough and I get

Re: [GENERAL] subqueries

2005-06-20 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-06-20 01:02:38 +0200: > I wanted to define a function like this: > create or replace function fun(...)... > create temp table qaz as subquery1; > create temp table wsx as subquery1; > select * from qaz, wsx; > language sql; > but I get postgresql error saying that relatio

Re: [GENERAL] how to return a result set from a stored procedure

2005-06-15 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-06-11 08:44:32 -0400: > Hi everybody > > I am trying to write a stored procedure that returns a result set but it is > not working > this is the function: > /// > CREATE OR REPLACE FUNCTION > remisiones.fn_get_total_remitidoxprovision1("numeric") > > RETURNS SETOF reco

Re: [GENERAL] Deleting orphaned records to establish Ref Integrity

2005-06-08 Thread Roman F
cided not to try Tom's temp table method because I was afraid the generated table would be very large, so the subsequent DELETE .. WHERE NOT IN (...) would cause swapping again. Thanks all for your help, your insights saved me a lot of headache. Roman

Re: [GENERAL] postgresql 8 abort with signal 10

2005-06-02 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-05-03 17:56:53 -0300: > The FreeBSD is the last STABLE version. I can try to change some > hardware, I already changed memory, what can I try now ? the processor > ? motherboard ?? > On 5/3/05, Scott Marlowe <[EMAIL PROTECTED]> wrote: > > On Tue, 2005-05-03 at 15:04,

[GENERAL] Deleting orphaned records to establish Ref Integrity

2005-06-01 Thread Roman F
ld restore these tables on an 8.0.3 server if it would make things go faster! Thanks, Roman _ Check All Email Accounts Anywhere! Check your POP3 and webmail account from any PC. With no ads http://www.fusemail.com _ Consol

Re: [GENERAL] Shared memory and FreeBSD's jail()

2005-06-01 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-05-19 12:14:58 -0400: > lister <[EMAIL PROTECTED]> writes: > > This was the topic of 20 minutes of conversation in 2 tutorials > > at BSDCan. > > Well, if the BSD people are so concerned about it, why don't they fix > their bleedin' OS? It's inexcusable to have a "jail

Re: [GENERAL] date problem

2005-05-16 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-05-16 09:48:08 +0200: > I am attempting to select records where one of the dates is the latest > date before today > > select max(date) from expo where date < now() > > works for one record but other fields I need must be in aggregate or > grouped. Is there a simple SQL

Re: [GENERAL] How to query pgsql from a BASH script ?

2005-04-08 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-04-03 11:14:54 -0700: > On Sunday 03 April 2005 07:16 am, Michelle Konzack wrote: > > I am puzzeling around, how to query a postgresql from a BASH script. > > Generaly it must do nothing else as > > I recently came across this program-ShellSQL. I haven't had time to try i

Re: [GENERAL] row numbering

2005-03-09 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-03-01 17:41:46 +0100: > > > There are 5 vaccinations in a given vaccination schedule. > > > > > > Patient had 3 shots. > > > > > > I want the view to show me that shot 4 and 5 are missing > > > without having to enter the cardinality of the vaccination in > > > the origin

[GENERAL] recent buffer overruns in plpgsql

2005-02-18 Thread Roman Neuhauser
I have a few questions regarding (or related to) the recent SELECT INTO fixes in plpgsql. * There hasn't been an official announcement as far as I can tell. All I could find is a mention in David Fetter's Weekly News. Is the risk so low it doesn't warrant informing users? * What are the plans

Re: [GENERAL] pgpool 2.5b2 released

2005-02-06 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-02-06 09:34:53 -: > Since I posted my original question, I realized that pgpool notes a > failure of either master or slave in its log. Would we want something > more proactive? snmp? -- If you cc me or remove the list(s) completely I'll most likely ignore you

Re: [GENERAL] SQL query question

2005-02-03 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-02-02 23:32:28 -0800: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > Maybe it's to late for me to think correctly (actually I'm sure of > that). I'm going to ask anyways. I have a table like > > id int4 > user_id int4 > photo varchar > image_type char(1) > >

Re: [GENERAL] Extended unit

2005-01-25 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-01-25 10:40:15 +0100: > I add use in my time in University some software that use "extended > type". > For each variable, we define the mandatory "classic type" as integer, > float, double array of. > And we define an optional "extended type" as the unit in the MKSA >

Re: [GENERAL] Unique Index

2005-01-19 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-01-20 01:35:32 +1100: > i have a unique index on a table over multiple columns. If now one of > the records has a null value in one of the indexed columns i can insert > the same record multiple times. > > Is this a problem within postgres or expected? In SQL, NUL

Re: [GENERAL] Infinite recursion detected... How do I prevent that?

2005-01-19 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-01-19 14:57:47 +0100: > I have a rule similar to this: > > CREATE RULE rule_branch_delete AS > ON DELETE TO tree > DO DELETE > FROM tree > WHERE ancestor_id IS NOT NULL > AND OLD.child_id = ancestor_id; > If I try a delete on the tree table I get "Infinit

Re: [GENERAL] Index optimization ?

2005-01-16 Thread Roman Neuhauser
# kleptog@svana.org / 2005-01-16 17:48:08 +0100: > On Sun, Jan 16, 2005 at 05:30:22PM +0100, Bo Lorentsen wrote: > > >One could conceivably attempt to make a functional index using > > >plus_random(), but the result it gives every time is indeterminant. > > >How would you be able to usefully sear

Re: [GENERAL] pl/pgsql trigger: syntax error at or near "ELSEIF"

2005-01-14 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-01-14 13:27:24 +0100: > Roman Neuhauser wrote: > >Hello, what is the parser trying to tell me? (7.4.2 if it matters) > >test'# ELSEIF TG_OP = ''DELETE'' THEN > > You typed ELSEIF, the parser doesn't kn

[GENERAL] pl/pgsql trigger: syntax error at or near "ELSEIF"

2005-01-14 Thread Roman Neuhauser
Hello, what is the parser trying to tell me? (7.4.2 if it matters) test=# CREATE OR REPLACE FUNCTION SYNC_COUPLECOUNT() test-# RETURNS TRIGGER test-# AS ' test'# BEGIN test'# IF TG_OP = ''INSERT'' THEN test'# UPDATE _calls test'# SET test'# realcouplecou

Re: [GENERAL] int4 -> unix timestamp -> sql timestamp; abstime?

2005-01-11 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-01-11 19:31:19 -0500: > Roman Neuhauser <[EMAIL PROTECTED]> writes: > >> The recommended locution is > >> > >> SELECT TIMESTAMP WITH TIME ZONE 'epoch' + * INTERVAL '1 second'; > > > Have I missed thi

Re: [GENERAL] int4 -> unix timestamp -> sql timestamp; abstime?

2005-01-11 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-01-11 18:35:18 -0500: > Roman Neuhauser <[EMAIL PROTECTED]> writes: > > what is the opposite of cast(extract('epoch' from now()) as int)? > > The only thing I found that works is > > cast(cast(... as abstime) as timestamp) > > a

[GENERAL] int4 -> unix timestamp -> sql timestamp; abstime?

2005-01-11 Thread Roman Neuhauser
Hello, what is the opposite of cast(extract('epoch' from now()) as int)? The only thing I found that works is cast(cast(... as abstime) as timestamp) and the documentation says abstime shouldn't be used, and may disappear. What should I use instead? -- FreeBSD 4.10-STABLE 12:01AM up 15:39, 7 use

[GENERAL] Resolved: PostGreSQL - Accessing It

2003-08-14 Thread Mel Roman
out my problem. As you can see from my CREATE USER command above, I simply forgot to put the semicolon at the end. Doah! I guess it's been a little while since I've done much SQL. I've since successfully made myself a user and life is good. Thanks for eve

Re: [GENERAL] PostGreSQL - Accessing It

2003-08-14 Thread Mel Roman
n internal slash commands \g or terminate with semicolon to execute query \q to quit test=# CREATE USER mel CREATEDB test-# \q bash-2.05b$ exit exit [EMAIL PROTECTED] mel]$ psql test p

Re: [GENERAL] PostGreSQL - Accessing It

2003-08-14 Thread Mel Roman
onfirms that I first need to connect as this predefined user, but doesn't say what that user's password is. How can I find out the password for user postgres so that I can finally begin working with this database? TIA, -- Mel Roman [EMAIL PROTECTED] ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[GENERAL] permissions question

2001-08-17 Thread Roman Havrylyak
Suppose we have table A and table B. When action is performed on table A (for example INSERT), some action (for example UPDATE) through the trigger is done on table B. If user had permission on both tables (GRANT INSERT on table A and GRANT UPDATE on table B)- everything is good. But in that way

[GENERAL] rotating table question

2001-08-17 Thread Roman Havrylyak
Suppose we have table with indexes, attached triggers, and finnaly alot of records (more then 100,000). Records are adding continuously. Once a month you have to do archiving of records. Simple INSERT INTO ARCHIV followed by DELETE and then VACUUM take alot of time, offen even hang up sessions. D

[GENERAL] small question

2001-08-17 Thread Roman Havrylyak
Suppose we have table A and table B. When action is performed on table A (for example INSERT), some action (for example UPDATE) through the trigger is done on table B. If user had GRANT permission on both tables - everything is good. But in that way user can get access to table B directly. If I

[GENERAL] Apache, php3 & PostgreSQL

1998-06-15 Thread Roman Volkoff
lp me? - [EMAIL PROTECTED] Roman Volkoff

<    1   2