Re: [GENERAL] Question about COPY command

2009-01-09 Thread Ragnar Hafstað
On fim, 2009-01-08 at 08:39 -0500, Josh Harrison wrote: > Hi, > A basic question about the COPY command syntax > This is the syntax in the postgres manual. > > COPY tablename [ ( column [, ...] ) ] > > FROM { 'filename' | STDIN } > .. > . > > What is the difference between copy

Re: [GENERAL] Invocation overhead for procedural languages

2008-08-06 Thread Ragnar
On mið, 2008-08-06 at 20:48 +0200, Giorgio Valoti wrote: > On 06/ago/08, at 16:04, Pavel Stehule wrote: > > > > > it's depend. Start of interpret is only one overhead. > > Other is date > > conversions to language compatible types (without C and plpgsql). > So is plpgsql slower on date conversio

Re: [GENERAL] is a 'pairwise' possible / feasible in SQL?

2008-08-04 Thread Ragnar
On mán, 2008-08-04 at 17:00 -0400, Rajarshi Guha wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > On Aug 4, 2008, at 4:55 PM, Francisco Reyes wrote: > > On 2:08 pm 08/04/08 Rajarshi Guha <[EMAIL PROTECTED]> wrote: > >> paircount > >> - - > >> 123 & 456 1 >

Re: [GENERAL] Problem running script

2008-07-30 Thread Ragnar
On fös, 2008-07-25 at 10:20 -0700, Sushma Sagaram wrote: > My requirement is > 1) to write a query in a file, read the input from that file, run in > postgresql and write the output(query results) into a file. I'm not > able to use combination of \i and \o see psql --help in particular the opti

Re: [GENERAL] Must be table owner to truncate?

2008-07-30 Thread Ragnar
On mið, 2008-07-30 at 07:36 -0400, Kevin Hunter wrote: > At 3:45p -0400 on Mon, 28 Jul 2008, Said Ramirez wrote: > > According to the documentation, > > http://www.postgresql.org/docs/current/interactive/sql-truncate.html , > > only the owner can truncate a table. Which means the non-owner must >

Re: [GENERAL] optimizer ignoring primary key and doing sequence scan

2008-07-15 Thread Ragnar
On þri, 2008-07-15 at 08:19 +0200, Edoardo Panfili wrote: > Scott Marlowe ha scritto: > > On Mon, Jul 14, 2008 at 1:54 PM, Chris Hoy <[EMAIL PROTECTED]> wrote: > >> > >> select * from industries where industryid = 1; > >> "Seq Scan on industries (cost=0.00..1.02 rows=1 width=116) (actual > >> time

Re: [GENERAL] Query Problem

2008-07-06 Thread Ragnar
On lau, 2008-07-05 at 23:04 +, Sheikh Salman Ahmed wrote: > Hi Fellows > > I still have problem to access my databank.It shows syntax problem,I > am using VC++ 2005 with postgresql 8.3.My table name is Person and it > has three column,Person ID,first name and last name (testing > version).who

Re: [GENERAL] Advice Wanted on Selecting Multi-row Data Requests in 10-Row Blocks

2008-06-27 Thread Ragnar
Hello apart from the increasing OFFSET method, you only need to traverse the results sequentially, you can do a variant of this: let us assume your resultset has a a unique column pk, and is ordered on column o: initial select: select * from foo order by o limit 10; next page select * from

Re: [GENERAL] first message: SELECT FROM

2008-02-02 Thread Ragnar
On lau, 2008-02-02 at 15:43 -0200, Aílsom F. Heringer wrote: > At pgAdmin III Query, when I send SELECT * FROM USUARIOS, I get all > columns correctly. But when I try to get only one column, SELECT senha > FROM USUARIOS, I get the error message: > > ERROR: column "senha" does not exist > SQL stat

Re: [GENERAL] Postgres High Availablity Solution needed for hot-standby and load balancing

2007-12-02 Thread Ragnar Heil
rcluster.pdf Anyone has made experiences with it? thanks Ragnar From: Usama Dar [mailto:[EMAIL PROTECTED] Sent: Freitag, 30. November 2007 10:35 To: Ragnar Heil Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Postgres

Re: [GENERAL] Postgres High Availablity Solution needed for hot-standby and load balancing

2007-12-01 Thread Ragnar Heil
WHich solution are you using now, Guido? Has anyone made experiences with cybercluster? I am thankful to hear comments and especially comparision to other products thanks Ragnar > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Guid

[GENERAL] Fault Tolerance & Master-master-Replication Solution needed

2007-11-30 Thread Ragnar Heil
able. Load Balancing is wanted for the future. Do you have experience with Cybercluster or Continuent uni/cluster? Sounds very promising. best regards Ragnar ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

[GENERAL] Postgres High Availablity Solution needed for hot-standby and load balancing

2007-11-29 Thread Ragnar Heil
regards Ragnar ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] Are these two creation commands functionally identical?

2007-08-11 Thread Ragnar
On fim, 2007-08-09 at 20:55 +, [EMAIL PROTECTED] wrote: > I want to to know if these two are functionally equivalent. Is this: > > Create table "sales" > ( > "saleid" BigSerial NOT NULL, > "userid" Bigint NOT NULL, > "parent_saleid" Bigint NOT NULL, > primary key ("saleid")

Re: [GENERAL] create table liek view

2007-08-07 Thread Ragnar
On þri, 2007-08-07 at 15:23 +0200, Filip Rembiałkowski wrote: > [EMAIL PROTECTED] create view v as select 1::int; > CREATE VIEW > [EMAIL PROTECTED] select * from v; > int4 > -- > 1 > (1 row) > [EMAIL PROTECTED] create table t ( like v); > ERROR: inherited relation "v" is not a table > >

Re: [GENERAL] [SQL] Using function like where clause

2007-08-07 Thread Ragnar
On mán, 2007-08-06 at 16:44 -0300, Ranieri Mazili wrote: > 1) Can I use a function that will return a string in a where clause like > bellow? > > select * > from table > where my_function_making_where() > and another_field = 'another_think' you could have your function return a boolean

Re: [GENERAL] Help with date math

2007-07-21 Thread Ragnar
On fös, 2007-07-20 at 11:08 -0400, Chris Hoover wrote: > I need some help. I am trying to replicate a function from Sybase > ASA, and am having difficulty. > > I need to be able to subtract 2 date (or timestamps) and return the > results expressed in days, weeks, month, quarters, or years. How d

Re: [GENERAL] count the number of bits set to 1 in a bit string field

2007-07-15 Thread Ragnar
On sun, 2007-07-15 at 15:35 -0400, Rajarshi Guha wrote: > Hi, is there a built in function that will give me the number of bits > that are set to 1 in a bit string field? no, but it should be trivial to do with pl/pgsql a naive implementation could be: create or replace function bitsetlen(bit)

Re: [GENERAL] Database Insertion commitment

2007-07-09 Thread Ragnar
On mán, 2007-07-09 at 05:22 -0400, Jasbinder Singh Bali wrote: > > The only difference between you test case my a sample test case that I > would provide is the Perform part in the trigger function. > > In my program Perform part is about opening a socket connection with a > Unix Tools server th

Re: [GENERAL] How to obtain a sequence's increment value from the system catalog

2007-07-09 Thread Ragnar
have you tried: select * from my_seq; or are you looking for the functions currval() or lastval() http://www.postgresql.org/docs/8.2/interactive/functions-sequence.html gnari On mán, 2007-07-09 at 09:43 +0200, Wouter Gazendam wrote: > Hi, > > I'd like to query a sequence's increment value fro

Re: [GENERAL] Database Insertion commitment

2007-07-09 Thread Ragnar
On mán, 2007-07-09 at 03:34 -0400, Jasbinder Singh Bali wrote: > My scenario is something like this. I'll try to make it modular and > simple. > > Start Function A (Written in plperlu with no subtransactions) > Insert 1 on tbl_abc; (fires trigger A) > Insert 2 on tbl_abc; (fires trigger

Re: [GENERAL] Database Insertion commitment

2007-07-09 Thread Ragnar
On mán, 2007-07-09 at 11:24 +0400, Viatcheslav Kalinin wrote: > Jasbinder Singh Bali wrote: > > If I have a series of Insert statements within a loop in a function on > > the same table. > > Would an Insert be able to see the values of previous insert in that > > table ? > Functions are run in a

Re: [GENERAL] how to implement unusual constraint

2007-06-24 Thread Ragnar
On sun, 2007-06-24 at 09:54 +, danmcb wrote: > Say I have a table, say my_table, that is self-referencing. It looks > like this : > id integer pk, > orig_id integer references my_table(id), > Now this set of rows would be legal > > id/orig_id > 1 /1 > 2/1 > 3/1 > 4/4 > 5/4 > > but this not

Re: [GENERAL] Duplicate Key Violates Unique Contraint whenUpdating a table

2007-06-24 Thread Ragnar
On sun, 2007-06-24 at 17:58 +0800, carter ck wrote: > >From: Ragnar <[EMAIL PROTECTED]> > >On sun, 2007-06-24 at 16:55 +0800, carter ck wrote: > > > I am experiencing thgis problem since this morning. I seldom heard about > > > unique key constraint viola

Re: [GENERAL] Duplicate Key Violates Unique Contraint when Updating a table

2007-06-24 Thread Ragnar
On sun, 2007-06-24 at 16:55 +0800, carter ck wrote: > I am experiencing thgis problem since this morning. I seldom heard about > unique key constraint violation to happen when updating a table. > > It happens to 1 or few records at early stage, but then to all. > > My updating command is as foll

Re: [GENERAL] initdb

2007-06-17 Thread Ragnar
On sun, 2007-06-17 at 21:50 +, Ragnar wrote: > On sun, 2007-06-17 at 19:59 +0100, John K Masters wrote: > > I feel somewhat embarrassed to post this but I can't get past the first > > post with Postgresql. I have installed onto a Debian testing system, > > create

Re: [GENERAL] initdb

2007-06-17 Thread Ragnar
On sun, 2007-06-17 at 19:59 +0100, John K Masters wrote: > I feel somewhat embarrassed to post this but I can't get past the first > post with Postgresql. I have installed onto a Debian testing system, > created a space for the database cluster on /usr/local/pgsql/data, > changed owner to postgres

Re: [GENERAL] about cursors

2007-06-17 Thread Ragnar
On lau, 2007-06-16 at 18:58 -0700, Ottavio Campana wrote: > Martijn van Oosterhout wrote: > > > > Cursors are attached to the transactio and session, if either ends, the > > cursor dies with it... > > > > Have a nice day, > > another question: > > since they live in a transaction, how can they

Re: [GENERAL] Suppress checking of chmod 700 on data-dir?

2007-06-07 Thread Ragnar
On fim, 2007-06-07 at 10:38 +0200, Johannes Konert wrote: > Hi postgresql-listmembers, > for a backup-scenario I need to have access to the pgdata-directory as a > different shell-user, but postgresqul refuses to start if chmod is not > 700 on the directory. > > Is there a way to prevent postgr

Re: [GENERAL] Join field values

2007-06-05 Thread Ragnar
On þri, 2007-06-05 at 19:33 +0300, veejar wrote: > Hello! > > I have such field in my table: > > field1 > --- > 1 > 2 > 3 > 4 > 5 > > > I want to get such result from select: > '1,2,3,4,5' - join all values in field1 with ',' > // result must be varchar. > > Help to write SELECT-query f

Re: [GENERAL] Foreign keys and indexes

2007-06-05 Thread Ragnar
On þri, 2007-06-05 at 11:49 +0200, Marc Compte wrote: > Does PostgreSQL create an implicit index also for foreign keys? no > or must I create it explicitly? if you want one, yes. not everyone wants an index on all their foreign keys, but they can be useful in some circumstances. gnari --

Re: [GENERAL] simple select question

2007-06-04 Thread Ragnar
On mán, 2007-06-04 at 12:12 +0300, Erol KAHRAMAN wrote: > hi guys, > > i am newbie in postgresql. I need some help; i am trying to write > like this: > > select * from TABLE where IN ('value1','valeue2',) ... WHERE what IN (...) ? > but is it possible to give values from file. > > select

Re: [GENERAL] Return rows from function with expressions

2007-05-24 Thread Ragnar
On fim, 2007-05-24 at 13:59 -0700, novnov wrote: > I've written many stored procedures in ms sql and a good many functions in > postgres, but I'm rather unsure of how to get a list back from a postgres > function which is not based on a table. Example from sql server: > > set ANSI_NULLS ON > set Q

Re: [GENERAL] Views- Advantages and Disadvantages

2007-05-09 Thread Ragnar
On mið, 2007-05-09 at 12:46 +0530, Ashish Karalkar wrote: > I have found out some of them n are as follows, but I want more reasons > for not using views . I only got one > > Disadvantages: > 1) Performance : If a view is defined by complex multitable query,then > simple query against

Re: [GENERAL] turn off cache option

2007-04-05 Thread Ragnar
On fim, 2007-04-05 at 16:31 -0400, jungmin shin wrote: > > I'm executing a query invoking a UDF. > It looks that Postgres use a cache for executing UDFs. Postgresql is not using a cache specially for executing UDFs, apart from only compiling the function once for each session. > > select a()

Re: [GENERAL] stored queries and quoted strings

2007-04-02 Thread Ragnar
On fös, 2007-03-30 at 00:31 -0700, filippo wrote: > Hello, > > I have a strange problem with stored queries like this > > $sql = qq/ > SELECT city, country > FROM countries > WHERE city LIKE ? > ORDER BY city >/; > $sthCity= $dbh->prepare($sql);

Re: [GENERAL] queries stop using indexes

2007-04-02 Thread Ragnar
On lau, 2007-03-31 at 18:51 -0400, Jonathan Vanasco wrote: > I have a table with 15 cols , there is an joint index on 5 of them > > there are ~15million records in the table, and it gets heavy use via > update & insert > > i recently noticed that after a day of use, the index is no longer >

Re: [GENERAL] Query that does not use indexes

2007-03-28 Thread Ragnar
On þri, 2007-03-27 at 12:54 +0200, Denis Gasparin wrote: > I have a query that performs a multiple join between four tables and > that doesn't use the defined indexes. > If I set enable_seqscan to off, the query obviously uses the indexes and > it is considerable faster than normal planned executi

Re: [GENERAL] Question - Query based on WHERE OR

2007-01-12 Thread Ragnar
On mið, 2007-01-10 at 17:38 -0800, Mike Poe wrote: > I'm a rank newbie to Postgres & am having a hard time getting my arms > around this. > > I'm trying to construct a query to be run in a PHP script. I have an > HTML form were someone can enter either a last name or a social > security number &

Re: [GENERAL] Sorting

2007-01-08 Thread Ragnar
On mán, 2007-01-08 at 17:59 +0100, A. Kretschmer wrote: > am Mon, dem 08.01.2007, um 10:21:38 -0600 mailte Bart McFarling folgendes: > > I have a column that is a varchar(6) I need to sort it by the rows that are > > integers 1st then the character ones or vice versa, I just need the values > > t

Re: [GENERAL] Database versus filesystem for storing images

2007-01-05 Thread Ragnar
On fös, 2007-01-05 at 15:49 -0500, Andrew Chernow wrote: > I 100% agree. Use the database as a lookup into the filesystem. Don't load > the > database up with terabytes of non-searchable binary data? not sure how that > would help you? > > >I mean, how do you handle integrity with data >

Re: [GENERAL] About auto_increment

2007-01-02 Thread Ragnar
On mán, 2007-01-01 at 21:21 -0800, Yesh wrote: > I need to know how to increment a primary key field automatically in run > time. Will SERIAL do what you want? gnari ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send

Re: [GENERAL] Problem with index in OR'd expression

2007-01-01 Thread Ragnar
On mán, 2007-01-01 at 14:21 -0600, [EMAIL PROTECTED] wrote: > Within the context of the function (after calling), these variables are > constant and I'm attempting to use my OR syntax as shorthand to avoid > having to use a dynamic statement *only* because of this situation. > As I've mentioned,

Re: [GENERAL] could not open relation:no such file or directory

2006-12-30 Thread Ragnar
[ you should reply to the list, not only to single posters. this way, more people see your reply,and can help you. Putting the list back, and quoting whole message. ] On lau, 2006-12-30 at 15:17 +0530, karthik nandagiri wrote: > hello ragnar, > > i am using postgresql version8

Re: [GENERAL] could not open relation:no such file or directory

2006-12-29 Thread Ragnar
On þri, 2006-12-26 at 02:43 -0800, karthik wrote: > i facing a problem when trying to select values from a table in > postgresql. do you face this problem with any table or only from a particular table? >when i execute a query like "select title from itemsbytitle;" what do you mean by

Re: [GENERAL] Problem with index in OR'd expression

2006-12-27 Thread Ragnar
On mið, 2006-12-27 at 11:02 -0600, [EMAIL PROTECTED] wrote: > > I was referring to the situation where one has this in a WHERE clause: > >((vConstant IS NULL) OR (Table.IndexedCol = vConstant)) > > where vConstant is a *constant* parameter in a pl/pgsql function. Reguardless of the issue wh

Re: [GENERAL] Needed files - embedded postgres

2006-12-15 Thread Ragnar
On fös, 2006-12-15 at 16:59 +0100, Henrik Zagerholm wrote: > I think I need to specify what I mean with embedded. > Its not that we try to embed it into an application. > It is just run from a flash disk and the datafiles are put on > standard raid attached disks. > > Its an embedded device not

Re: [GENERAL] Needed files - embedded postgres

2006-12-15 Thread Ragnar
On fös, 2006-12-15 at 11:41 +0100, Henrik Zagerholm wrote: > Hello list, > I'm working on a project which tries to run postgre as a embedded > database. > > I'm know looking at start up scripts and initdb scripts. > > What are the necessary files for running initdb and running postgres > as a

Re: [GENERAL] Online index builds

2006-12-13 Thread Ragnar
On mið, 2006-12-13 at 11:05 +0100, Csaba Nagy wrote: > > Yeah, we could add defenses one by one for the cases we could think of, > > but I'd never feel very secure that we'd covered them all. > > What you all forget in this discussion is that reindexing concurrently > would have to be a highly adm

Re: [GENERAL] a question on SQL

2006-12-12 Thread Ragnar
On þri, 2006-12-12 at 16:47 +, Tomi N/A wrote: > Don't really know where to ask this...the general mailing list sounds > like the closest. > > Let's say I have three tables: owner, factory and product with a 1:N > relationship at each step. > Assuming that a product has a production date, how

Re: [GENERAL] error with Subquery

2006-12-08 Thread Ragnar
On fös, 2006-12-08 at 13:58 +0300, Max Bondaruk wrote: > Hi! > > error with Subquery alias... > SELECT *,(SELECT COUNT(id) > FROM articles a WHERE a.lft < articles.lft AND a.rgt > articles.rgt) AS depth > FROM articles > where (depth < 3) > ORDER BY lft you cannot refer to depth in the where bec

Re: [GENERAL] How to use outer join in update

2006-12-08 Thread Ragnar
On fös, 2006-12-08 at 10:17 +, Ragnar wrote: > On fös, 2006-12-08 at 10:09 +0100, Alban Hertroys wrote: > > Andrus wrote: > > > In my current DBMS I can use > > > > > > create table t1 ( f1 int, f2 int ); > > > create table t2 ( f3 int, f4 int ); &

Re: [GENERAL] How to use outer join in update

2006-12-08 Thread Ragnar
On fös, 2006-12-08 at 10:09 +0100, Alban Hertroys wrote: > Andrus wrote: > > In my current DBMS I can use > > > > create table t1 ( f1 int, f2 int ); > > create table t2 ( f3 int, f4 int ); > > update t1 set f1=t2.f3 from t1 left join t2 on t1.f2=t2.f4 > > That looks like a self-join on t1 witho

Re: [GENERAL] Online index builds

2006-12-07 Thread Ragnar
On fim, 2006-12-07 at 13:57 -0800, Jeff Davis wrote: > On Thu, 2006-12-07 at 20:07 +0000, Ragnar wrote: > > On fim, 2006-12-07 at 09:27 -0800, Jeff Davis wrote: > > > On Thu, 2006-12-07 at 12:26 +, Ragnar wrote: > > > > On mið, 2006-12-06 at

Re: [GENERAL] VACUUM and transactions in different databases

2006-12-07 Thread Ragnar
On fim, 2006-12-07 at 20:04 +0100, Cornelia Boenigk wrote: > Sorry, i was out > > [ snip demonstration of blocked vacuum full] > running on pg 8.1.4 on Fedora 5 could not duplicate this. can you show us the contents of pg_locks and pg_stat_activity while the VACUUM is blocked? gnari ---

Re: [GENERAL] Online index builds

2006-12-07 Thread Ragnar
On fim, 2006-12-07 at 09:27 -0800, Jeff Davis wrote: > On Thu, 2006-12-07 at 12:26 +0000, Ragnar wrote: > > On mið, 2006-12-06 at 18:22 -0800, Jeff Davis wrote: > > > > > Interesting, I was just thinking about this today as well. I am thinking > >

Re: [GENERAL] VACUUM and transactions in different databases

2006-12-07 Thread Ragnar
On fim, 2006-12-07 at 11:28 -0500, Tom Lane wrote: > Bill Moran <[EMAIL PROTECTED]> writes: > > In response to Alvaro Herrera <[EMAIL PROTECTED]>: > >> Of course they are able to complete, but the point is that they would > >> not remove the tuples that would be visible to that idle open > >> trans

Re: [GENERAL] Online index builds

2006-12-07 Thread Ragnar
On mið, 2006-12-06 at 18:22 -0800, Jeff Davis wrote: > On Wed, 2006-12-06 at 15:00 -0500, Chris Browne wrote: > > Let me add another question to this; this might possibly be worthy of > > a TODO for 8.3 or so... > > > > What if I wanted to: > > ALTER TABLE distributors ADD PRIMARY KEY CONCURRE

Re: [GENERAL] Anything I can do to speed up this query?

2006-12-07 Thread Ragnar
[ Marcus, you should folow up to the lists, so that other people can benefit from the discussion ] On fim, 2006-12-07 at 09:25 +0100, Marcus Engene wrote: > Ragnar skrev: > > On mið, 2006-12-06 at 17:34 -0500, Wei Weng wrote: > >> On Tue, 2006-12-05 at 15:56 -0500, Wei Weng wro

Re: [GENERAL] Anything I can do to speed up this query?

2006-12-06 Thread Ragnar
On mið, 2006-12-06 at 17:34 -0500, Wei Weng wrote: > On Tue, 2006-12-05 at 15:56 -0500, Wei Weng wrote: > > I have a table that has roughly 200,000 entries and many columns. >... > I think I have discovered the reason for why the query runs so slow. The > original query has an ORDER BY Field1 claus

Re: [GENERAL] Anything I can do to speed up this query?

2006-12-05 Thread Ragnar
On þri, 2006-12-05 at 15:56 -0500, Wei Weng wrote: > I have a table that has roughly 200,000 entries and many columns. > > SELECT Field1, Field2, Field3... FieldN FROM TargetTable; > The thing is on this machine with 1Gig Ram, the above query still takes > about 20 seconds to finish. And I need i

Re: [GENERAL] [ANNOUNCE] PostgreSQL 8.2 Now Available

2006-12-05 Thread Ragnar
On þri, 2006-12-05 at 14:41 -0500, Josh Berkus wrote: > After eight months of development and five months of integration and > testing, the PostgreSQL Global Development Group now announces the > availability of PostgreSQL version 8.2 (our 14th public release). > ... > For highlights of the rel

Re: [GENERAL] Data corruption problem...

2006-12-02 Thread Ragnar
I haven't seen any replies to this, so I will, although I am not a j2ee/jdbc person. On fim, 2006-11-30 at 14:14 -0700, Nathan Wilhelmi wrote: > Server: 8.0.3 on Solaris 9 > JDBC Driver: 8.0.311 ... > delete from X where id in (select bad_id from Z where name='qwerty'); > delete from Y where id i

Re: [GENERAL] NULLs ;-)

2006-11-28 Thread Ragnar
On þri, 2006-11-28 at 12:28 -0700, Scott Ribe wrote: > >>> where a <> b or (a is null and b is not null) or (a is not null and > >>> b is null) > >> > >> In the absence of IS DISTINCT FROM, I think this has the same semantics: > >> > >>where coalesce(a, b) <> coalesce(b, a) > > > > sorry, bu

Re: [GENERAL] How to implement backup protocol

2006-11-28 Thread Ragnar
On þri, 2006-11-28 at 19:23 +0200, Andrus wrote: > Richard, > > I really do'nt want to open separate port for backup only. > Pelase, can you recomment a solution which uses port 5432 owned by Postgres I do not want to advice you to do things that might be counter your company's security policies

Re: [GENERAL] NULLs ;-)

2006-11-28 Thread Ragnar
On þri, 2006-11-28 at 09:42 -0500, John D. Burger wrote: > Scott Ribe wrote: > > > where a <> b or (a is null and b is not null) or (a is not null and > > b is null) > > In the absence of IS DISTINCT FROM, I think this has the same semantics: > >where coalesce(a, b) <> coalesce(b, a) sorr

Re: [GENERAL] sequence help

2006-11-28 Thread Ragnar
On þri, 2006-11-28 at 01:12 -0800, Matthew Peter wrote: > I'll jump right in with an example > > create sequence foo start with 1; > > create view foobar as select *, nextval('foo') from bar; > > The problem is I need a nextval()-like method that returns the iterations > without > updating the

Re: [GENERAL] PGDATA

2006-11-26 Thread Ragnar
On fös, 2006-11-24 at 16:14 -0800, [EMAIL PROTECTED] wrote: > > Well.. you are correct! > After studying the contents of "/etc/init.d/postfresql", I put > "PGDATA=/home3/mylargedisk/data" in "/etc/sysconfig/pgsql/postgresql" > and it now works. > > So what the . is this PGDATA!! It must b

Re: [GENERAL] IN clause

2006-11-24 Thread Ragnar
On fös, 2006-11-24 at 10:10 -0800, Richard Broersma Jr wrote: > > That is fine > > but what I was actually expecting is this > > if > > select * from table where col_name in (null, 'a', 'b'); > > > > to return those rows where col_name is null or if it = a or if it is = b > > > > But i think i

Re: [GENERAL] BUG #2772: Undefined Subroutine Pg::connectdb (" ");

2006-11-22 Thread Ragnar
On mið, 2006-11-22 at 13:28 -0600, Bruno Wolff III wrote: > This isn't a bug and you should have asked on a different list. I am going > to move this over to pgsql-general. > > On Mon, Nov 20, 2006 at 12:07:25 +, > "S.Balaji" <[EMAIL PROTECTED]> wrote: > > > > In Redhat 7.2 use Pg; command

Re: [GENERAL] Table design - unknown number of column

2006-11-09 Thread Ragnar
On fim, 2006-11-09 at 10:56 +0100, Alban Hertroys wrote: > Richard Ollier wrote: > > For a project I have a table containing products and flags. > > The columns of this table are of 2 kinds : > > - Not null data (id, column1, column2) > > - Flags (100 different flags set to 1 or 0) > > > > Over th

Re: [GENERAL] Strange behavior on non-existent field in subselect?

2006-10-17 Thread Ragnar
On þri, 2006-10-17 at 15:58 -0700, Ken Tanzer wrote: > We're a little puzzled by this (apparently) strange behavior, and would > be curious to know what you folks make of it. Thanks. not sure exactly what you are referring to, but: (rearranged quotes to group output with SQL) > SELECT foo_field

Re: [GENERAL] serial column

2006-09-24 Thread Ragnar
On sun, 2006-09-24 at 14:29 -0700, Bob Pawley wrote: > Choice a. > > I am using the numbers to identify devices. > > If a device is deleted or replaced with another type of device I want the > numbering to still be sequential. have you tried to implement ths using triggers? gnari --

Re: [GENERAL] serial column

2006-09-24 Thread Ragnar
On sun, 2006-09-24 at 13:50 -0700, Bob Pawley wrote: > I need to develop a serial column that always starts at 1 and is > sequential even after deletes. what exactly do you mean? say you have rows where your columns has values 1,2,3 and 4. you now delete the row where the value is 2. what do yo

Re: [GENERAL] Select Cast Error

2006-09-22 Thread Ragnar
On fim, 2006-09-21 at 21:57 -0400, Brad Budge wrote: > I have a field that is varchar(15) type and an example of data I'm > working with is (PROJ-0001-06) > select cast((max(substring(test.test from 6 for 4))) as integer) + 1 > FROM test where max(substring(test.test from 11 for 2)); > as someon

Re: [GENERAL] Can i switch to the use of persistent connections

2006-09-22 Thread Ragnar
On fim, 2006-09-21 at 23:40 -0700, Najib Abi Fadel wrote: > i have an already running web application with a lot of users. All the > connections to the postgresql database are not persistent. I was > wondering if it is possible to switch to persistent connection without > having problems in my cur

Re: [GENERAL] initdb: invalid locale name "sv_SE.ISO-8859-1"

2006-09-14 Thread Ragnar Österlund
Thanks for the advice, I tried to install the "language-packs" that ubuntu supports. I can no initialize a se_SV.utf8 cluster, but it seems there is no support form latin1. Best whishes /Ragnar ---(end of broadcast)--- TIP 6: explain

Re: [GENERAL] initdb: invalid locale name "sv_SE.ISO-8859-1"

2006-09-12 Thread Ragnar
On þri, 2006-09-12 at 09:43 +0200, Ragnar Österlund wrote: > When I try to initialize a new cluster like this: > > /usr/lib/postgresql/8.1/bin/initdb --locale=sv_SE.ISO-8859-1 -D sv_SE_data/ > > I get the error: > > initdb: invalid locale name "sv_SE.ISO-8859-1"

[GENERAL] initdb: invalid locale name "sv_SE.ISO-8859-1"

2006-09-12 Thread Ragnar Österlund
ed compile postgresql from source on ubuntu, as I thought it might had been the binary installation that was not correct, but the source installation failed the same way. I have a locale for sv in /usr/share/locales. What on earth can it be that is wrong? /Ragnar ---(end of

Re: [GENERAL] counting days

2006-08-29 Thread Ragnar
On þri, 2006-08-29 at 17:32 -0400, AgentM wrote: > Perhaps you are trying to count business days? Those vary around the > world and you would certainly need a table to hold the holidays and > such. If you just want to count the number of non-weekend-days, then > get the interval as days and t

Re: [GENERAL] counting days

2006-08-29 Thread Ragnar
On þri, 2006-08-29 at 19:35 +0100, garry saddington wrote: > I need to count the days between two dates that are not saturdays or > sundays. I have read the manual and searched the lists but I am > struggling. I can count the days but am finding difficulty excluding sat > and sun from the count. I

Re: [GENERAL] optimising UNION performance

2006-08-28 Thread Ragnar
On mán, 2006-08-28 at 10:23 +0200, Rafal Pietrak wrote: > Hi all, > > Is there a way to speed up the query to my 'grand total' logfile, > constructed as a UNION of smaller (specialised) logfiles? > I do not know if this is relevant to your case, but possibly you can use a UNION ALL instead of a

Re: [GENERAL] speeding up big query lookup

2006-08-26 Thread Ragnar
On fös, 2006-08-25 at 18:34 -0400, Silvela, Jaime (Exchange) wrote: > This is a question on speeding up some type of queries. > > I have a very big table that catalogs measurements of some objects over > time. Measurements can be of several (~10) types. It keeps the > observation date in a field,

Re: [GENERAL] HOW SELECT

2006-08-25 Thread Ragnar
On fös, 2006-08-25 at 13:20 +0530, shyju c.k wrote: > hai all > > > i have table ,as follows [reformatted] > id_int | vid_int | name_chv | address_txt > 2 | 12 | ram| address1 > 3 | 12 | joy| address2 > 4 | 14 | shyju | address3 > 5

Re: [GENERAL] B+ versus hash maps

2006-06-16 Thread Ragnar
On fös, 2006-06-16 at 11:39 +0530, surabhi.ahuja wrote: [in response to Jim advising not to set random_page_cost=1] > in that case, should i set > enable_seqscan parameter to off at the time of starting postmaster? that is unlikely to be a good stategy. > because i have seen that even thou the

Re: [GENERAL] [ODBC] information request on postgresql --> oracle

2006-05-29 Thread Ragnar
On mán, 2006-05-29 at 10:21 +0200, Glauco Mancini wrote: > i'm looking for a method to connect natively a postgresql db to oracle > ( maybe via odbc ? ) with something similar to the oracle dblink. > > I connected successfully a oracle instance to a postgresql instance > using unix-odbc, now i

Re: [GENERAL] move from 1 database to another

2006-05-25 Thread Ragnar
On fim, 2006-05-25 at 11:52 -0700, P.M wrote: > I would like to know how can i move from 1 database to another one ? > > basically i want to run a *.sql script in which i connect under a > particular database (for example : template1 or postgres) and my *.sql > script should create a new database

Re: [GENERAL] SQL & Binary Data Questions

2006-05-22 Thread Ragnar
On fös, 2006-05-19 at 12:21 -0700, Siah wrote: > Some pointers could help. & any arguments pro/against saving bin data > in db? pro: backups can be made with pg_dump only. if binary data is stored in filesystem, your backup procedure gets more complicated, specially if your binary files can get

Re: [GENERAL] How would I write this query...

2006-05-01 Thread Ragnar
On sun, 2006-04-30 at 11:32 -0700, Jim Fitzgerald wrote: > I have two tables, one of them has names of people and an associated > integer ID. The other table is a list of the people (from the first table) > by their ID number that have signed up for a class. How would I write a > query that

Re: [GENERAL] how to prevent generating same clipids

2006-04-11 Thread Ragnar
On mán, 2006-04-10 at 22:43 -0700, [EMAIL PROTECTED] wrote: > Hi >Now we cannot change the field type. Because already our application > is running and thousands of records are already entered. we are getting > same no for clipid when 2 users are entering data at a time. so how to > solve the p

Re: [GENERAL] regarding contains operator

2006-03-08 Thread Ragnar
On mið, 2006-03-08 at 15:13 +0530, surabhi.ahuja wrote: > > if it is not ther can i write my own operators? abd use them please > send me the link where i can find documnetation on the same http://www.postgresql.org/docs/8.1/interactive/extend.html http://www.postgresql.org/docs/8.1/interactive/

Re: [GENERAL] Physical column size

2006-03-03 Thread Ragnar
On fös, 2006-03-03 at 11:03 +0100, Paul Mackay wrote: > Hi, > > I've created a table like this : > CREATE TABLE tmp_A ( > c "char", > i int4 > ); > > And another one > CREATE TABLE tmp_B ( > i int4, > ii int4 > ); > > I then inserted a bit more than 19 million rows in each table (exactly > th

Re: [GENERAL] query timeout

2006-03-03 Thread Ragnar
On fim, 2006-03-02 at 11:03 -0700, Rick Gigger wrote: > Never-mind that. I'm assuming statement_timeout is what I need? Yes, but take care if you change this in postgresql.conf: some queries might reasonaby be expected to take longer than 5 minutes, such as VACUUM. gnari > On Mar 2, 2006, at 1

Re: [GENERAL] SQL TYPE MAP such as SQL_CHAR, SQL_NUMERIC , etc

2006-02-23 Thread Ragnar
On fim, 2006-02-23 at 16:31 -0500, Emi Lu wrote: > We use perl DBI to read table names, column names, and column types from > Oracle rdb 7.3 through ODBC, and then try to create tables into postgresql. > > Through perl DBI, we got: > > > Column Name Type Precision Scale N

Re: [GENERAL] SQL TYPE MAP such as SQL_CHAR, SQL_NUMERIC , etc

2006-02-23 Thread Ragnar
On fim, 2006-02-23 at 15:45 -0500, Emi Lu wrote: > I am waiting for your clues. Maybe it is us that need some clues from you. gnari > > > > > May I know where I can find some online documents about mapping the > > integer values to the following SQL types please? > > > > For example, if I ha

Re: [GENERAL] Is there a way to check which indexes are being used

2006-02-23 Thread Ragnar
On fim, 2006-02-23 at 14:15 +0100, Dragan Matic wrote: > We have a 50 GB database (currently using postgresql 8.1.1) with a few > hundred tables. There are a few larger (2-5 million rows) tables with > multiple indexes on them, some being unique, some not. Now, I am pretty > sure some of the ind

Re: [GENERAL] Converting an ASCII database to an UTF-8 database

2006-02-17 Thread Ragnar
On fös, 2006-02-17 at 22:38 +0100, Peter Eisentraut wrote: > [EMAIL PROTECTED] wrote: > > How do I convert a database in the ASCII format into one of the UTF-8 > > format? > > ASCII is a subset of UTF-8, so you don't need to do anything. Just > change the encoding entry in the pg_database table.

Re: [GENERAL] Converting an ASCII database to an UTF-8 database

2006-02-17 Thread Ragnar
On fös, 2006-02-17 at 05:21 -0800, [EMAIL PROTECTED] wrote: > Hi All, > > I have a database in PostgreSQL which is ASCII. > Due to some internationalization issues, I need to convert the database > to the UTF-8 format. > > So my question is: > How do I convert a database in the ASCII format into

Re: [GENERAL] A question about Vacuum analyze

2006-02-17 Thread Ragnar
On fös, 2006-02-17 at 12:06 -0500, Emi Lu wrote: > In another way, whenever we "delete/truncate and then insert" data into > a table, it is better to "vacuum anaylze"? > > ... > >> > >>So, your suggestion is that after the population of table A, the query > >>planner should be abl

Re: [GENERAL] A question about Vacuum analyze

2006-02-16 Thread Ragnar
On fim, 2006-02-16 at 16:24 -0500, Emi Lu wrote: > >>In another way, whenever we "delete/truncate and then insert" data into > >>a table, it is better to "vacuum anaylze"? > >> > >> > >You shouldn't need a VACUUM if you haven't yet done any updates or > >deletes since the TRUNCATE. An ANALYZE

  1   2   >