Re: [GENERAL] server closed unexpectedly while executing a function

2007-02-23 Thread Michael Fuhr
he rest Do the database logs of the server you're connecting to show what might be wrong? Have you used any of DBI's tracing options (see TRACING in the DBI manual page)? Does a standalone Perl script fail the same way? I'd suggest making sure the code works in a standalone scrip

Re: [GENERAL] How can you tell if a function is immutable from psql?

2007-02-21 Thread Michael Fuhr
active/catalog-pg-proc.html -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] postgresql vs mysql

2007-02-21 Thread Michael Fuhr
On Wed, Feb 21, 2007 at 01:45:08PM -0600, Ron Johnson wrote: > On 02/21/07 08:42, Michael Fuhr wrote: > > Not as good as "ERROR: hey bonehead, there ain't no such date" but > > But it *inserts the "data"*! I didn't say otherwise and I'm not

Re: [GENERAL] postgresql vs mysql

2007-02-21 Thread Michael Fuhr
---+ | Warning | 1265 | Data truncated for column 'td' at row 1 | +-+--+-+ 1 row in set (0.00 sec) Not as good as "ERROR: hey bonehead, there ain't no such date" but at least it's s

Re: [GENERAL] encoding problem at restore

2007-02-18 Thread Michael Fuhr
1252 (especially the latter if the data originated on Windows). Alternatively, you could use a converter like iconv or uconv to convert the file to UTF-8 before feeding it to psql. -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] [ANNOUNCE] Advisory on possibly insecure security definer functions

2007-02-17 Thread Michael Fuhr
then search_path wouldn't be reset unless you catch exceptions and reset the path in the exception-handling code. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Is it possible to compress a table any further?

2007-02-16 Thread Michael Fuhr
are you vacuuming the table? Does it receive a lot of updates and/or deletes? Have you done a full-database VACUUM VERBOSE to see if your free space map settings need to be adjusted? What version of PostgreSQL are you running? -- Michael Fuhr ---(end of broadcast)-

Re: [GENERAL] User privilege information.

2007-02-15 Thread Michael Fuhr
cs/8.2/interactive/functions-info.html#FUNCTIONS-INFO-ACCESS-TABLE http://www.postgresql.org/docs/8.2/interactive/catalogs.html -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] line folding versus shop line

2007-02-11 Thread Michael Fuhr
set to "less"? -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] Move data between two databases SQL-ASCII to UTF8

2007-02-08 Thread Michael Fuhr
encoding to whatever encoding the data is really in; likely guesses for Western European languages are LATIN1, LATIN9, or perhaps WIN1252. -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate

Re: [GENERAL] temp tables in functions?

2007-02-08 Thread Michael Fuhr
the above yields a syntax error. Also, EXECUTE isn't necessary for the CREATE TABLE statement, although as Bruno mentioned EXECUTE will be necessary for other statements due to plan caching. And ON COMMIT DROP won't help if you call the function multiple times in the same transaction. --

Re: [GENERAL] encode, lower and 0x8a

2007-01-29 Thread Michael Fuhr
On Mon, Jan 29, 2007 at 12:52:33PM -0500, Michael Artz wrote: > On 1/27/07, Michael Fuhr <[EMAIL PROTECTED]> wrote: > >SELECT decode(lower(textin(byteaout(bytes))), 'escape') FROM mytable; > > That seems to work correctly, however I missed the functions texti

Re: [GENERAL] Postgresql 8.1: plperl code works with LATIN1, fail

2007-01-29 Thread Michael Fuhr
ng explicit conversions? I think the goal is not to have to do so, i.e., to have PL/Perl treat string literals as UTF-8 if the database encoding is UTF-8. PostgreSQL 8.2 does so but earlier versions don't. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] MULE_INTERNAL translation to win1250

2007-01-28 Thread Michael Fuhr
On Sun, Jan 28, 2007 at 07:27:12PM -0700, Michael Fuhr wrote: > I wonder if the OP is doing something like this: [...] > test=> INSERT INTO test VALUES (E'\202\232'); -- \202=0x82, \232=0x9a Another possibility, perhaps more likely, is that some connection didn't set cl

Re: [GENERAL] MULE_INTERNAL translation to win1250

2007-01-28 Thread Michael Fuhr
;t have mappings in win1250; hence the conversion error when the client tries to read the data. Just a guess. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] encode, lower and 0x8a

2007-01-27 Thread Michael Fuhr
ugh it's text? Do you want the end result to be text with escape sequences or do you want to convert it back to bytea? Something like this might work: SELECT lower(textin(byteaout(bytes))) FROM mytable; To turn the result back into bytea: SELECT decode(lower(textin(byteaout(bytes))), 'e

Re: [GENERAL] Postgresql 8.1: plperl code works with LATIN1, fails with UTF8

2007-01-27 Thread Michael Fuhr
de to 8.2 then you might be able to work around the problem by creating the function as plperlu and adding 'use utf8;'. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] triggers and TriggerData

2007-01-22 Thread Michael Fuhr
http://www.postgresql.org/docs/8.2/interactive/sql-createtrigger.html http://www.postgresql.org/docs/8.2/interactive/plpgsql-trigger.html http://www.postgresql.org/docs/8.2/interactive/trigger-interface.html (These links are to the 8.2 documentation but earlier versions also support arguments to trigger

Re: [GENERAL] can't CREATE TRIGGER

2007-01-21 Thread Michael Fuhr
that is. Make sure your applications don't keep transactions open longer than necessary. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Spam from EnterpriseDB?

2007-01-19 Thread Michael Fuhr
On Thu, Jan 18, 2007 at 08:02:58PM -0700, Michael Fuhr wrote: > On Thu, Jan 18, 2007 at 06:14:23PM -0800, Joshua D. Drake wrote: > > http://www.commandprompt.com/ :) We are more cost effective and have > > been doing it for much, much longer ;) > > As somebody with a meas

Re: [GENERAL] Spam from EnterpriseDB?

2007-01-18 Thread Michael Fuhr
email to my personal address has not gone unremarked. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Export to shape file

2007-01-14 Thread Michael Fuhr
out authentication (adjust the following links for whatever version of PostgreSQL you're running). http://www.postgresql.org/docs/8.2/interactive/client-authentication.html http://www.postgresql.org/docs/8.2/interactive/libpq.html -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Remove diacritical marks in SQL

2007-01-14 Thread Michael Fuhr
CREATE FUNCTION unaccent(string text) RETURNS text AS $$ use Unicode::Normalize; my $nfd_string = NFD($_[0]); $nfd_string =~ s/[\p{Mn}\p{Me}]//g; return NFC($nfd_string); $$ LANGUAGE plperlu IMMUTABLE STRICT; SELECT unaccent('ěščřžýáíé'); unaccent --- escrzyaie (1 row) -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] psql script error handling

2006-12-29 Thread Michael Fuhr
xing the problem rather than trying to work around it. You might just need to set client_encoding or convert the data to the server's encoding. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] resetting sequence to cur max value

2006-12-12 Thread Michael Fuhr
FROM foo)); setval 3 (1 row) test=> INSERT INTO foo (t) VALUES ('four'); INSERT 0 1 test=> SELECT * FROM foo; id | t +--- 1 | one 2 | two 3 | three 4 | four (4 rows) -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] ERROR: type "i" does not exist

2006-11-14 Thread Michael Fuhr
ror Reporting and Logging" in the documentation for information about logging. One way to identify the offending query would be to set log_min_error_statement = error in postgresql.conf and reload the server. http://www.postgresql.org/docs/8.1/interactive/runtime-config-logging.

Re: [GENERAL] Timeout Value on network error

2006-11-04 Thread Michael Fuhr
will soon be re-established. > Is there a timeout value that we can configure, so all PQ* functions > return consistently? You could use asynchronous command processing with poll() or select(). http://www.postgresql.org/docs/8.1/interactive/libpq-async.html -- Michael Fuhr ---

Re: [GENERAL] opening a channel between two postgreSQL-servers?

2006-11-04 Thread Michael Fuhr
in one of those languages can do anything a standalone application could do, such as connecting to another database, even a different DBMS (you could connect from PostgreSQL to MySQL, Oracle, SQL Server, etc.). -- Michael Fuhr ---(end of broadcast)--

Re: [GENERAL] Geometric Datatypes

2006-11-04 Thread Michael Fuhr
ing about PostgreSQL's native geometry types specifically or are you also interested in how PostGIS is being used? If the latter then see their case studies: http://postgis.refractions.net/documentation/casestudies/ -- Michael Fuhr ---(end of b

Re: [GENERAL] PostGIS

2006-11-03 Thread Michael Fuhr
e accustomed to thinking (latitude longitude) and who therefore create geometries as (Y X). -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] creating a dumpfile from a view

2006-10-30 Thread Michael Fuhr
data. > But you have to use tables with copy, not views. That'll change in 8.2. Here's an item from the Release Notes: * COPY TO can copy the output of an arbitrary SELECT statement -- Michael Fuhr ---(end of broadcast)--- TIP 9: In

Re: [GENERAL] Instead of Triggers

2006-10-29 Thread Michael Fuhr
ttp://www.postgresql.org/docs/8.1/interactive/rules.html -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] DELETE performance issues

2006-10-29 Thread Michael Fuhr
hat logging I can turn on so I can figure out > what is causing the high load and slow deletes? I can then use that > info to tune the runtime parameters. What non-default settings are you currently using? -- Michael Fuhr ---(end of broadcast)--

Re: [GENERAL] Postrgres Sequence Error

2006-10-22 Thread Michael Fuhr
om the sequence and now the sequence is colliding with those values. Is it possible that something is resetting the sequence? Have you enabled statement logging to investigate? -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] PostGIS

2006-10-19 Thread Michael Fuhr
t('POINT(12 34)')); distance_sphere - 0 (1 row) If you're getting unexpected behavior then please post a test case to postgis-users. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] problems installing pg on solaris

2006-10-19 Thread Michael Fuhr
control the configure settings. > gmake[2]: ar: Command not found I don't know where Solaris 10 puts ar but in earlier versions it's in /usr/ccs/bin. Try adding that directory to your PATH. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Maximum size of database

2006-10-17 Thread Michael Fuhr
lso, you might get more help on the pgsql-performance list. -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly

Re: [GENERAL] BEGIN WORK READ ONLY;

2006-10-14 Thread Michael Fuhr
AD ONLY, though. > IIRC we let a "read only" transaction create and modify temp tables. Am I missing something then? test=> BEGIN READ ONLY; BEGIN test=> CREATE TEMPORARY TABLE foo (x integer); ERROR: transaction is read-only -- Michael Fuhr ---(end of

Re: [GENERAL] BEGIN WORK READ ONLY;

2006-10-14 Thread Michael Fuhr
still have to remember to do it. When the intent is to prevent "oops" mistakes rather than to provide real security, using read-only transactions can be convenient. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] time type strange behaviour

2006-10-14 Thread Michael Fuhr
. What versions of those things are you using? Might the unexpected results be coming from one of those components? If you connect to the database with psql and issue a query from there, what do you get? -- Michael Fuhr ---(end of broadcast)---

Re: [GENERAL] PL/SQL: function call like $1($2)

2006-10-09 Thread Michael Fuhr
nctions or perhaps array_to_string(). stmt := 'SELECT ' || quote_ident(f) || '(' || quote_literal(textin(array_out(p))) || ')'; EXECUTE stmt INTO res; -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] in failed sql transaction

2006-09-24 Thread Michael Fuhr
on so the transaction can continue after an error. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] column names in select don't exists in insert to

2006-09-24 Thread Michael Fuhr
e problem is? If the problem still exists then please post a simple but complete test case, including the exact error message you're getting. -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore

Re: [GENERAL] how much free space in tables and index ?

2006-09-24 Thread Michael Fuhr
On Fri, Sep 22, 2006 at 02:11:40AM -0700, [EMAIL PROTECTED] wrote: > When tuples are deleted, there remains free space in table and index > files. > Is it possible to know for each table and index how much free space it > contains ? For tables see the contrib/pgstattuple module. --

Re: [GENERAL] powerset?

2006-09-24 Thread Michael Fuhr
On Sat, Sep 23, 2006 at 11:47:59PM -0600, Michael Fuhr wrote: > FOR i IN 0 .. (1 << (aupper - alower + 1)) - 1 LOOP To handle empty arrays this should be: FOR i IN 0 .. COALESCE((1 << (aupper - alower + 1)) - 1, 0) LOOP -- Michael Fuhr ---(e

Re: [GENERAL] powerset?

2006-09-23 Thread Michael Fuhr
; id | powerset2 + 1 | {} 1 | {1} 1 | {2} 1 | {1,2} 2 | {} 2 | {10} 2 | {20} 2 | {10,20} 2 | {30} 2 | {10,30} 2 | {20,30} 2 | {10,20,30} (12 rows) Will that work for you? -- Michael Fuhr ---(end of broadcast)---

Re: [GENERAL] column names in select don't exists in insert to

2006-09-20 Thread Michael Fuhr
(field2, field1) values (1, 2); > > It complains that field1 doesn't exists. I can't reproduce this problem; could you post a complete test case? Do you see the problem if you execute the same statements in psql? -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] create table as problem

2006-09-15 Thread Michael Fuhr
. CREATE TABLE iclasses ( classid serial, subject text, year text, groups text, teacher text, set text ); INSERT INTO iclasses (subject, year, groups, teacher, set) SELECT DISTINCT subject, year, groups, teacher, set FROM interimclasses; -- Michael Fuhr

Re: [GENERAL] compressed protocol

2006-09-15 Thread Michael Fuhr
was trying to compress essentially random data (the SSL-encrypted data), and random data doesn't have enough redundancy to compress. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] compressed protocol

2006-09-15 Thread Michael Fuhr
gt; > nTier results shows real compression (faster more than twice). What does a sniffer like tcpdump or wireshark/ethereal show? Let's see how much data is being sent over a compressed vs. uncompressed connection and how long the data transfers are taking. -- Michael Fuhr --

Re: [GENERAL] compressed protocol

2006-09-15 Thread Michael Fuhr
On Fri, Sep 15, 2006 at 09:52:04AM -0600, Michael Fuhr wrote: > On Fri, Sep 15, 2006 at 05:37:50PM +0200, zeljko wrote: > > But, when I try (via tunnel, explained above) > > psql -p 5400 -h localhost mydatabase > > it connects and works fine, but there's no compression

Re: [GENERAL] compressed protocol

2006-09-15 Thread Michael Fuhr
t also be taken into account. Using a sniffer to observe the amount of data transferred would be a more appropriate test. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] compressed protocol

2006-09-15 Thread Michael Fuhr
you run "ssh -v" do you see a line like "Enabling compression at level X"? -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly

Re: [GENERAL] Client Connections

2006-09-14 Thread Michael Fuhr
http://www.postgresql.org/docs/8.1/interactive/sql-createdatabase.html http://www.postgresql.org/docs/8.1/interactive/sql-alterdatabase.html http://www.postgresql.org/docs/8.1/interactive/sql-createrole.html http://www.postgresql.org/docs/8.1/interactive/sql-alterrole.html -- Michae

Re: [GENERAL] Template1 oops

2006-09-13 Thread Michael Fuhr
u're done messing with template1, you could dump it and compare that dump to a dump of a database created from template0. The comparison should show if you missed anything. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] serial, sequence, and COPY FROM

2006-09-12 Thread Michael Fuhr
lash and a period on a line by itself. >> 1|2|DEFAULT >> \. ERROR: invalid input syntax for integer: "DEFAULT" CONTEXT: COPY foo, line 1, column col3: "DEFAULT" -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] serial, sequence, and COPY FROM

2006-09-12 Thread Michael Fuhr
opy of it then you could use a script like this: #!/usr/bin/perl -ln BEGIN {print "copy tablename from stdin delimiter '|';";} print "$_|$."; END {print "\\."} # should also work without this line Run the script and pipe the output into psql: script_name file

Re: [GENERAL] Certificate, login & php question ? krb / sso

2006-09-11 Thread Michael Fuhr
On Mon, Sep 11, 2006 at 10:44:18AM +0200, Jean-Gerard Pailloncy wrote: > Le 11 sept. 06 à 05:57, Michael Fuhr a écrit : > > If such a capability existed then it could arguably be considered > > a flaw in SSL because it would allow a server to impersonate one > > of its clients

Re: [GENERAL] Certificate, login & php question ?

2006-09-10 Thread Michael Fuhr
On Sun, Sep 10, 2006 at 09:39:59PM -0600, Michael Fuhr wrote: > On Mon, Sep 11, 2006 at 02:32:26AM +0200, Jean-Gerard Pailloncy wrote: > > 1) Is it possible to use the SSL authentification done by apache with > > PostgreSQL ? > > I'm not aware of a way for Apache

Re: [GENERAL] Certificate, login & php question ?

2006-09-10 Thread Michael Fuhr
done. I can make SSL connections to PostgreSQL as any user with the same certificate, and I don't see anything in the documentation that allows that to be configured. If I've overlooked something then somebody please point it out. -- Michael Fuhr ---(end of broad

Re: [GENERAL] Two billion records ok?

2006-09-04 Thread Michael Fuhr
> 2 billion :-). If you plan to use integer row IDs then you'll need to use 64-bit bigint/bigserial instead of 32-bit integer/serial. I haven't worked with a database that large; maybe somebody else can give additional advice. -- Michael Fuhr ---

Re: [GENERAL] Array comparison - subset

2006-09-03 Thread Michael Fuhr
On Sun, Sep 03, 2006 at 12:59:08AM -0400, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > test=> SELECT ARRAY[1, 2, 3, 4] @ ARRAY[1, 3]; > > ?column? > > -- > > t > > (1 row) > > > In 8.2 the above example will work i

Re: [GENERAL] Array comparison - subset

2006-09-02 Thread Michael Fuhr
he above example will work in the stock installation for arrays of any type (i.e., with operands of type anyarray). -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Convert time to millisec?

2006-08-28 Thread Michael Fuhr
On Mon, Aug 28, 2006 at 04:18:12PM +0200, Bjørn T Johansen wrote: > On Mon, 28 Aug 2006 07:20:02 -0600 Michael Fuhr <[EMAIL PROTECTED]> wrote: > > select extract(epoch from sum(Til - Fra)) * 1000.0 ... > > Do you know if this is supported on older versions of PostgreSQL

Re: [GENERAL] Convert time to millisec?

2006-08-28 Thread Michael Fuhr
e extract(epoch from ) to get the number of seconds (with fractional part) in an interval, then multiply by 1000 to get milliseconds. Example: select extract(epoch from sum(Til - Fra)) * 1000.0 ... -- Michael Fuhr ---(end of broadcast)--- TIP 5:

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-27 Thread Michael Fuhr
ions written for C to Perl That depends on how many triggers you have, how elaborate they are, and how proficient you are at Perl. I tend to use PL/pgSQL for functions that involve a lot of SQL statements; I use PL/Perl or PL/Ruby for things like text manipulation that those languages are good

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-27 Thread Michael Fuhr
PL/Perl function in one database that needs to connect to a different database? What exactly are you trying to do? -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Can't populate database using Copy

2006-08-26 Thread Michael Fuhr
255 Aug 25 18:15 FinalData.txt Might this be an SELinux problem? -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Inserting Data

2006-08-26 Thread Michael Fuhr
e. That local variable must have a different name to avoid syntax errors that would result from the ambiguity of having a variable and a table column with the same name. -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase yo

Re: [GENERAL] Content of pg_class.relacl

2006-08-26 Thread Michael Fuhr
user=arwdRxt/csi", what does the "/csi" > represent? Is this the owner of the table? The grantor? Is this > discussed anywhere in the PostgreSQL documentation? The GRANT documentation says / -- user who granted this privilege Did you overlook those or

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-26 Thread Michael Fuhr
www.postgresql.org/docs/8.1/interactive/plperl-trusted.html Regarding "use", "require", and "do" see the Perl documentation, in particular the perlfunc and perlmod manual pages. -- Michael Fuhr ---(end of broadcast)---

Re: [GENERAL] Inserting Data

2006-08-25 Thread Michael Fuhr
#x27; > the transaction is rejected. Are you saying that a query like the following might return more than one row? SELECT * FROM library.devices WHERE device_number = 1 AND type_ = 'end'; Or have I misunderstood what you mean by "This doesn't seem to narrow th

Re: [GENERAL] ruby driver postgresql

2006-08-25 Thread Michael Fuhr
0.7.1 doesn't (that "Release version" is over 3.5 years old!). -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Inserting Data

2006-08-25 Thread Michael Fuhr
ut debugging the function is premature: let's see the requirements and then figure out how to implement them. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-24 Thread Michael Fuhr
rl code. See the aforementioned PL/Perl documentation. You could also use PL/Perl just for parsing and use PL/pgSQL for working with the database. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Large database design advice

2006-08-24 Thread Michael Fuhr
get the full 32-bit range (4294967296) by allowing negative numbers and setting the sequence's MINVALUE and RESTART value to -2^31 (-2147483648). > Which should still be enough for "millions of records" Correct. -- Michael Fuhr ---

Re: [GENERAL] Large database design advice

2006-08-24 Thread Michael Fuhr
the lifetime of the table." I think you're confusing the size of the sequence (always 64 bits) with the size of the column (32-bit integer for serial, 64-bit bigint for bigserial) that will hold the sequence's value. -- Michael Fuhr ---(end of broadcast)

Re: [GENERAL] Saving a jpg into Postgresql table

2006-08-24 Thread Michael Fuhr
ates on this issue, check here" The link leads to a closed bug report entitled "Enormous memory increase (and application crash) with large BYTEA parameter." You might wish to read the comments to see if and how the problem has been addressed. -- Michael Fuhr

Re: [GENERAL] Inserting Data

2006-08-24 Thread Michael Fuhr
s Once we have a clear picture of what should happen in response to what actions then it'll be easier to figure out how to make that happen. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Inserting Data

2006-08-23 Thread Michael Fuhr
hen use an IF statement as Tom suggested or use INSERT ... SELECT with a WHERE clause that would restrict the SELECT result to an empty set if the insert shouldn't happen. -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below 8.

Re: [GENERAL] Shared Objects (Dynamic loading)

2006-08-23 Thread Michael Fuhr
PL/Perl? If you're parsing email messages then coding in Perl, Python, Ruby, etc., would probably be easier than C. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] pl/R problem

2006-08-23 Thread Michael Fuhr
On Wed, Aug 23, 2006 at 09:37:17AM -0500, Don Isgitt wrote: > Michael Fuhr wrote: > >Have you checked the permissions on all of the directories in the > >file's path? Have you verified that PostgreSQL is using the same > >$R_HOME? You can check the environment with plr_

Re: [GENERAL] pl/R problem

2006-08-23 Thread Michael Fuhr
> so I don't see that as the problem. Have you checked the permissions on all of the directories in the file's path? Have you verified that PostgreSQL is using the same $R_HOME? You can check the environment with plr_environ(): SELECT * FROM plr_environ() O

Re: [GENERAL] trigger help

2006-08-22 Thread Michael Fuhr
ansaction rolls back then transactions that have already been committed over a dblink connection won't be rolled back. Doing transaction control from outside the functions would probably be better. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Hav

Re: [GENERAL] pl/R problem

2006-08-22 Thread Michael Fuhr
R_HOME/etc//Renviron exist and have permissions such that the PostgreSQL server can read it? The error "cannot find system Renviron" comes from the R function process_system_Renviron() in src/main/Renviron.c in response to process_Renviron() returning 0, which it

Re: [GENERAL] Inserting Data

2006-08-22 Thread Michael Fuhr
nt to the trigger function then you'll see when and how many times it's being called. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Passing arguments to a trigger function

2006-08-22 Thread Michael Fuhr
--- 1 | test on foo | 123 (1 row) INSERT INTO bar (id) VALUES (1); SELECT * FROM bar; id | t | x +-+- 1 | test on bar | 456 (1 row) -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] trigger help

2006-08-22 Thread Michael Fuhr
on. > CREATE OR REPLACE FUNCTION _create_cache(text) > RETURNS text AS This isn't a trigger function. Are you sure "trigger" is the word you meant? -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Inserting Data

2006-08-21 Thread Michael Fuhr
they're being called? Could you post a simple, self-contained example that exhibits both the desired and undesired behavior? That is, all SQL statements that somebody could load into an empty database to create and populate the tables, create the triggers, and perfor

Re: [GENERAL] text formatting in a query, a la sprintf

2006-08-20 Thread Michael Fuhr
On Sun, Aug 20, 2006 at 08:21:18PM -0700, Reece Hart wrote: > On Sat, 2006-08-19 at 16:50 -0600, Michael Fuhr wrote: > > Here's a trivial (and only minimally tested) PL/Ruby function: > > Thanks, Michael. That's a solution I can use. Now I just have to > compile

Re: [GENERAL] text formatting in a query, a la sprintf

2006-08-19 Thread Michael Fuhr
CTION sprintf(format text, args anyarray) RETURNS text AS $$ return format % args $$ LANGUAGE plruby IMMUTABLE STRICT; SELECT sprintf('%s', array['pink', 'elephants']::text[]); sprintf - eleph

Re: [GENERAL] Connection string

2006-08-19 Thread Michael Fuhr
On Sat, Aug 19, 2006 at 03:36:42PM +0200, Michael Meskes wrote: > On Fri, Aug 18, 2006 at 02:54:19PM -0600, Michael Fuhr wrote: > > It works with a double-quoted string but not with a single-quoted > > string as the documentation mentions. > > It's not supposed to work

Re: [GENERAL] Inserting Data

2006-08-18 Thread Michael Fuhr
to do something like the following? INSERT INTO p_id.loops (monitor) SELECT NEW.devices_id FROM library.devices WHERE NEW.device_number = library.devices.device_number AND library.devices.type_ = 'mon'; -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Connection string

2006-08-18 Thread Michael Fuhr
On Fri, Aug 18, 2006 at 06:01:02PM +0200, Michael Meskes wrote: > On Tue, Aug 15, 2006 at 07:31:31PM -0600, Michael Fuhr wrote: > > Will that be a minor fix that can be backpatched or will it be > > invasive enough to be fixed only in HEAD? I'll submit a documentation >

Re: [GENERAL] count and limit

2006-08-17 Thread Michael Fuhr
tuple just as it would for COUNT. I answered a similar question recently: http://archives.postgresql.org/pgsql-novice/2006-07/msg00220.php -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Newbie "Copy From" not working

2006-08-17 Thread Michael Fuhr
file: awk -F'|' '{print NR, NF}' /tmp/sold.pg Suggestion: fix the file so each line has the same number of fields as the table has columns. -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner w

Re: [NOVICE] [GENERAL] DB insert Error

2006-08-17 Thread Michael Fuhr
nd what platforms are the server and client? I don't recall if you've said. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] apostrophes and psql variables

2006-08-17 Thread Michael Fuhr
ue\'' test=> insert into aaa values (:var); INSERT 0 1 test=> select * from aaa; val some value (1 row) -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [NOVICE] [GENERAL] DB insert Error

2006-08-16 Thread Michael Fuhr
mpilers have options to warn about uninitialized variables; I'd recommend using them. If that doesn't help then please post a small (10-20 line), complete program that anybody could compile and run. -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] plpgsql dynamic queries and optional arguments

2006-08-16 Thread Michael Fuhr
the relevant documentation: http://www.postgresql.org/docs/8.1/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN http://www.postgresql.org/docs/8.0/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN -- Michael Fuhr ---(end of broadcast

<    1   2   3   4   5   6   7   8   9   10   >