Re: [GENERAL] Connection string

2006-08-11 Thread Michael Fuhr
On Fri, Aug 11, 2006 at 06:09:16PM +0200, Michael Meskes wrote: > On Fri, Aug 11, 2006 at 07:01:55AM -0600, Michael Fuhr wrote: > > The ECPG "Connecting to the Database Server" documentation does > > have an example for Unix sockets with quotes: > > > >

Re: [GENERAL] Connection string

2006-08-12 Thread Michael Fuhr
or whether he'd commit the necessary changes based on what we've already discussed in this thread. -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail comm

Re: [GENERAL] Connection string

2006-08-13 Thread Michael Fuhr
base dbxyz due to some > authentication problems??? What do the server's logs say? Can you connect to the database from the same machine using psql? If you add the following line to your program before the connect, what output do you get? ECPGdebug(1, stderr); -- Michael Fuhr --

Re: [GENERAL] cannot create table using pl/perl

2006-08-13 Thread Michael Fuhr
On Sat, Aug 12, 2006 at 02:04:42PM -0700, Jim Bryan wrote: > Installed latest postgresql 8 on windows xp, > everything works fine with pl/pgsql; problems creating > a table with perl however: > > CREATE OR REPLACE FUNCTION datetable() RETURNS integer > AS $$ > CREATE TABLE tabletest > ( > da

Re: [GENERAL] Connection string

2006-08-13 Thread Michael Fuhr
t code accordingly. http://www.postgresql.org/docs/8.1/interactive/auth-methods.html -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTEC

Re: [GENERAL] Best approach for a "gap-less" sequence

2006-08-14 Thread Michael Fuhr
tically use indexes for MIN() and MAX() (Tom) In previous releases, the only way to use an index for MIN() or MAX() was to rewrite the query as SELECT col FROM tab ORDER BY col LIMIT 1. Index usage now happens automatically. -- Michael Fuhr ---(end of

Re: [GENERAL] prepared statement already exists

2006-08-14 Thread Michael Fuhr
s different than the SQL command EXECUTE: http://www.postgresql.org/docs/8.1/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN You don't need to use prepared statements in PL/pgSQL functions because the language automatically prepares and caches query plans. Just do the INSERT directly.

Re: [GENERAL] Connection string

2006-08-15 Thread Michael Fuhr
On Sun, Aug 13, 2006 at 10:30:24AM +0200, Michael Meskes wrote: > On Fri, Aug 11, 2006 at 04:40:36PM -0600, Michael Fuhr wrote: > > Will you take care of it or should I submit a patch? I've noticed > > I you have the time to write the patch I woul dappreciate it. I'll

Re: [GENERAL] How to add days to date

2006-08-15 Thread Michael Fuhr
06-09-14 (1 row) or test=> SELECT CAST('2006-08-01' AS date) + 30 + (7 * (3 - 1)); ?column? 2006-09-14 (1 row) -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Connection string

2006-08-15 Thread Michael Fuhr
On Tue, Aug 15, 2006 at 03:56:03PM +0200, Michael Meskes wrote: > On Tue, Aug 15, 2006 at 05:59:23AM -0600, Michael Fuhr wrote: > > I'll submit a patch. However, in the case of string literals not > > working, is that a documentation bug or a code bug? Are they > >

Re: [GENERAL] DB insert Error

2006-08-15 Thread Michael Fuhr
id integer, raw_email char[] ); When you should have done this: CREATE TABLE raw_email ( id integer, raw_email text -- or varchar ); Is my guess correct? -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] DB insert Error

2006-08-15 Thread Michael Fuhr
ple varchar column? Are you handling the contents as array elements (e.g., one element per line) or is the whole considered a single piece of data? -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send a

Re: [GENERAL] how to use variable for select query in pl/pgsql

2006-08-15 Thread Michael Fuhr
EXECUTING-DYN -- 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] DB insert Error

2006-08-15 Thread Michael Fuhr
end a leading '{' and a trailing '}' to ch?? Do you intend to handle the data as an array in SQL? If not then the raw_email column should be declared as varchar or text instead of varchar[]. In that case your C code won't need to change. -- Michael Fuhr --

Re: [GENERAL] Trigger (Calling a Procedure)

2006-08-15 Thread Michael Fuhr
you do need to use C I'd recommend practicing with PL/pgSQL to learn the basics with a simpler language. http://www.postgresql.org/docs/8.1/interactive/plpgsql-trigger.html -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [NOVICE] [GENERAL] DB insert Error

2006-08-15 Thread Michael Fuhr
ction? See the bottom of the following page: http://www.postgresql.org/docs/8.1/interactive/ecpg-commands.html "In the default mode, statements are committed only when EXEC SQL COMMIT is issued." -- Michael Fuhr ---(end of broadcast)--- TIP

Re: [NOVICE] [GENERAL] DB insert Error

2006-08-16 Thread Michael Fuhr
server-side C function that uses ECPG? Is there a reason you're not using SPI? Are you connecting to a different server? Or by "function" do you really mean "program," meaning a separate executable? http://www.postgresql.org/docs/8.1/interactive/spi.html

Re: [NOVICE] [GENERAL] DB insert Error

2006-08-16 Thread Michael Fuhr
ions you're using. I've done a little testing and haven't been able to reproduce your results, so apparently my tests don't match what you're doing. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

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

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] 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-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] 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: [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] 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] 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-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] 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] 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] 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] 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] 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] 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] 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] 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-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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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
#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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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 ? 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] 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] 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] 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] 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] 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] 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
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
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
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] 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] Sequence name with SERIAL type

2003-12-17 Thread Michael Fuhr
ou'd have to hack the source code. See the transformColumnDefinition() and makeObjectName() functions in src/backend/parser/analyze.c. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you che

Re: [GENERAL] md5 function

2003-12-17 Thread Michael Fuhr
satisfies the given argument types > You may need to add explicit typecasts > > where is problem??? Are you sure the server is 7.4? What does SELECT VERSION() show? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)

Re: [GENERAL] md5 function

2003-12-17 Thread Michael Fuhr
ernal Source code | md5_text Description | calculates md5 hash The internal function md5_text() is in src/backend/utils/adt/varlena.c. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] Sorting varchar w/single digits

2004-08-10 Thread Michael Fuhr
f > 1,2,3... > > Is there any way to handle this without having to make a sort order > column? Try something like this: ORDER BY SUBSTRING(unitnum FROM '[0-9]+')::INTEGER, unitnum -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--

Re: [GENERAL] referential integrity preventing simultaneous insert

2004-09-10 Thread Michael Fuhr
an comment on the possibility of a shared FOR PREVENT UPDATE lock. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

[GENERAL] LOG: failed to commit transaction_isolation

2004-09-12 Thread Michael Fuhr
TION LEVEL SERIALIZABLE; -- or READ COMMITTED SELECT VERSION(); ROLLBACK; Why the log message? Is this by design or is it a bug? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, plea

Re: [GENERAL] Problem in converting int to timestamp value - why?

2004-09-19 Thread Michael Fuhr
99 99'), ' MM DD'); to_timestamp 2004-12-17 00:00:00-07 test=> SELECT to_timestamp(to_char(20041217, 'FM 99 99'), ' MM DD'); to_timestamp 2004-12-17 00:00:00-07

Re: [GENERAL] Problem in converting int to timestamp value - why?

2004-09-19 Thread Michael Fuhr
On Sun, Sep 19, 2004 at 12:31:26PM -0400, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > The leading space is confusing to_timestamp(): > > > test=> SELECT to_timestamp(' 2004 12 17', ' MM DD'); > > to_timestamp

[GENERAL] cvs update: waiting for anoncvs's lock

2004-09-24 Thread Michael Fuhr
oncvs's lock in /projects/cvsroot/pgsql-server/config cvs update: [01:47:47] waiting for anoncvs's lock in /projects/cvsroot/pgsql-server/config Is something amiss? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)---

Re: [GENERAL] figuring out if there was a transaction in this connection already

2004-09-25 Thread Michael Fuhr
12 Checking currval() also wouldn't tell you whether any rows in a table had been updated. > Is there a way to trap / ignore this error? Or a way > to check if there was a transaction in this connection > before. Why do you need to know this? What are you tryi

Re: [GENERAL] Modifying users password in pg_shadow from php

2004-09-25 Thread Michael Fuhr
On Sat, Sep 25, 2004 at 05:40:27PM +0200, Egy?d Csaba wrote: > I'm wonder if there is any possibility to modify a users password by > updating the pg_shadow table. Why not use ALTER USER? http://www.postgresql.org/docs/7.4/static/sql-alteruser.html -- Michael Fuhr http://www.fuhr

[GENERAL] CVS broken?

2004-10-11 Thread Michael Fuhr
ng contrib cvs update: cannot open directory /projects/cvsroot/pgsql-server/contrib: No such file or directory cvs update: skipping directory contrib CVS was working earlier Sunday afternoon. Is something broken or being worked on? -- Michael Fuhr http://www.fuhr.

Re: [GENERAL] CVS broken?

2004-10-11 Thread Michael Fuhr
ably should be. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] Reiniciar secuencias

2004-10-11 Thread Michael Fuhr
or ALTER SEQUENCE or setval(). You might wish to subscribe to pgsql-es-ayuda: http://archives.postgresql.org/pgsql-es-ayuda/ -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] Return resultset from a function

2004-10-12 Thread Michael Fuhr
The following General Bits article has examples: http://www.varlena.com/varlena/GeneralBits/26.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] Change primary key in Postgres 7.3?

2004-10-12 Thread Michael Fuhr
n place" in Postgres. Does ALTER TABLE not work? http://www.postgresql.org/docs/7.3/static/sql-altertable.html Whatever you decide to do, hopefully you have a development system on which to test your changes. -- Michael Fuhr http://www.fuhr.org/~mfuhr/

[GENERAL] Proposal: GRANT cascade to implicit sequences

2004-10-12 Thread Michael Fuhr
nable that at least {GRANT | REVOKE} {INSERT | ALL} on a table should cascade to the appropriate permissions on the table's implicit sequences. Comments? Can anybody think of why cascading GRANT and REVOKE to implicit sequences might be A Bad Idea? -- Michael Fuhr http://www.f

Re: [GENERAL] Date format for bulk copy

2004-10-13 Thread Michael Fuhr
whereas PostgreSQL expects octal. If you can't change the dump format, then again, filtering the data through a script might work. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/reading through Usenet,

Re: [GENERAL] Date format for bulk copy

2004-10-13 Thread Michael Fuhr
On Wed, Oct 13, 2004 at 01:32:01PM -0400, David Rysdam wrote: > Michael Fuhr wrote: > >You could filter the data through a script that reformats certain > >fields, then feed the reformatted data to PostgreSQL. This is > >usually a trivial task for Perl, awk, sed, or the like

Re: [GENERAL] solaris and ps

2004-10-14 Thread Michael Fuhr
s, the sum of the lengths of the replacement arguments must be 2 or more greater than the sum of the lengths of the original arguments. I'm guessing that if the postmaster used a longer status message, then /usr/ucb/ps would show it. I'll test that the next time I rebui

Re: [GENERAL] solaris and ps

2004-10-14 Thread Michael Fuhr
On Thu, Oct 14, 2004 at 08:24:19AM -0600, Michael Fuhr wrote: > > As far as I can tell, for /usr/ucb/ps the show the replacement > arguments, the sum of the lengths of the replacement arguments > must be 2 or more greater than the sum of the lengths of the > original arguments. I&

Re: [GENERAL] Date format for bulk copy

2004-10-14 Thread Michael Fuhr
put functions for standard types. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [GENERAL] Date format for bulk copy

2004-10-14 Thread Michael Fuhr
On Wed, Oct 13, 2004 at 03:37:14PM -0400, David Rysdam wrote: > Michael Fuhr wrote: > > > >I'd probably choose to extend PostgreSQL rather than hack what > >already exists, though. > > By "extend PostgreSQL" do you mean create a custom input_function f

Re: [GENERAL] Verifying a user.

2004-10-14 Thread Michael Fuhr
se users who should be using it: REVOKE ALL ON FUNCTION valid_user(TEXT, TEXT) FROM public; GRANT EXECUTE ON FUNCTION valid_user(TEXT, TEXT) TO somebody; -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/reading

Re: [GENERAL] Need some advice on appropriate PL strategy... ["solved/thanks"]

2004-10-14 Thread Michael Fuhr
ort select conn = psycopg.connect('dbname=test') conn.autocommit(1) curs = conn.cursor() curs.execute('LISTEN alert') fd = curs.fileno() while True: select.select([fd], [], [], None) curs.execute('SELECT 1') print curs.notifies() -- Michael Fuhr http://www.fuhr.o

Re: [GENERAL] Is there an opposite to pg_get_userbyid() ?

2004-10-14 Thread Michael Fuhr
logmsg) VALUES ('second message'); SELECT * FROM changelog; logid |logtime| loguser | logmsg ---+---+-+ 1 | 2004-10-14 18:43:20.581907-06 | 100 | first message 2 | 2004-10-14 18:43:35.541114-

Re: [GENERAL] update sequence conversion script

2004-10-15 Thread Michael Fuhr
s; Building such a query would be easy in Perl or Python. The OP said he'd like to see a plpythonu implementation so maybe I'll whip one up if I get time. I'd be inclined to just write an ordinary Python script instead of a stored procedure, however, so it could be used on sy

Re: [GENERAL] plpgsql loop not returning value

2004-10-16 Thread Michael Fuhr
wonder if one of your SUMs is returning NULL, causing your addition to evaluate to NULL. If so, then perhaps you should use COALESCE to turn those NULLs into zeros. If I've misunderstood the problem then please clarify. -- Michael Fuhr http://www.fuhr.org/~mfuhr/

Re: [GENERAL] plpgsql loop not returning value

2004-10-16 Thread Michael Fuhr
On Sat, Oct 16, 2004 at 09:30:32AM -0500, Josh Close wrote: > On Sat, 16 Oct 2004 00:59:34 -0600, Michael Fuhr <[EMAIL PROTECTED]> wrote: > > > > Add some RAISE INFO statements to print variables' values at key > > places. I wonder if one of your SUMs is returning

<    8   9   10   11   12   13   14   >