Re: [GENERAL] Fedora 13 killed dblink this week...

2010-07-17 Thread Joe Conway
t lead to this symptom, but it sure looks like your libldap and > liblber are out of sync somehow. FWIW, I just tested on fedora 13 and sure enough, I started with the same error, and fixed it with a postgres restart. Joe -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL,

Re: [GENERAL] Create table if not exists ... how ??

2010-07-19 Thread Joe Conway
> THEN > > CREATE TABLE post_codes Probably better to do: DROP TABLE IF EXISTS post_codes; CREATE TABLE post_codes(...); See: http://www.postgresql.org/docs/8.4/interactive/sql-droptable.html HTH, Joe -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and gene

Re: [GENERAL] Create table if not exists ... how ??

2010-07-19 Thread Joe Conway
character varying(10) | not null district | character varying(10) | not null sector | character varying(10) | not null Indexes: "post_codes_pkey" PRIMARY KEY, btree (area, district, sector) 8<- Joe -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Support signature.asc Description: OpenPGP digital signature

Re: [GENERAL] Create table if not exists ... how ??

2010-07-19 Thread Joe Conway
the table (IF EXISTS), and then create it > "anew" - what if there is already data in the table? Read on -- we are way past that already... Joe -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Support

Re: [GENERAL] locating cities within a radius of another

2010-07-21 Thread Joe Conway
> > Is postGIS a viable solution, or should I be looking at a different > approach? Thanks for any suggestions or RTFM pointers. If you want something simple, and not requiring PostGIS, but plpgsql instead, see: http://archives.postgresql.org/pgsql-sql/2003-12/msg00193.php HTH, Joe -

Re: [GENERAL] Redirect sequence access to different schema

2010-07-25 Thread Joe Conway
27;); nextval - 1 (1 row) select nextval('other_schema.foo_id_seq'); nextval - 2 (1 row) Joe -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Support signature.asc Description: OpenPGP digital signature

Re: [GENERAL] return setof : alternatives to holder table

2010-08-15 Thread Joe Conway
eturns TABLE(a int, b int) as $pgsql$ begin a := 1; b := 2; return next; end; $pgsql$ language plpgsql; contrib_regression=# select * from te(); a | b ---+--- 1 | 2 (1 row) HTH, Joe -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source T

Re: [GENERAL] PostgreSQL Write Performance

2010-01-07 Thread Joe Conway
On 01/06/2010 08:49 PM, Greg Smith wrote: > Yan Cheng Cheok wrote: >> The time taken to perform measurement per unit is in term of ~30 >> milliseconds. We need to record down the measurement result for every >> single unit. Hence, the time taken by record down the measurement >> result shall be far

[GENERAL] PL/R Windows binary for PostgreSQL 8.4.x available for testing

2010-01-27 Thread Joe Conway
Many people have been disappointed by the lack of a PL/R Windows binary distribution since PostgreSQL 8.3 came out. Unfortunately the switch from MinGW to MSVC as the Windows build system in Postgres 8.3 effectively rendered Windows an unsupported platform for PL/R. I *finally* have made significa

Re: [GENERAL] dynamic crosstab

2010-01-28 Thread Joe Conway
On 01/28/2010 08:57 AM, Andy Colson wrote: >> >> How do you feel about a little perl? It would be pretty simple, and >> could generate a csv based on any resultset (any number of columns). I'd >> be happy to post a little get you started code if you wanted. If you're going to go through all that,

Re: [GENERAL] dynamic crosstab

2010-01-31 Thread Joe Conway
On 01/31/2010 03:52 PM, Florent THOMAS wrote: > Hello everybody, > > I'm trying to find out how to have a dynamic crosstab as in excel, > ireport,etc... > As i understand of the manual here : > http://docs.postgresqlfr.org/8.4/tablefunc.html > I can have multiple columns. > > Unfortunately, it se

Re: [GENERAL] Is it necessary to have index for child table in following case?

2010-02-03 Thread Joe Conway
On 02/03/2010 05:02 PM, Yan Cheng Cheok wrote: >> >> Are you using INSERT or COPY to insert your data? COPY tends to be >> a lot faster than separate INSERTs, especially if you don't wrap >> the INSERTs in a transaction block and COMMIT them in batches. > > But I do not use File or Stdio. The dat

Re: [GENERAL] Is it necessary to have index for child table in following case?

2010-02-03 Thread Joe Conway
On 02/03/2010 06:59 PM, Yan Cheng Cheok wrote: > PQexec(Database::instance().getConnection(), "copy unit_1 from > stdin"); // | serial | int | int /* But I just do not want to put > as serial. I want it to be auto-increment. However, I have no > idea how to make serial auto-increment, without

Re: [GENERAL] Performance Tuning - Any easy things that I can do ?

2010-02-04 Thread Joe Conway
On 02/04/2010 10:32 AM, Scott Marlowe wrote: > On Thu, Feb 4, 2010 at 8:54 AM, Wang, Mary Y wrote: >> Hi, >> >> I restored my database. However, I noticed performance is poor as compared >> to before. >> Are there some easy things that I can do to improve the performance (besides >> rewriting t

[GENERAL] Anyone interested in a San Diego Postgres Users Group (SD-PUG)?

2010-02-22 Thread Joe Conway
Anyone out there interested in a San Diego PostgreSQL Users Group? If so, I created a meetup here: http://www.meetup.com/SD-PUG/ Please sign up and contact me off list. Thanks, Joe signature.asc Description: OpenPGP digital signature

Re: [GENERAL] select t.name from tbl t (where "name" is not a column name)

2010-02-23 Thread Joe Conway
On 02/23/2010 05:07 PM, raf wrote: > i've just noticed the following behaviour and was wondering > if there's any documentation to explain what it's for. > > create table tbl(id serial primary key, a text, b text, c text); > insert into tbl(a, b, c) values ('abc', 'def', 'ghi'); > insert int

Re: [GENERAL] select t.name from tbl t (where "name" is not a column name)

2010-02-24 Thread Joe Conway
On 02/24/2010 07:16 AM, Igor Neyman wrote: > Joe, > > What PG version are running? > > 8.2 here complains when running your example: > > ERROR: column foo.name does not exist > LINE 6: select foo.name from foo; >^ > > ** Error ** > > ERROR: column foo.name does

Re: [GENERAL] Many-to-many problem

2010-03-18 Thread Joe Conway
On 03/18/2010 03:50 PM, Raymond O'Donnell wrote: > > I can do it easily enough for one user; my problem is doing it for all > users in one fell swoop. > > I'm sure this is a very common problem, but I just can't see the > solution, so any pointers would be greatly appreciated. Is this what you w

Re: [GENERAL] Query inside a C-Function

2010-03-19 Thread Joe Conway
On 03/19/2010 12:26 PM, Enzo Cappa wrote: > Hello! > > I have to make a c function for determining if some point its inside a > set of elliptical geometries (I'm talking about a shared library, used > like a function in the queries ). The geometries are defined in a table, > so the function should

[GENERAL] PGDay.SoCal @ SCALE 10X

2011-12-13 Thread Joe Conway
Joe -- Regards, Joe Conway Los Angeles PostgreSQL Users Group (LAPUG) http://pugs.postgresql.org/lapug San Diego PostgreSQL Users Group (SDPUG) http://www.meetup.com/SD-PUG/ -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consu

[GENERAL] PGDay.SoCal @ SCALE 10X

2011-12-13 Thread joe . conway
This message has been digitally signed by the sender. _GENERAL__PGDay_SoCal___SCALE_10X.eml Description: Binary data - Hi-Tech Gears Ltd, Gurgaon, India -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

[GENERAL] Southern California PostgreSQL Day

2012-01-17 Thread Joe Conway
details see: http://www.socallinuxexpo.org/scale10x/events/los-angeles-postgresql-day Hope to see you there! Joe -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Support -- Sent via pgsql-general mailing list (p

Re: [GENERAL] PL/R install, no pgxs available

2012-04-30 Thread Joe Conway
ich distribution (maybe I missed it though...), but given this I would guess that the R development package is missing as well (needed for R headers and libR.so I believe...) Joe -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consu

Re: [GENERAL] PLR Help

2012-05-02 Thread Joe Conway
of R place the shared object here: /usr/lib/R/lib First, go find lib.R.so. Assuming it is in the above location, place that location in your /etc/ld.so.conf and run ldconfig. HTH, Joe -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Ser

Re: [GENERAL] PLR Help

2012-05-02 Thread Joe Conway
On 05/02/2012 10:59 AM, Joe Conway wrote: > First, go find lib.R.so. Assuming it is in the above location, place ^-- oops, I meant libR.so Joe -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, &am

Re: [GENERAL] partitionning

2005-03-10 Thread Joe Conway
Greg Stark wrote: Actually I have a strong feeling what really _ought_ to happen here is that the inherited tables support in postgres, which never really worked anyways, should be deprecated and eventually removed. All that infrastructure should be repurposed into partitioned tables. That seems li

Re: [GENERAL] plPHP in core?

2005-04-02 Thread Joe Conway
Thomas Hallgren wrote: Tom Lane wrote: are a few features shy of a load already. I'm pretty sure pl/r and pl/java will need changes to support this feature too. If they were in core CVS then I'd consider it part of my responsibility to fix 'em ... but they aren't, so it isn't my problem, so it f

Re: [GENERAL] array_append not working

2005-04-05 Thread Joe Conway
Lucas F. wrote: Sorry, this is probably a dumb mistake on my part. New to Postgres. Running 8.0 on Linux. The array_append below is giving me a syntax error, and I have no idea what I am doing wrong. array_append(v_query_array,(rec.item_field_name || '=' || v_value::text)::text); You need to assig

Re: [GENERAL] Postgres 8.0.3 Fedora RPMS ?

2005-05-22 Thread Joe Conway
Devrim GUNDUZ wrote: Our FC2 x86_64 bit FC2 packager (Joe Conway) is on a long trip; I'm not sure that we will be able to prepare RPMs for that arch/distro right now :( I got back finally last night, and I'm just now at 9 days behind in reading the list traffic, but I should

Re: [GENERAL] Postgres 8.0.3 Fedora RPMS ?

2005-05-24 Thread Joe Conway
Joe Conway wrote: I got back finally last night, and I'm just now at 9 days behind in reading the list traffic, but I should be able to build x86_64 FC3 RPMs in the next day or two (unless someone has beat me to it). Unfortunately I no longer have an x86_64 FC2 machine available t

Re: [GENERAL] Test for array slice?

2005-06-03 Thread Joe Conway
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 matching - any better ideas? I can't think of a r

Re: [GENERAL] Questions about Views, Rules and DBLink

2005-07-31 Thread Joe Conway
Tom Lane wrote: Joao Afonso <[EMAIL PROTECTED]> writes: So (finally), my question is why does this happen? Using instead on the users_util insert rule shouldn't discard the original query and rewrite it according to the specified on the rule?? Is this a problem of dblink? I hadn't noticed th

Re: [GENERAL] searching array

2005-10-16 Thread Joe Conway
Matthew Peter wrote: I was trying to search a array with a GTE to value and it doesn't work. Is this supported? Or am I missing something? SELECT * FROM sal_emp WHERE 1 >= ALL (pay_by_quarter); Works for me: CREATE TABLE sal_emp ( name text, pay_by_quarter integer[], schedule text[][]

Re: [GENERAL] searching array

2005-10-17 Thread Joe Conway
Matthew Peter wrote: Shouldn't >= also return Carols records since she contains records GREATER THAN 1? This is the problem I'm having, there's no errors, just no records matching the > (gt) part. Only exact matches. Look again at your query: SELECT * FROM sal_emp WHERE 1 >= ALL (pay_b

Re: [GENERAL] PG 8.0.4, Centos and 64 bit

2005-10-17 Thread Joe Conway
Devrim GUNDUZ wrote: We currently don't have a x86_64 server that runs RHEL 4. That's why there are no RPMs for that arch (I've uploaded RPMs for many platforms BTW). If someone wants to assist us to build RPMs for that platform, please contact me. We'll give you all the necesarry information

Re: [GENERAL] Built in function question

2005-11-02 Thread Joe Conway
Tony Caduto wrote: [question about finding data directory] I found it in the pg_settings view, but if there is another way I would like to know about it. As Tom aluded, you can also do this: regression=# select current_setting('data_directory'); current_setting --

Re: [GENERAL] Array Values and References

2005-11-03 Thread Joe Conway
Omachonu Ogali wrote: I have a table that contains my unique identifiers and their respective values. In another table, I have a field that is an array of integers. Is there a simple way for one to build a constraint that checks each array value against the primary key table even though the fiel

Re: [GENERAL] Looping through arrays

2005-11-04 Thread Joe Conway
Robert Fitzpatrick wrote: I have a field with 'AA-BB-CC-DD' and I want to pull those four values into an array and then loop through the array inserting records into a table for each element. Can you someone point me to an example of this in pl/pgsql? Something like this? create table testfoo

Re: [GENERAL] Aggregates, group, and order by

2005-11-07 Thread Joe Conway
Michael Glaesemann wrote: I'm trying to concatenate strings in variable orders using a custom aggregate. However, I'm having a difficult time figuring out the SQL I need to use to accomplish this. Here's a test case that shows the error I'm getting. select bar_id, array_accum(foo_value) f

Re: [GENERAL] Multi-parameter aggregates.

2005-11-21 Thread Joe Conway
Berend Tober wrote: I'm stuck on not knowing how to define a aggregate that takes more that one variable as its argument This is currently unsupported. Joe ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http:/

Re: [GENERAL] How to trim Bytea fields

2005-11-22 Thread Joe Conway
Howard Cole wrote: Hi, I have an bytea field that contains data with a lot of trailing blank space composed of multiple '\000' zero bytes. Does anyone know of a quick SQL fix to trim these bytes from the data? trim() will remove '\000' bytes from both ends -- would that work for you? select

Re: [GENERAL] Set Returning Function (Pipelining)

2005-11-22 Thread Joe Conway
tschak wrote: I have a question on set returning functions. In one of the TechDocs on the postgres website it says: "Currently SRF returning PL/pgSQL functions must generate the entire set before the result is returned" It also says that this might be changed in future releases (later than 7.3).

Re: [GENERAL] Dead Lock problem with 8.1.3

2006-09-26 Thread Joe Conway
Martijn van Oosterhout wrote: On Tue, Sep 26, 2006 at 03:59:48PM +0200, Kai Hessing wrote: No one any idea? *sigh* It probably has something to with the fact that you didn't explain what you meant by "deadlock". Also, you refer to a temp table, yet don't indicate which table it is. You'll n

Re: [GENERAL] Dead Lock problem with 8.1.3

2006-09-27 Thread Joe Conway
Kai Hessing wrote: Deadlock means it hangs up and doesn't terminate through timeout. The system goes into an endless loop. The part ('SELECT sid FROM stud_vera WHERE veraid = 2') seems to create a temporary table again and again and again It is possible for a query to run for many days, an

Re: [GENERAL] R and postgres

2006-11-07 Thread Joe Conway
Reece Hart wrote: I'd like to get R to talk to postgresql, but my head's spinning among a web of broken links, way outdated web pages, project deprecation announcements and a terrible signal:link ratio. Rdbi and RdbiPgSQL seem to be the answer, despite both being apparently defunct projects.

Re: [GENERAL] R and postgres

2006-11-07 Thread Joe Conway
Reece Hart wrote: On Tue, 2006-11-07 at 00:22 -0800, Joe Conway wrote: I think you want this: http://bioconductor.org/packages/1.9/bioc/html/RdbiPgSQL.html The bioconductor project is now maintaining RdbiPgSQL. I think many people also use RODBC to connect R with Postgres. I almost sent you

Re: [GENERAL] connectby usage question

2006-11-15 Thread Joe Conway
Eric E wrote: However, we would like to return a numbering the items based on the order they return, like so; 1 (first item) 1.1 (1 branch, 1st item) 1.2 (1 branch, 2nd item) 1.2.1 (1.2 branch, 1st item) 1.2.2 1.2.2.1 1.3 etc. Is there an option in connectby to do this directly, or do we n

Re: [GENERAL] Any form of connection-level "session variable" ?

2007-01-04 Thread Joe Conway
Scott Ribe wrote: What about: create function set_emp_id() returns void as $$ begin drop table if exists emp_1_id; select emp_id into temp emp_1_id from secureview.tbl_employee where username = current_user; end; $$ language plpgsql; create function get_emp_id() returns int as $$

Re: [GENERAL] Array constructor requires one argument

2007-01-09 Thread Joe Conway
Tom Lane wrote: Martijn van Oosterhout writes: On Tue, Jan 09, 2007 at 10:02:09AM -0500, Tom Lane wrote: Define the data type of SELECT ARRAY[]; The same type as: SELECT NULL; Hardly, because whatever type NULL has, it's not an array type. Here's a link to the initial discussion on

Re: [GENERAL] Matrix (linear algebra) operations and types in PG?

2007-03-25 Thread Joe Conway
Webb Sprague wrote: Hi all, Take a look at pl/r, http://www.joeconway.com/plr/. This is a interface to R: http://www.r-project.org/ I'm not familiar with this, but i think, this may be helpful for you. Shoot -- I should have said that I knew about plr -- supposedly a great project (maybe the

Re: [GENERAL] Interpolation of environment variables in SQL at runtime?

2004-10-31 Thread Joe Conway
Andy Gimblett wrote: Hopefully what I'm asking is fairly obvious. But is it possible? I can imagine some fairly unwiedly ways to do this involving preprocessing, but would involve jumping through lots of hoops, and I'd hope for a cleaner solution. Environment variables seems the obvious "Unixy"

Re: [GENERAL] MD5 for PostgreSQL 7.3.4

2004-11-03 Thread Joe Conway
Tk421 wrote: I'm looking for a function that returns a md5 encryption for postgreSQL 7.3.4 I've found that this function exists on version 7.4, but I have had problems installing it on my Windows XP with Cygwin, so I need to found it for version 7.3 See contrib/pgcrypto HTH, Joe ---

Re: [GENERAL] MD5 for PostgreSQL 7.3.4

2004-11-03 Thread Joe Conway
Tk421 wrote: I've been looking at contrib/pgcrypto but it hasn't any information about md5 encryption Sure it does. See README.pgcrypto: "SQL FUNCTIONS = If any of arguments are NULL they return NULL. digest(data::bytea, type::text)::bytea Type is here the algorithm

[GENERAL] rc1 fedora core rpms

2004-12-03 Thread Joe Conway
As promised, I've posted 8.0.0rc1 rpms here: http://www.joeconway.com/postgresql-8.0.0rc/ Again note that these are not "official" PGDG rpms, just my own home brew. In addition to the change of Postgres itself from beta5 to rc1, I updated jdbc to latest beta (pg80b1.308*). Joe

Re: [GENERAL] How can I expand serialized BLOBs into pseudo columns

2004-12-04 Thread Joe Conway
Eric Brown wrote: SELECT expandobj(obj), * from mytable; I get: ERROR: cannot display a value of type record I think/hope I'm missing something pretty stupid, but I can't figure out what it might be. Any help would be appreciated. There might even be a quite better way. What you're trying to do i

Re: [GENERAL] [ADMIN] plperl loading

2004-12-13 Thread Joe Conway
Marek Lewczuk wrote: I've made some tests with plperl and I see that when plperl function is executed for the first time, then it takes much more time. I know that this is a "shared library" problem - is there a way to preload plperl every connection or maybe I can build plperl into postgresql s

Re: [GENERAL] Join on virtual table

2004-12-11 Thread Joe Conway
Rory Campbell-Lange wrote: Hi. I'd like to return a result set from a plpgsql function constructed out of a 'virtual table' joined to an actual table, and struggling to find a sane approach. I have a table 'recs' with records like this. day | nums --- 2 | 1 5 | 3

Re: [GENERAL] Merging Data from Multiple DB

2005-01-03 Thread Joe Conway
anon permutation wrote: For performance reasons, each branch must has its own database and a centralized transactional system is not an option. I was considering just centralizing primary keys generation, but that seems very slow too. Segmenting primary keys among the branches is doable, but it

Re: [GENERAL] Global/persistent variables

2005-01-06 Thread Joe Conway
Ronnie Meier Ramos wrote: AFAIK PG doesn't have packages - this is not a problem since I can handle it with different schemas or some naming convention, but is there a way to declare persistent variables (that would be "visible" to any function up to the end of the session) ? You might be able t

Re: [GENERAL] Global/persistent variables

2005-01-08 Thread Joe Conway
Ronnie Meier Ramos wrote: Unfortunatly, faking them with some C functions would be very complex because in this application's case most of this variables are record types and some are arrays (pl/tables)... :-( For record types, why not just use cursors? They can be made to persist until the end

Re: [GENERAL] Function for retreiving datatype

2005-01-10 Thread Joe Conway
Michael Fuhr wrote: On Tue, Jan 11, 2005 at 11:00:15AM +1100, Brendan Jurd wrote: Your coltype() function is exactly what I'm looking for. I'd envisaged something that takes an anyelement argument and returns the type as text, but returning the OID is even better. [...snip slick function...] Now

Re: [GENERAL] Réf. : [GENERAL] Debugging

2005-01-13 Thread Joe Conway
[EMAIL PROTECTED] wrote: Aren't there any way to debug server programming functions (whatever the language) ?? What's wrong with gdb? Joe ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining

Re: [GENERAL] question about porting least and greatest from oracle

2005-01-29 Thread Joe Conway
Anders Sutinen wrote: i am currently porting from oracle to postgres and i cant seem to find anything equivalent to oracles greatest and least functions, any help appreciated, plz reply straight to my e-mail as i am not yet on the list, This one has come up a few times before. See: http://archive

Re: [Pgsqlrpms-hackers] Re: [GENERAL] DBlink documentation

2005-12-17 Thread Joe Conway
Tom Lane wrote: Actually, I don't think you can reasonably blame the Debian packager for having overlooked the fact that contrib/dblink has more documentation files besides its README. The PGDG RPM people overlooked that too, as did Red Hat (ie, me). Well, in my own defense, I pointed out the

Re: [GENERAL] MDX support in postgresql

2005-12-31 Thread Joe Conway
Tom Lane wrote: Rikardo Tinauer <[EMAIL PROTECTED]> writes: I am wondering if you are considenring supporting MDX syntax in PostgreSQL? Is there a standard for that, or is it just something Microsoft-proprietary? Stuff that is in the SQL2003 standard is generally on our "wish list" at some l

Re: [GENERAL] PostgreSQL Arrays and Performance

2006-01-03 Thread Joe Conway
Marc Philipp wrote: During a daily update process new timestamps are collected and existing data rows are being updated (new rows are also being added). These changes affect a large percentage of the existing rows. What we have been observing in the last few weeks is, that the overall data

Re: [Pgsqlrpms-hackers] Re: [GENERAL] DBlink documentation

2006-01-03 Thread Joe Conway
Tom Lane wrote: Joe Conway <[EMAIL PROTECTED]> writes: I'm happy to lump all the docs back into the README if that's what you want, but I split it up in the first place because it was getting very long. No, I'm not really proposing that we force all contrib modules

Re: [GENERAL] Drop database/create database broken in 7.4?

2006-01-05 Thread Joe Conway
John Wells wrote: I've noticed some oddities. The script connects to template1, drops the target database, creates the target database, and the rebuilds the tables. However, two specific tables and sequences are not dropped, although the drop command completes successfully. Anyone know what

Re: [GENERAL] Arrays and Performance

2006-01-06 Thread Joe Conway
[EMAIL PROTECTED] wrote: Would it be more efficient to not use an array for this purpose but split the table in two parts? Any help is appreciated! This is a duplicate of your post from the other day, to which I responded, as did Tom Lane: http://archives.postgresql.org/pgsql-general/2006-0

Re: [GENERAL] Seeking comments on schema design and data integrity

2006-02-12 Thread Joe Conway
Tim Hart wrote: I am by no means a DBA, but I'm developing a database app for our local little league. I would appreciate some comments regarding the following design. It is probably overkill, but you might want to take a look at XTOSS (XML Team Open Sports Schema): http://www.xtoss.

Re: [GENERAL] What is the point of create or replace view command

2006-06-04 Thread Joe Conway
Chris Velevitch wrote: But what about my original question? "What is the point of the create or replace view command if you can't change the column and data types?" -- create table t1 create table t1(f int); -- create view v1 based on table t1 create view v1 as select * from t1; -- cre

Re: [GENERAL] Dynamic loading of C functions: Badly stuck

2006-06-21 Thread Joe Conway
Jasbinder Bali wrote: CREATE FUNCTION command(integer) RETURNS integer AS 'usr/include/pgsql/server/test_func', 'command' LANGUAGE C STRICT; when i try to run this function, always gives me the follwoing error: ERROR: could not access file "usr/include/pgsql/server/test_func": No

Re: [GENERAL] Dynamic loading of C functions: Badly stuck

2006-06-21 Thread Joe Conway
Jasbinder Bali wrote: Now the error is different. It cries something on the permissions. ERROR: could not load library "/usr/include/pgsql/server/test.so": /usr/include/pgsql/server/test.so: failed to map segment from shared object: Permission denied Can you comment on this? What does l

Re: [GENERAL] aggregate of bitstrings

2006-06-22 Thread Joe Conway
TJ O'Donnell wrote: maybe the aggregator (whoever,whatever that is) handles null args differently, not calling the func when the arg is null? see: http://www.postgresql.org/docs/8.1/interactive/sql-createaggregate.html specifically: "If the state transition function is declared "strict",

Re: [GENERAL] A function which returns all rolname from pg_roles.

2006-07-10 Thread Joe Conway
Karen Hill wrote: How do I make this function work? I am trying to get all the rolnames from pg_roles. Why not just do "SELECT rolname FROM pg_roles;"? Anyway, in PL/pgSQL: CREATE OR REPLACE FUNCTION test() RETURNS SETOF name AS $$ DECLARE rec record; BEGIN FOR rec IN SELECT ro

Re: [GENERAL] Trying to connect to an Oracle instance...

2006-07-13 Thread Joe Conway
A.M. wrote: On Thu, July 13, 2006 11:03 am, Tony Caduto wrote: Spendius wrote: I've been trying to perform a connection to an Oracle DB for a while, to no avail. Here is what I get at my psql prompt: postdb=# Select dblink_connect('login','hostaddr= port=1521 \ If you are trying to connect t

Re: [GENERAL] Problem creating a function

2006-07-19 Thread Joe Conway
Cornelia Boenigk wrote: The file does exist in the path /home/database/pgdata/cobis/bitvg/: -rwxr-xr-x 1 root root 133 Jul 19 13:13 bitvg.c -rwxr-xr-x 1 root root 782 Jul 19 13:13 bitvg.o -rwxr-xr-x 1 root root 3198 Jul 19 13:13 bitvg.so What do I miss? Does the postgres user have acce

Re: [GENERAL] Problem creating a function

2006-07-19 Thread Joe Conway
Cornelia Boenigk wrote: Hi Joe > Try: > su postgres > cd /home/database/pgdata/cobis/bitvg Succeeds, ls -la shows all files in that directory and can open them with less. Kind of odd, particularly given your reply to Tom's question in a nearby post. Could it be an SELinux issue? Jo

Re: [GENERAL] Best Procedural Language?

2006-08-01 Thread Joe Conway
Joshua D. Drake wrote: - Doing a lot of DB manipulation in pl/Perl or pl/Tcl or such requires having an extra level of function manipulations that won't be as natural as straight pl/pgsql. Another important distinguishing characteristic is whether it supports set returning functions.

Re: [GENERAL] pl/R problem

2006-08-23 Thread Joe Conway
Don Isgitt wrote: Thanks for the reply and the research. The relevant file is [EMAIL PROTECTED] R-2.3.0]$ ls -l $R_HOME/etc/Renviron -rw-rw-r--1 djisgitt djisgitt 1151 Jun 1 11:42 /home/djisgitt/R-2.3.0/etc/Renviron so I don't see that as the problem. I use R quite a lot, so I know

Re: [GENERAL] pl/R problem

2006-08-23 Thread Joe Conway
Don Isgitt wrote: Quite so, Alvaro & Michael. Yes, world read as I said, but missing execute at one level. Sorry for my carelessness. It works as expected now. Ah, good to know. I'll add myself a todo to eliminate the crash in this scenario. I will include a fix in the next release, which wi

Re: [GENERAL] Dblink and connections to MySQL?

2006-08-30 Thread Joe Conway
Brian Maguire wrote: Does anyone have any recommendations or experiences on connecting a postgres db to a mysql db possibly through dblink or another technology? Does dblink just do postgres to postgres? There is not a lot documentation on that contrib. What brings you to that conclusion? d

Re: [GENERAL] Determining what a user can access

2003-12-10 Thread Joe Conway
Martijn van Oosterhout wrote: Thanks, I've never seen that page before. I guess it must be new. There may be more elegant ways to do this, and I'm sure this is incomplete/could be improved upon, but just for grins: --- create type us

Re: [GENERAL] Strange permission problem regarding pg_settings

2003-12-10 Thread Joe Conway
Florian G. Pflug wrote: I installed a postgres-application (which was developed on debian woody) on red hat 9 today, using the postgres 7.3 rpms from redhad. One of my the triggers uses the pg_settings table (more precisely, it updates that table to change the search_path temporarily). With the

Re: [GENERAL] Strange permission problem regarding pg_settings

2003-12-10 Thread Joe Conway
Tom Lane wrote: Now, why does Florian see a permissions failure (which is really the *right* behavior) when we don't? He didn't say exactly which PG version he was running, but I see a likely-related bug fix between 7.3.2 and 7.3.3: That seems to be it: # psql regression Welcome to psql 7.3.2, th

Re: [GENERAL] functions returning sets

2003-12-17 Thread Joe Conway
Tom Lane wrote: Joe Conway <[EMAIL PROTECTED]> writes: Any guidance on the preferred fix? We cannot fix this by changing ExecScanSubPlan as you suggest. That would amount to saying that all plans have to be run to completion, which destroys LIMIT to name just one unpleasant conseque

Re: [GENERAL] functions returning sets

2003-12-18 Thread Joe Conway
Tom Lane wrote: You may not even need to add any fields to FuncCallContext --- consider passing the fcinfo pointer to the callback, rather than passing the FuncCallContext pointer. Dept. of second thoughts: better pass the flinfo pointer, instead. fcinfo might point to temporary space on the stack.

Re: [GENERAL] Strange permission problem regarding pg_settings

2003-12-26 Thread Joe Conway
Tom Lane wrote: I suspect the fact that the pre-patch code made the "right" permissions check was really coincidental, and that the correct fix will not involve reversion of that patch but rather adding a facility somewhere to ensure that the original view gets properly permission-checked even if t

Re: [GENERAL] Hierarchical queries

2004-01-10 Thread Joe Conway
[EMAIL PROTECTED] wrote: RH> I could have sworn there was something in contrib/ too, but I can't see it RH> now. Yes it is gone. :) See contrib/tablefunc for a function called connectby(). Joe ---(end of broadcast)--- TIP 5: Have you checked our ex

Re: [GENERAL] Support for functions returning mutliple result sets?

2004-01-22 Thread Joe Conway
[EMAIL PROTECTED] wrote: I know I can write plpgsql functions that return sets. Does postgres support returning multiple sets from a function? No. Joe ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate

Re: [GENERAL] Predictive or scoring solution for PostgreSQL ?

2004-02-04 Thread Joe Conway
Marc A. Leith wrote: Other tools do similar things - another was Knowledge Seeker from Angoss Software - which built turnkey decision trees (this was fairly cheap depending on the system it is running on). SAS also produced a turnkey modeling solution (not cheap ). You could also try SPSS (che

Re: [GENERAL] dblink: rollback transaction

2004-02-05 Thread Joe Conway
John Sidney-Woollett wrote: I think PG badly needs nested transaction support... ;) I think that is a main take-away here. You should not try to depend on dblink as a robust replication solution. Perhaps if postgres had two-phase commit and nested transactions, but not at the moment. That said,

Re: [GENERAL] dblink: rollback transaction

2004-02-05 Thread Joe Conway
Oleg Lebedev wrote: Agreed. I wonder if I should simulate local Xactions by using local dblink calls? What do you think, Joe? It is an interesting thought. Withing a single plpgsql function, open one local and one remote persistent, named dblink connection. Start a transaction in each. Go into yo

Re: [GENERAL] dblink - custom datatypes don't work

2004-02-05 Thread Joe Conway
Mark Gibson wrote: [custom datatype oid mismatch between local and remote side of dblink ] Is this a limitation of PostgreSQL or dblink? Could dblink use type names instead of oid's? If not, could dblink be adapted to use some kind of remote oid -> local oid mapping table for datatypes? I would be

Re: [GENERAL] Casting 'record' to a composite type.

2004-02-06 Thread Joe Conway
Mark Gibson wrote: I'd like to do something like this: CREATE TYPE my_type AS (id integer, title text); SELECT * FROM fn_returning_setof_record( ... ) AS t my_type; or SELECT * FROM fn_returning_setof_record( ... )::my_type AS t; I've not been able to find anything like this in

Re: [GENERAL] how can I select into an array?

2004-02-06 Thread Joe Conway
Pavel Stehule wrote: CREATE AGGREGATE aggarray (BASETYPE = ANYELEMENT, SFUNC = aggregate_array, STYPE = ANYARRAY); Or, from the docs, see: http://www.postgresql.org/docs/current/static/xaggr.html CREATE AGGREGATE array_accum ( sfunc = array_append, basetype = anyelement, stype = any

Re: [GENERAL] how can I select into an array?

2004-02-06 Thread Joe Conway
Pavel Stehule wrote: if you can in plpgsql 7.2.x return array of known type, you can replace anyarray and anyelement like varchar[], varchar. But I don't know if it 7.2 supported. PL/pgSQL array support in anything earlier than 7.4 is pretty weak. I would strongly recommend upgrading to 7.4 if a

Re: [GENERAL] connectby for BYTEA keys

2004-02-08 Thread Joe Conway
David Garamond wrote: Now that I enter as an escaped string, I get this error: db1=> SELECT * FROM connectby('treeadj1b', 'id', 'parent_id', '\\353\\024\\257\\130\\336\\305\\061\\045\\276\\175\\106\\056\\101\\173\\217\\326', 0) AS t(keyid bytea, parent_keyid bytea, level int); ERROR: invalid in

Re: [GENERAL] How to determine current database?

2004-02-13 Thread Joe Conway
Ron St-Pierre wrote: I am using postgres 7.3.4 and need to be able to determine which database a query is being run in (from a script). pg_database lists databases but doesn't tell me which one is currently active. See: http://www.postgresql.org/docs/7.3/static/functions-misc.html HTH, Joe ---

Re: [GENERAL] Rows to columns

2004-02-24 Thread Joe Conway
Josué Maldonado wrote: The problem is I need show the data in this way: TIPOOCT03NOV03DIC03ENE04FEB04 NQTY 490 360 950 700 500 NSOLD46003900710062005000 NCOST18501760300

<    1   2   3   >