Re: [NOVICE] [GENERAL] Connect to postgresql database using Perl

2010-03-31 Thread Sean Davis
On Wed, Mar 31, 2010 at 3:25 AM, dipti shah shahdipti1...@gmail.com wrote: Thanks Guys. DBI works fine. I have written below code but it executes only on the server where I installed postgresql. Is there any way to run this code from remote host. I get an error when trying to run it from remote

Re: [GENERAL] [INTERFACES] PGSQL and Javascript

2009-01-30 Thread Sean Davis
No. I'm not sure how that could be done given the security concerns. Sean On Fri, Jan 30, 2009 at 6:40 AM, Reg Me Please regmeple...@gmail.comwrote: Hello all. Is there a way to directly access PGSQL from a Javascript application? With no application server intervention, I mean. Just like

Re: [INTERFACES] [GENERAL] PGSQL and Javascript

2009-01-30 Thread Sean Davis
On Fri, Jan 30, 2009 at 7:09 AM, Reg Me Please regmeple...@gmail.comwrote: I'd like to write part of the application in Javascript, server side, not in the web page. I missed your point. Do a google search for javascript interpreters in the language of your choice. For example, there is

Re: [INTERFACES] [GENERAL] PGSQL and Javascript

2009-01-30 Thread Sean Davis
://www.whitebeam.org/ Sean On Friday 30 January 2009 13:24:59 Sean Davis wrote: On Fri, Jan 30, 2009 at 7:09 AM, Reg Me Please regmeple...@gmail.com wrote: I'd like to write part of the application in Javascript, server side, not in the web page. I missed your point. Do a google search

[GENERAL] General data warehousing questions

2008-10-05 Thread Sean Davis
I am looking at the prospect of building a data warehouse of genomic sequence data. The machine that produces the data adds about 300million rows per month in a central fact table and we will generally want the data to be online. We don't need instantaneous queries, but we would be using the

[GENERAL] MySQL to Postgresql schema conversion

2008-09-30 Thread Sean Davis
There are a number of mysql to postgresql converters available, but many of them have significant shortcomings. Has anyone found a tool that works well? I am trying to convert a couple of relatively large, public schema to postgresql. Thanks, Sean -- Sent via pgsql-general mailing list

Re: [GENERAL] MySQL to Postgresql schema conversion

2008-09-30 Thread Sean Davis
On Tue, Sep 30, 2008 at 10:08 AM, Sean Davis [EMAIL PROTECTED] wrote: There are a number of mysql to postgresql converters available, but many of them have significant shortcomings. Has anyone found a tool that works well? I am trying to convert a couple of relatively large, public schema

Re: [GENERAL] MySQL to Postgresql schema conversion

2008-09-30 Thread Sean Davis
On Tue, Sep 30, 2008 at 1:18 PM, Merlin Moncure [EMAIL PROTECTED] wrote: On Tue, Sep 30, 2008 at 12:48 PM, Sean Davis [EMAIL PROTECTED] wrote: On Tue, Sep 30, 2008 at 10:08 AM, Sean Davis [EMAIL PROTECTED] wrote: There are a number of mysql to postgresql converters available, but many of them

[GENERAL] [OT] RAID controllers blocking one another?

2008-01-17 Thread Sean Davis
We have a machine that serves as a fileserver and a database server. Our server hosts a raid array of 40 disk drives, attached to two3-ware cards, one 9640SE-24 and one 9640SE-16. We have noticed that activity on one controller blocks access on the second controller, not only for disk-IO but also

[GENERAL] plpython and error catching

2007-11-19 Thread Sean Davis
What is the expected behavior of a construct like this: def insert_xml(elem): id=int(elem.findtext('PMID')) try: plpy.execute(plan,[unicode(ET.tostring(elem)),id]) except: plpy.execute(plan2,[unicode(ET.tostring(elem)),id]) id is a primary key on the table into which

[GENERAL] plpython array support

2007-11-19 Thread Sean Davis
Just a simple question--does plpythonu (8.3beta) have support for arrays? I don't see a specific mention of it in the docs, so I suppose not. Thanks, Sean ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ?

Re: [GENERAL] plpython array support

2007-11-19 Thread Sean Davis
On Nov 19, 2007 9:08 PM, Jorge Godoy [EMAIL PROTECTED] wrote: Em Monday 19 November 2007 19:29:51 Sean Davis escreveu: Just a simple question--does plpythonu (8.3beta) have support for arrays? I don't see a specific mention of it in the docs, so I suppose not. Arrays work for a long time

Re: [GENERAL] XML schema

2007-11-16 Thread Sean Davis
On Nov 15, 2007 6:20 PM, Peter Eisentraut [EMAIL PROTECTED] wrote: Sean Davis wrote: Is the current XML datatype (in 8.3) the direction of the future, or is something more akin to a dedicated XML schema (I think this is the route that Oracle has gone) going to be important? An XML schema

Re: [GENERAL] XML schema

2007-11-16 Thread Sean Davis
On Nov 16, 2007 2:14 PM, Peter Eisentraut [EMAIL PROTECTED] wrote: Sean Davis wrote: I meant a schema that represents a general mapping between XML and a relational schema. In other words, I am looking for tools that use postgresql as the storage engine for a native XML database

[GENERAL] XML schema

2007-11-15 Thread Sean Davis
Sorry for the cross-post, but I wasn't sure where this should go. I have a large XML file (about 7.5Gb) that is composed of about 17 million individual records. I have successfully loaded these records as individual XML records into a table with 17M rows. However, I looked around a bit and

[GENERAL] XML database

2007-11-01 Thread Sean Davis
I have a large set of XML files (representing about 18M records) that I would like to load into postgres. I have been loading the records into relational tables. Is this the best way to go? I am particularly interested in full-text searches of a subset of the elements. I am on 8.3Beta.

Re: [GENERAL] more problems with count(*) on large table

2007-09-28 Thread Sean Davis
Mike Charnoky wrote: Hi, I am still having problems performing a count(*) on a large table. This is a followup from a recent thread: http://archives.postgresql.org/pgsql-general/2007-09/msg00561.php Since the last time these problems happened, we have tweaked some postgresql config

Re: [GENERAL] use COPY TO on normalized database

2007-09-15 Thread Sean Davis
Acm wrote: I am working with PostgreSQL 8.2.4. I need to use the SQL COPY (COPY table FROM file) statement to populate my database. I have created a normalized data model (up to 3NF). Is it possible to use COPY TO on a particular table (that is linked to other tables using foreign keys)

Re: [GENERAL] GRANT on group does not give access to group members

2007-09-15 Thread Sean Davis
wild_oscar wrote: Well, after further searching and reviewing the code I believe the problem was the NOINHERIT in the login role creation. So the remaining question is: On another question, if I want to grant privileges to all tables I have to do them ONE BY ONE. Granting the privileges on the

[GENERAL] pam authentication

2007-09-11 Thread Sean Davis
I am making a first attempt at getting pam authentication working with a postgres 8.2.4 installation on suse 10.2. I have created the file: /etc/pam.d/postgresql: authrequired/lib64/security/pam_ldap.so account required/lib64/security/pam_ldap.so and in my pg_hba.conf, I

Re: [GENERAL] [NOVICE] Recursive relationship - preventing cross-index entries.

2007-06-20 Thread Sean Davis
Andrew Maclean wrote: I got no answer so I am trying again. In a nutshell, if I have a recrusive relationship as outlined below, how do I implement a rule for the adjustments table that prevents the entry of an Id into the Ref column if the id exists in the Id column and vice versa? If

Re: [GENERAL] Distributing PostGres database to various customers

2007-06-11 Thread Sean Davis
Mike Gould wrote: All, I am new to PostGres 8 (using 8.2.4 windows version). We have for several years been using iAnywhere's SQL Anywhere product with our commercial transportation software. With ASA there are 2 files that must be distributed for the database, a filename.db and a

[GENERAL] Versioning

2007-04-10 Thread Sean Davis
I can think of several ways of versioning objects (modeled as rows of a table). 1) parent-child based model, where each edit of a row results in a child row 2) date-based model, where each row is stored with a date and no updates are performed, only inserts 3) Maintain a shadow table with

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

2006-11-09 Thread Sean Davis
I think the typical way of attacking a problem would be a second and third table. The second table would look like: flat_type table flag_type_id flag_type (like the column name in your original table) flag_type_description (BONUS: you can describe each flag) product_flag table

Re: [GENERAL] pgsql vs mysql

2006-07-12 Thread Sean Davis
On 7/12/06 3:32 AM, Rafal Pietrak [EMAIL PROTECTED] wrote: On Tue, 2006-07-11 at 15:24 -0500, Ron Johnson wrote: Joshua D. Drake wrote: It is also something that users are clammoring for (and my customers). To the point that I have customers using unions to emulate the behavior. Why?

Re: [GENERAL] Best open source tool for database design / ERDs?

2006-06-01 Thread Sean Davis
You might look into Eclipse (the java-based IDE). It has at least one ERD design plugin that allows graphical layout, editing of schema, and generation of DDL directly from the schema. It works with many DB platforms and is FREE!!! Sean On 6/1/06 5:44 AM, [EMAIL PROTECTED] [EMAIL PROTECTED]

Re: [GENERAL] Best open source tool for database design / ERDs?

2006-06-01 Thread Sean Davis
On 6/1/06 12:29 PM, Tomi NA [EMAIL PROTECTED] wrote: On 6/1/06, Sean Davis [EMAIL PROTECTED] wrote: You might look into Eclipse (the java-based IDE). It has at least one ERD design plugin that allows graphical layout, editing of schema, and generation of DDL directly from the schema

[GENERAL] FATAL: could not read statistics message

2006-05-16 Thread Sean Davis
I am using postgresql 8.1.0 on an Xserver running MacOS 10.3.9. I am getting the following in the log every minute for the past couple of days. The database is otherwise running normally, as far as I can tell: 2006-05-16 07:26:01 EDT FATAL: could not read statistics message: Resource

Re: [GENERAL] FATAL: could not read statistics message

2006-05-16 Thread Sean Davis
On 5/16/06 3:08 PM, Tony Wasson [EMAIL PROTECTED] wrote: On 5/16/06, Sean Davis [EMAIL PROTECTED] wrote: I am using postgresql 8.1.0 on an Xserver running MacOS 10.3.9. I am getting the following in the log every minute for the past couple of days. The database is otherwise running

Re: [GENERAL] FATAL: could not read statistics message

2006-05-16 Thread Sean Davis
Jim C. Nasby wrote: On Tue, May 16, 2006 at 03:41:07PM -0400, Sean Davis wrote: I had cranked things up a bit from the standard install. shared_buffers = 15000 # min 16 or max_connections*2, 8KB each #temp_buffers = 1000# min 100, 8KB each

Re: [GENERAL] FATAL: could not read statistics message

2006-05-16 Thread Sean Davis
Tony Wasson wrote: On 5/16/06, Tom Lane [EMAIL PROTECTED] wrote: Tony Wasson [EMAIL PROTECTED] writes: When I saw the same error as you, the stats collector process was missing. The collector, or the buffer process? The reported message would be emitted by the buffer process, after which

Re: [GENERAL] stored proc vs sql query string

2006-04-06 Thread Sean Davis
On 4/6/06 12:12 AM, surabhi.ahuja [EMAIL PROTECTED] wrote: i have heard somewhere that writing a stored procedure, is much better than firing a sql query(such as select * from table_name) onto the database. is it true and if yes how? This isn't going to be true most of the time, I think.

Re: [GENERAL] psql is very slow

2006-02-24 Thread Sean Davis
On 2/22/06 10:23 AM, Michal Merta [EMAIL PROTECTED] wrote: I have a psql 7.3.4, apache 2.0.40, perl v5.8.0. Database is pretty big, (dump is about 100Megs). But all the operations are very, very slow. Is any possibility to make postgresql more quick? (don't tell me to cut the database

Re: [GENERAL] Access Problem After Version Upgrade

2006-01-26 Thread Sean Davis
On 1/26/06 11:53 AM, Rich Shepard [EMAIL PROTECTED] wrote: Last week I upgraded from -7.4.3 to -8.1.2. I had some problems moving data because of both my ignorance of the proper syntax and the move from /usr/local/pgsql to /var/lib/pgsql. Now I cannot access the server: [EMAIL

[GENERAL] Normalized storage to denormalized report

2006-01-19 Thread Sean Davis
I have a table that stores data like so: Create table raw_vals ( expt_id int, clone_idx int, val numeric, primary key (expt_id,clone_idx) ); And I would like to design a query that gives: Clone_idx expt_id_1 expt_id_2 1 0.7834 0.8231 2

Re: [GENERAL] Normalized storage to denormalized report

2006-01-19 Thread Sean Davis
On 1/19/06 7:14 AM, Martijn van Oosterhout kleptog@svana.org wrote: On Thu, Jan 19, 2006 at 07:03:47AM -0500, Sean Davis wrote: I have a table that stores data like so: snip And I would like to design a query that gives: Clone_idx expt_id_1 expt_id_2 1 0.7834

Re: [GENERAL] Loading large amounts of data in a SQL command

2006-01-05 Thread Sean Davis
On 1/5/06 8:31 AM, frank church [EMAIL PROTECTED] wrote: I am loading lots of data via SQL into a database and wrapping it into transactions to speed it up. This fails a number of times and causes the whole transaction to fail. The queries results are logged so it is easy for me to

Re: [GENERAL] inserting many rows

2006-01-03 Thread Sean Davis
On 1/2/06 5:34 PM, SunWuKung [EMAIL PROTECTED] wrote: I will need to insert multiple rows into a table from php. The data will come in 'packages' of 50-500 rows (they are responses from different questionnaires). As there will be many people sending their results in at the same time I need

Re: [GENERAL] Stored Procedure: PL/Perl or PL/SQL?

2005-12-29 Thread Sean Davis
On 12/29/05 4:10 PM, Joshua Kramer [EMAIL PROTECTED] wrote: Greetings all, I'm working to integrate an accounting system (http://www.linuxcanada.com) with another application. Fortunately, both use PG, so integration should be easy. I want to be able to insert invoices, and invoice

[GENERAL] Table design

2005-12-02 Thread Sean Davis
This might be a bit off-topic, but I'm curious what folks would do with this situation: I have about 6 different tab-delimited file types, all of which store similar information (microarray gene expression). However, the files come from different manufacturers, so each has slightly different

Re: [GENERAL] Table design

2005-12-02 Thread Sean Davis
On 12/2/05 10:21 AM, Guy Rouillier [EMAIL PROTECTED] wrote: Sean Davis wrote: This might be a bit off-topic, but I'm curious what folks would do with this situation: I have about 6 different tab-delimited file types, all of which store similar information (microarray gene expression

Re: [GENERAL] Question on Insert / Update

2005-11-09 Thread Sean Davis
On 11/9/05 9:45 AM, Alex [EMAIL PROTECTED] wrote: Hi, have just a general question... I have a table of 10M records, unique key on 5 fields. I need to update/insert 200k records in one go. I could do a select to check for existence and then either insert or update. Or simply insert,

Re: [GENERAL] How to get the value in the lastvalue field

2005-10-26 Thread Sean Davis
On 10/26/05 8:23 AM, Venki [EMAIL PROTECTED] wrote: Hi, Can anyone in the list tell me how to get the value in the lastvalue field of a sequence. I tried select currval('field_seq'); but got an error message ERROR: currval of sequence field_seq is not yet defined in this session.

Re: [GENERAL] How to get the value in the lastvalue field

2005-10-26 Thread Sean Davis
On 10/26/05 8:42 AM, Venki [EMAIL PROTECTED] wrote: Hi thanks for the replies. The situation is as follows. We get backups from the production server and update the local database in the local server but each time when we restore the database backup the sequence values are not getting

Re: [GENERAL] querying PostgreSQL version?

2005-10-26 Thread Sean Davis
On 10/26/05 8:52 AM, Zlatko Matić [EMAIL PROTECTED] wrote: Hello. Is there any way to check the version of PostgreSQL by a query? Maybe by querying catalog tables? Select version(); ---(end of broadcast)--- TIP 6: explain analyze is your

Re: [GENERAL] newbie question: reading sql commands from script files

2005-10-24 Thread Sean Davis
Title: [GENERAL] newbie question: reading sql commands from script files In psql, look at \i. Sean - Original Message - From: basel novo To: pgsql-general@postgresql.org Sent: Monday, October 24, 2005 8:28 PM Subject: [GENERAL] newbie question: reading sql

Re: [GENERAL] Tables

2005-10-20 Thread Sean Davis
On 10/20/05 12:37 PM, Bob Pawley [EMAIL PROTECTED] wrote: I am new to databases. I have table 1, a primary source, which generates a serial number to make each item unique. I want to use this number to generate a row in table 2 linking the two rows and allowing specific information on

Re: [GENERAL] getting around---division by zero on numeric

2005-10-19 Thread Sean Davis
On 10/19/05 8:26 AM, Tim Nelson [EMAIL PROTECTED] wrote: I am getting division by zero on a calculated field ( sum(sales) is 0 ) and I can't find a way around this. I figured out you can't use an aggregate in a where, and using having the parser must (obviously) evaluate the select fields

Re: [GENERAL] Question about stored procedures

2005-10-13 Thread Sean Davis
On 10/13/05 6:36 AM, Josephine E. de Castro [EMAIL PROTECTED] wrote: Hi everyone, I just want to know if there is an equivalent method in PostgreSQL that acts like SQL Server's extended stored procedure. I want to run a stored procedure that can update a file in the file system.. I dont

Re: [GENERAL] graphs in PostgreSQL

2005-10-13 Thread Sean Davis
On 10/13/05 8:27 AM, Ivan Yu. Zolotukhin [EMAIL PROTECTED] wrote: Hello, I'm trying to organize storage and processing of a graph (pretty spare, 100,000 vertices and 5,000,000 edges) with PostgreSQL. I have two main problems: - standart problem of finding all shortest paths between two

Re: [GENERAL] About transform SQL grammar from postgresql 8.0 to

2005-10-11 Thread Sean Davis
On 10/11/05 11:34 AM, Emi Lu [EMAIL PROTECTED] wrote: Hello, I know there is a script in perl can transform all sql commands in mysql into the queries supported by postgreSQL. Since we have not finished moving all data from mysql into postgresql, we need dump around 60 tables from

Re: [GENERAL] Cast to integer

2005-10-05 Thread Sean Davis
On 10/5/05 9:08 AM, Robert Osowiecki [EMAIL PROTECTED] wrote: Hello! Anyone could explain to me, why cast(3.33 to int) works (from float, I suppose) but cast('3.33' to int) (from text) does not? And what if I create a cast for that: is it possibly dangerous? How about: sdavis=# select

Re: [GENERAL] Integration with MS Sql Server

2005-10-04 Thread Sean Davis
On 10/3/05 7:41 PM, J B [EMAIL PROTECTED] wrote: On 10/3/05, Dann Corbit [EMAIL PROTECTED] wrote: Using SQL*Server, and OLEDB or ODBC data source can be connected as a linked server. Then, TSQL queries can go against PostgreSQL tables as though they were ordinary SQL*Server tables (but they

[GENERAL] Query optimization

2005-09-30 Thread Sean Davis
I have a couple of very large tables that I am querying on that gives the following explain analyze output. If someone can help out with my mess, that would be great. Thanks, Sean explain analyze select e.*,c.* from u_all_est_mrna c join g_rna_acc d on c.accession=d.accession,

Re: [GENERAL] Perl regular expressions

2005-09-29 Thread Sean Davis
On 9/28/05 6:25 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Is there any support for perl regular expressions in Postgresql? You might want to look at this section of the documentation: http://www.postgresql.org/docs/8.0/interactive/functions-matching.html Sean

Re: [GENERAL] Index use in BETWEEN statement...

2005-09-27 Thread Sean Davis
On 9/27/05 7:45 AM, Yonatan Ben-Nes [EMAIL PROTECTED] wrote: Tom Lane wrote: Cristian Prieto [EMAIL PROTECTED] writes: mydb=# explain analyze select locid from geoip_block where '216.230.158.50'::inet between start_block and end_block; As you see it still using a sequential scan in the

Re: [GENERAL] Data Entry Tool for PostgreSQL

2005-09-26 Thread Sean Davis
On 9/25/05 8:49 PM, Brent Wood [EMAIL PROTECTED] wrote: On Fri, 23 Sep 2005, Ian Overton wrote: Hello, We have a web application using PHP, Linux and PostgreSQL. We need a simple data entry tool to allow non-IT people to edit data in our database through a web-browser. Are there

Re: [GENERAL] Index use in BETWEEN statement...

2005-09-26 Thread Sean Davis
On 9/26/05 11:26 AM, Cristian Prieto [EMAIL PROTECTED] wrote: Hello pals, I have the following table in Postgresql 8.0.1 Mydb# \d geoip_block Table public.geoip_block Column| Type | Modifiers -++--- locid | bigint | start_block | inet |

Re: [GENERAL] help me pls

2005-09-19 Thread Sean Davis
On 9/19/05 12:02 AM, suresh ramasamy [EMAIL PROTECTED] wrote: thanks for the info Devrim, by the way i'm newbie, i have followed the steps in the documentation for compiling and installation. I'm using FC4. ./cofigure completes immediately but the gmake running for nearly the whole day.

Re: [GENERAL] ERROR: database is being accessed by other users

2005-08-24 Thread Sean Davis
On 8/23/05 10:10 PM, wolverine my [EMAIL PROTECTED] wrote: Hi! I got the following psql's error when executing a script, ERROR: database test is being accessed by other users To solve this, I have to disconnect the database connection from the pgAdmin III. May I know how can I

Re: [GENERAL] psql: server closed the connection unexpetedly

2005-08-24 Thread Sean Davis
On 8/24/05 7:24 AM, Phil Thornhill [EMAIL PROTECTED] wrote: Hi, I can't connect to a new installation of PostgreSQL 8.1 on a XP SP1 laptop. Im trying to connect using psql in the laptop's command prompt. i keep getting the following error message: psql: server closed the connection

[GENERAL] Problem finding libpg.3.dylib on macos X in plperlu procedure

2005-08-24 Thread Sean Davis
I ran across this problem while running a plperlu procedure. I do not have a libpq.3.dylib, but do have a libpq.4.dylib. I am running perl 5.8.1, macos 10.3.8 on an Xserve G5, and Postgres 8.0.2. Any suggestions? I should mention that other db functions seem to work just fine. From psql:

Re: [GENERAL] Problem finding libpg.3.dylib on macos X in plperlu

2005-08-24 Thread Sean Davis
I answered my own question--if one upgrades the server, one must also consider the consequences for the client (DBD::Pg). It had been compiled using an older library that got removed when I upgraded. Sean On 8/24/05 4:31 PM, Davis, Sean (NIH/NHGRI) [EMAIL PROTECTED] wrote: I ran across this

Re: [GENERAL] SQL error - please help.

2005-08-22 Thread Sean Davis
On 8/22/05 8:24 AM, Bernard [EMAIL PROTECTED] wrote: Dear Postgresql specialists I would like to seek help with a SQL query that was developed and tested with other SQL92 compliant databases. Please examine the following testcase and the result that I get: # su postgres $ psql -d mydb

Re: [GENERAL]

2005-08-22 Thread Sean Davis
On 8/22/05 9:56 AM, Nigel Horne [EMAIL PROTECTED] wrote: On Mon, 2005-08-22 at 14:49, Tino Wildenhain wrote: Nigel Horne schrieb: On Fri, 2005-08-19 at 16:34, A. Kretschmer wrote: am 19.08.2005, um 15:58:20 +0100 mailte Nigel Horne folgendes: I can't work out from that how to return

Re: [GENERAL] Query results caching?

2005-08-22 Thread Sean Davis
On 8/22/05 1:59 PM, Dann Corbit [EMAIL PROTECTED] wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:pgsql-general- [EMAIL PROTECTED] On Behalf Of Ben-Nes Yonatan Sent: Monday, August 22, 2005 9:03 AM To: pgsql-general@postgresql.org Subject: [GENERAL] Query results

Re: [GENERAL] Set autocommit to off

2005-08-17 Thread Sean Davis
On 8/17/05 4:24 AM, Aliomar Mariano Rego [EMAIL PROTECTED] wrote: Does somebody knows why the Postgresql 7.4.8 or later doesn't supports the option SET AUTOCOMMIT TO OFF? See this message: http://archives.postgresql.org/pgsql-general/2005-07/msg00064.php In short, server-side autocommit is

Re: [GENERAL] Finding nearest numeric value

2005-08-17 Thread Sean Davis
On 8/17/05 8:50 AM, Poul Møller Hansen [EMAIL PROTECTED] wrote: Does anyone know how to find the row with the nearest numeric value, not necessarily an exact match ? To find the nearest value in number_column to some CONSTANT (where you replace constant with a number), try: select

Re: [GENERAL] Finding nearest numeric value

2005-08-17 Thread Sean Davis
On 8/17/05 10:01 AM, Poul Møller Hansen [EMAIL PROTECTED] wrote: To find the nearest value in number_column to some CONSTANT (where you replace constant with a number), try: select *,(number_column - CONSTANT)^2 as d from tablename order by d limit 1; Does that do it for you? Sean

Re: [GENERAL] createlang

2005-08-15 Thread Sean Davis
On 8/15/05 4:45 PM, eoghan [EMAIL PROTECTED] wrote: Hello Im trying to load plpgsql into my test db... Im wondering if theres a way to check if its loaded... I do: test-# createlang plpgsql test test-# When i try load an example function: test-# \i test.sql Im getting: psql:test.sql:5:

[GENERAL] Analyze and number of rows

2005-08-12 Thread Sean Davis
Just a simple question--is there a way to have analyze use a fixed PROPORTION of rows rather than a fixed number? Thanks, Sean ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Cross database queries

2005-08-09 Thread Sean Davis
On 8/9/05 10:21 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Suppose I have two databases on one server (lets call them DB_A and DB_B) and I was to write a cross database query. How do I do this in PostgreSQL? On MS-SQL I would do something like: SELECT ta.Field1, ta.Field2,

Re: [GENERAL] best way to reference tables

2005-08-09 Thread Sean Davis
On 8/9/05 10:31 AM, TJ O'Donnell [EMAIL PROTECTED] wrote: I have many different tables that I want to keep track of. So, I thought of a master table with those table names in it. But, to maintain this (suppose a table changes its name, gets dropped) I want to have some kind of referential

Re: [GENERAL] psqsl - remote db

2005-08-04 Thread Sean Davis
On 8/4/05 2:26 PM, Andrew Stewart [EMAIL PROTECTED] wrote: I'm sorry, I'm sure I should be asking this someplace more general, but apparantly the word 'port' is used in so many different contexts that a google search turns up fruitless ;) I'm just trying to access a remote postgresql

[GENERAL] Alter privileges for all tables

2005-08-01 Thread Sean Davis
Sorry to ask this again, but I seem to have misplaced the original discussion and can't find it in the archives--could someone point me to the thread on functions to batch alter privileges on all tables (or a subset) in a database? Thanks, Sean ---(end of

Re: [GENERAL] Is there something like Mssql GUID in PostgreSql

2005-07-29 Thread Sean Davis
Title: Re: [GENERAL] Is there something like Mssql GUID in PostgreSql database On 7/29/05 8:04 AM, Dragan Matic [EMAIL PROTECTED] wrote: We are currently migrating a database from Ms Sql server to PostgreSQL. So far replication was done using GUID (global unique identifier) fields which is

Re: [GENERAL] get sequence from remote server

2005-07-24 Thread Sean Davis
On Jul 24, 2005, at 3:23 PM, Stefan wrote: Hi, is there a way to get a sequence from another Postgres-Server? I have some data servers an one admin server. When a new row is inserted on one of the data servers, the server should ask automatically for a sequence number from the admin

Re: [GENERAL] temporary tables ?

2005-07-23 Thread Sean Davis
What is the influence on database growing in comparrison to permanent table frequently inserted/deleted rows ? The tables are dropped automatically after the connection is closed. The database doesn't grow because of temporary tables. As for comparison to a frequently inserted/deleted

Re: [GENERAL] temporary tables ?

2005-07-22 Thread Sean Davis
On Jul 22, 2005, at 1:55 PM, Zlatko Matic wrote: Hello. I have some tables that are updated by several users in the same time and are used in queries for reports. Those tables have rows that are actualy copied from original tables that are not to be altered. There is a procedure that

Re: [GENERAL] Explain Analyse never returns .. maybe a bug

2005-06-29 Thread Sean Davis
- Original Message - From: David Gagnon [EMAIL PROTECTED] Cc: pgsql-general@postgresql.org Sent: Wednesday, June 29, 2005 9:25 AM Subject: [GENERAL] Explain Analyse never returns .. maybe a bug Hi all, I stop the following statement after 3 minutes explain analyse select *

Re: [GENERAL] MacOSX, fink, missing readline/readline.h

2005-06-26 Thread Sean Davis
- Original Message - From: John DeSoi [EMAIL PROTECTED] To: Teunis Peters [EMAIL PROTECTED] Cc: PostgreSQL general pgsql-general@postgresql.org Sent: Sunday, June 26, 2005 6:13 PM Subject: Re: [GENERAL] MacOSX, fink, missing readline/readline.h On Jun 26, 2005, at 4:29 PM, Teunis

Re: [GENERAL] Debugging PL/pgSQL

2005-06-21 Thread Sean Davis
You might want to look at pgEdit. Sean - Original Message - From: Craig Bryden [EMAIL PROTECTED] To: pgsql pgsql-general@postgresql.org Sent: Tuesday, June 21, 2005 3:01 PM Subject: [GENERAL] Debugging PL/pgSQL Hi Does anyone know of a free SQL Editor that allows you to debug

Re: [GENERAL] Debugging PL/pgSQL

2005-06-21 Thread Sean Davis
Ah, yes I should have qualified my statement a bit. Sorry if I was misleading Sean - Original Message - From: Bob To: Sean Davis Cc: Craig Bryden ; pgsql Sent: Tuesday, June 21, 2005 4:57 PM Subject: Re: [GENERAL] Debugging PL/pgSQL Keep in mind

Re: [GENERAL] subqueries

2005-06-19 Thread Sean Davis
- Original Message - From: Tomasz Grobelny [EMAIL PROTECTED] To: pgsql-general@postgresql.org Sent: Sunday, June 19, 2005 6:12 PM Subject: [GENERAL] subqueries I have such a statement: select * from (subquery1) as foo, (subquery2) as bar; Both subqueries are reasonably fast (0.5s)

Re: [GENERAL] Making the DB secure

2005-06-17 Thread Sean Davis
On Jun 17, 2005, at 8:49 AM, Egyd Csaba wrote: Hi, we plan to make available our database from the internet (direct tcp/ip based connections). We want to make it as secure as possible. There are a few users who could access the database, but we want to block any other users to access. Our

Re: [GENERAL] Multiple COPYs

2005-06-17 Thread Sean Davis
On Jun 16, 2005, at 12:32 PM, [EMAIL PROTECTED] wrote: Hello, Having a great time with PG - ported an erp from oracle and db2. First I tried MySql but choked somewhere in the 900 table region. I have a python script to translate the syntax and it loads about 2000 tables. Now I want to COPY

Re: [GENERAL] Executing SQL Script

2005-06-16 Thread Sean Davis
On Jun 15, 2005, at 9:47 PM, Jamie Deppeler wrote: This is a simple question what is the best way to execute a SQL script, this script will create schemas and tables for a database i created. Nearly all clients or interfaces provide a means to execute arbitrary SQL. You can do so in

Re: [GENERAL] Dynamic SQL

2005-06-16 Thread Sean Davis
On Jun 16, 2005, at 6:21 AM, Craig Bryden wrote: Hi I am trying to get information on how to do Dynamic SQL in PostgreSQL (preferably pg/plsql). Please can someone give an exaple of how this is done or direct me to the relevant documentation. There is searchable documentation here

Re: [GENERAL] [HACKERS] mirroring oracle database in pgsql

2005-06-13 Thread Sean Davis
There is DBI-link, but this probably isn't an enterprise solution http://www.pervasive-postgres.com/postgresql/tidbits.asp Sean On Jun 13, 2005, at 2:31 PM, Jonah H. Harris wrote: The contrib/dblink module only works for creating a database link to another PostgreSQL database. I'm

Re: [GENERAL] [HACKERS] mirroring oracle database in pgsql

2005-06-13 Thread Sean Davis
. Sean Sean Davis wrote: There is DBI-link, but this probably isn't an enterprise solution http://www.pervasive-postgres.com/postgresql/tidbits.asp Sean ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send

Re: [GENERAL] return next and pl/perl

2005-06-13 Thread Sean Davis
Eric, You might check out this thread: http://archives.postgresql.org/pgsql-general/2005-06/msg00527.php Someone can almost certainly point to a better thread, but it is a start Sean On Jun 13, 2005, at 12:41 PM, Eric E wrote: Hi David, I ended up doing what you suggest, and it

[GENERAL] CVS stability

2005-06-12 Thread Sean Davis
I've been noticing some very useful things that are probably already in CVS (return_next in pl/perl, IN/OUT parameters, and probably others). I don't have a mission critical production environment and was wondering how unstable a typical 8.1 CVS checkout is? I'm not talking about

Re: [GENERAL] [SQL] Permission denied for language pltclu

2005-06-10 Thread Sean Davis
On Jun 10, 2005, at 5:51 AM, Dinesh Pandey wrote: Hi Richard/ Michael   Thanks for your great help.   I got the problem.   Actually, I was not getting the cause of this problem, because it was working properly at our end.   Actually this problem occurs when the function is being created by

Re: [GENERAL] postgres and xml

2005-06-10 Thread Sean Davis
On Jun 10, 2005, at 12:02 PM, Bruce Momjian wrote: Hrishikesh Deshmukh wrote: Hi All, Is there a way that makes it possible to export sql query results as a xml file? I use postgres 7.4.7 on a debian system. Do i need any packages to export query results as a xml file if its possible?

Re: [GENERAL] return next and pl/perl

2005-06-10 Thread Sean Davis
- Original Message - From: Eric E [EMAIL PROTECTED] To: pgsql-general@postgresql.org Sent: Friday, June 10, 2005 7:24 PM Subject: [GENERAL] return next and pl/perl Hi all, I'm working on implementing a function in PL/PERL that will ready many rows. As such I'd like to use

Re: [GENERAL] postgres and ggobi/xgvis

2005-06-09 Thread Sean Davis
On Jun 8, 2005, at 7:39 PM, Hrishikesh Deshmukh wrote: Hi All, How easy or difficult is it to get ggobi/xgvis working with postgresql?! Is it possible to write a query and send the output straight to ggobi/xgvis without much work? Any pointers. I would think that you would need to

Re: [GENERAL] Copying data from int column to array column

2005-06-08 Thread Sean Davis
On Jun 8, 2005, at 8:21 AM, Adam Witney wrote: Hi, I am trying to copy the data from an integer column into an array column in the same table. Something like this CREATE TABLE test (field1 INT, field2 INT, field3 INT[]); INSERT INTO test VALUES(1); INSERT INTO test VALUES(2); INSERT INTO

Re: [GENERAL] Large Object = invalid input syntax for integer:

2005-06-06 Thread Sean Davis
- Original Message - From: Adam Witney [EMAIL PROTECTED] To: grupos [EMAIL PROTECTED]; pgsql-general pgsql-general@postgresql.org Sent: Monday, June 06, 2005 8:17 AM Subject: Re: [GENERAL] Large Object = invalid input syntax for integer: On 6/6/05 4:58 am, grupos [EMAIL PROTECTED]

Re: [GENERAL] Test for array slice?

2005-06-03 Thread Sean Davis
On Jun 3, 2005, at 12:32 PM, Joe Conway wrote: Peter Fein wrote: I want to do something like this (pardon my pseudocode): A=ARRAY[4, 5, 6, 7, 8] B=ARRAY[5, 6] is_sliceof(A, B), i.e., there exists a slice of A that equals B. My best thought ATM is to convert both to strings and use pattern

Re: [GENERAL] writting a large store procedure

2005-06-02 Thread Sean Davis
I have to recommend pgEdit (nearly free and does have a nearly fully-functional test version). Sean On Jun 2, 2005, at 3:57 AM, Rodríguez Rodríguez, Pere wrote: Hello, I'm writing a large store procedures (more than 700 lines) and I have much problems to debug it. How can I debug it

  1   2   >