On Mon, May 12, 2008 at 10:57 AM, Reece Hart <[EMAIL PROTECTED]> wrote:
> On Sun, 2008-05-11 at 06:12 -0700, Postgres User wrote:
> > Has anyone written a function that scripts out all the functions in a
> > database as full SQL statements (Create Function.)
>
> You could pg_dump the schema in
Does postgresql have something similar to the ORDER BY FIELD feature found in
MySQL?
Something like ORDER BY FIELD(ID, 10, 2, 56, 40);
It is listed here: http://dev.mysql.com/doc/refman/5.0/en/sorting-rows.html
I am using the Sphinx Search program, www.sphinxsearch.com, and it r
Hello
2008/5/10 D. Dante Lorenso <[EMAIL PROTECTED]>:
> Instead of doing this:
>
> CREATE OR REPLACE FUNCTION "my_custom_func" (in_value bigint)
> RETURNS SETOF record AS
> $body$
> ...
> $body$
> LANGUAGE 'plpgsql' VOLATILE;
>
> I'd like to be able to do this:
>
> CREATE OR REPLACE FUNCTIO
Kevin Reynolds a écrit :
Does postgresql have something similar to the ORDER BY FIELD feature
found in MySQL?
Something like ORDER BY FIELD(ID, 10, 2, 56, 40);
It is listed here: http://dev.mysql.com/doc/refman/5.0/en/sorting-rows.html
I am using the Sphinx Search program, www.sphinxsearch
Instead of doing this:
CREATE OR REPLACE FUNCTION "my_custom_func" (in_value bigint)
RETURNS SETOF record AS
$body$
...
$body$
LANGUAGE 'plpgsql' VOLATILE;
I'd like to be able to do this:
CREATE OR REPLACE FUNCTION "my_custom_func" (in_value bigint)
RETURNS SETOF (col1name BIGIN
PHP Warning: pg_connect(): Unable to connect to PostgreSQL server:
could not connect to server:
I have setup PHP/Postgres and is running fine upto document root
i.e. /var/www/html, but when i am calling it through a cgi-bin php file
it is giving log error as :
[error] [client 127.0.0.1] PHP Warnin
Hi,
Abdus Samad Ansari wrote:
PHP Warning: pg_connect(): Unable to connect to PostgreSQL server:
could not connect to server:
I have setup PHP/Postgres and is running fine upto document root
i.e. /var/www/html, but when i am calling it through a cgi-bin php file
it is giving log error as :
[err
hello,
most crucial information is missing, like:
- your operating system
- your postgresql version
- on which computer is your database server running
- is your database server running
But most likely your problem is that you did not configure PostgreSQL
to listen to TCP/IP-requests. Which aga
Abdus Samad Ansari <[EMAIL PROTECTED]> writes:
> I have setup PHP/Postgres and is running fine upto document root
> i.e. /var/www/html, but when i am calling it through a cgi-bin php file
> it is giving log error as :
> [error] [client 127.0.0.1] PHP Warning: pg_connect(): Unable to connect
> to P
Abdus Samad Ansari <[EMAIL PROTECTED]> writes:
I have setup PHP/Postgres and is running fine upto document root
i.e. /var/www/html, but when i am calling it through a cgi-bin php
file
it is giving log error as :
[error] [client 127.0.0.1] PHP Warning: pg_connect(): Unable to
connect
to Pos
On Sun, May 11, 2008 at 2:43 PM, Chuck Bai <[EMAIL PROTECTED]> wrote:
> CREATE OR REPLACE FUNCTION test_refcursor(INOUT tcount integer, OUT o_user
> refcursor, OUT o_name refcursor)
> RETURNS record AS
> $BODY$
> BEGIN
>tcount := tcount + 1;
>OPEN o_user FOR SELECT * FROM user_table;
>
Just wanted to see if others would confirm my impressions about running
WAL archiving and pg_standby restore.
Server A (Primary): Runs PG 8.3 with WAL archiving enabled. Each WAL is
copied over the network to Server B. (A previous 'tar backup' of the
database along with the requisite psql co
[EMAIL PROTECTED] (Ivan Sergio Borgonovo) writes:
> On Sat, 10 May 2008 07:35:36 +0200
> "Pavel Stehule" <[EMAIL PROTECTED]> wrote:
>
>> your application different execution paths. Generally I can say, so
>> plpgsql isn't well language for this games, and better is using
>> plperl, plpython or othe
Pavel Stehule wrote:
Hello
2008/5/10 D. Dante Lorenso <[EMAIL PROTECTED]>:
Instead of doing this:
CREATE OR REPLACE FUNCTION "my_custom_func" (in_value bigint)
RETURNS SETOF record AS
$body$
...
$body$
LANGUAGE 'plpgsql' VOLATILE;
I'd like to be able to do this:
CREATE OR REPLACE FUNCT
>> Craig Vosburgh writes:
>> We've dumped the locks and it shows that all locks have been granted so
>> it appears that it is not a lock that is standing in our way. We've
>> also gone in via psql while the update is hung and were able to perform
>> an update on the offending table without issue.
I have very annoying problem that i would like to get a work around in
place so the data entry people stop trying to kill me.
Normally people give quotes out of the price book which was done in
Excel like 15 years ago and just has been updated over the years. the
problem is excel is rounding
"D. Dante Lorenso" <[EMAIL PROTECTED]> writes:
> I'd like to be able to do this:
>
> CREATE OR REPLACE FUNCTION "my_custom_func" (in_value bigint)
> RETURNS SETOF (col1name BIGINT, col2name TEXT, ...) AS
You realize of course that you can do this *today* if you use OUT
parameters?
CREATE OR REPL
At 01:48 AM 5/13/2008, Justin wrote:
I have very annoying problem that i would like to get a work
around in place so the data entry people stop trying to kill me.
Normally people give quotes out of the price book which was done in
Excel like 15 years ago and just has been updated over the
ye
Craig Vosburgh <[EMAIL PROTECTED]> writes:
> Got GDB installed on the errant node and did a back trace call (I'm guessing
> that is what you were looking for when you said stack trace) on the process
> that shows in the process table as executing the hung SQL command.
> The backtrace is:
> (gdb)
Can you be more explicit about the rounding that's wrong in Excel?
Are you talking about the n5 round-up to n+1 that Excel uses
vs. n5 round-to-even n (sometimes called Banker's Rounding)?
-- Andy
On May 12, 2008, at 1:48 PM, Justin wrote:
I have very annoying problem that i would l
2008/5/12 Tom Lane <[EMAIL PROTECTED]>:
> "D. Dante Lorenso" <[EMAIL PROTECTED]> writes:
>> I'd like to be able to do this:
>>
>> CREATE OR REPLACE FUNCTION "my_custom_func" (in_value bigint)
>> RETURNS SETOF (col1name BIGINT, col2name TEXT, ...) AS
>
> You realize of course that you can do this *t
Andy Anderson wrote:
Can you be more explicit about the rounding that's wrong in Excel? Are
you talking about the n5 round-up to n+1 that Excel uses vs.
n5 round-to-even n (sometimes called Banker's Rounding)?
Yes i'm talking about difference between bankers rounding verse Excels
cra
Lincoln Yeoh wrote:
At 01:48 AM 5/13/2008, Justin wrote:
I have very annoying problem that i would like to get a work around
in place so the data entry people stop trying to kill me.
Normally people give quotes out of the price book which was done in
Excel like 15 years ago and just has be
Tom,
Yea, about that lock that I *said* I didn't have... We had been joining
through the pg_class and pg_tables tables to get some additional data and it
turns out the row in the pg_locks that shows as locked doesn't have a
relation so it was filtered out due to the join.
So, now that I have acc
thats how i loaded the price list to start with. The problems with
sales orders are entered and the automatic pricing kicks in ( the
discounts are calculated * the number or pieces ordered) it goes to
down the tubes.
I could just rewrite the pricing stored procedures to call a rounding
procedur
Craig Vosburgh <[EMAIL PROTECTED]> writes:
> Second, any words of wisdom to help run to ground who's keeping me from
> getting the lock on the offending row? The row in the lock table that shows
> granted false does not show as belonging to a database or relation (both
> null) so I can't join thro
Tom Lane wrote:
"D. Dante Lorenso" <[EMAIL PROTECTED]> writes:
I'd like to be able to do this:
CREATE OR REPLACE FUNCTION "my_custom_func" (in_value bigint)
RETURNS SETOF (col1name BIGINT, col2name TEXT, ...) AS
You realize of course that you can do this *today* if you use OUT
parameters?
N
Andy Anderson wrote:
Can you be more explicit about the rounding that's wrong in Excel?
Are you talking about the n5 round-up to n+1 that Excel uses
vs. n5 round-to-even n (sometimes called Banker's Rounding)?
On May 12, 2008, at 2:38 PM, Justin wrote:
Yes i'm taking about difference
Hi,
We'd like to ship PostgreSQL as part of a product that runs on both PPC and
Intel Macs, but the database files are tied to the build settings and
endianness of the computer that the database was initialized on.
Is there any way to cause the server to modify the database files in-place
for end
On Mon, May 12, 2008 at 4:02 PM, Chris Saldanha
<[EMAIL PROTECTED]> wrote:
> We'd like to ship PostgreSQL as part of a product that runs on both PPC and
> Intel Macs, but the database files are tied to the build settings and
> endianness of the computer that the database was initialized on.
>
>
Justin wrote:
No floating point is being used every variable is declared as numeric on
the Postgresql side and in the C++ which is the UI side everything is
double.
`double' in C++ refers to double precision floating point. `double' is
subject to all the usual fun with rational decimals bei
Hello
A disk hosting an instance of 8.2 crashed on me (hardware failure). I
was able to pull most of the data off the drive, but the one database
that I need the most is corrupt. I'm not really sure where to
start... so here are some error messages:
[EMAIL PROTECTED]:/var/log/postgresql$ pg_dum
Merlin Moncure wrote:
Surely it's easier just to have your application dump on schedule and
add some front end GUI import feature to your app? It looks like you
are maybe trying to solve the wrong problem...namely that it is too
difficult for your users to do backup/restore themselves.
Maybe
Craig Ringer wrote:
Justin wrote:
No floating point is being used every variable is declared as numeric
on the Postgresql side and in the C++ which is the UI side
everything is double.
`double' in C++ refers to double precision floating point. `double' is
subject to all the usual fun wit
As i'm playing around with rounding and the numeric field precision ran
into a odd set of results i don't understand
here is the sql i wrote the first four inserts are calculations we run
everyday and they make sense but if division is used the results are
not right or am i missing something
> Maybe it's an opportunity to introduce the users to backups.
Yes, we do backups for the user, but the problem with Apple's migration is
that it happens not on a schedule that meshes with the backup schedule. Our
applications have fairly frequently changing data.
> Honestly, though, PostgreSQL
On Sun, May 11, 2008 at 11:48:29PM -0400, Tom Lane wrote:
> "Scott Marlowe" <[EMAIL PROTECTED]> writes:
> > Is it reasonable behavior to have \timing along toggle and \timing on
> > / \timing off be a forced switch? Just thinking of other scripts
> > where this isn't a problem and having to update
After doing some more reading I've come to the conclusion that I'm in
completely over my head. I got a fresh copy of the corrupt data and
am starting from the very beginning. Here's the error I get on
startup:
[EMAIL PROTECTED]:/usr/lib/postgresql/8.2/bin$ ./postgres -D
/var/lib/postgresql/8.2/
I tried casting them to numeric and it was still wrong
OK i just added decimal point after the 9 and 1 it work at that point.
Thats an odd result i would not have expected it to do that.
This prompts another question how does postgres figure out the data
types passed in an SQL string???
Andy
Justin wrote:
Craig Ringer wrote:
`double' in C++ refers to double precision floating point. `double' is
subject to all the usual fun with rational decimals being irrational
binary floats (and vice versa).
Not according to MS specific if i'm reading it correctly
*Microsoft Specific >*
T
David Fetter wrote:
> On Sun, May 11, 2008 at 11:48:29PM -0400, Tom Lane wrote:
> > "Scott Marlowe" <[EMAIL PROTECTED]> writes:
> > > Is it reasonable behavior to have \timing along toggle and \timing on
> > > / \timing off be a forced switch? Just thinking of other scripts
> > > where this isn't
David Fetter escribió:
> On Sun, May 11, 2008 at 11:48:29PM -0400, Tom Lane wrote:
> > "Scott Marlowe" <[EMAIL PROTECTED]> writes:
> > > Is it reasonable behavior to have \timing along toggle and \timing on
> > > / \timing off be a forced switch? Just thinking of other scripts
> > > where this isn
Justin wrote:
I tried casting them to numeric and it was still wrong
How do the results differ from what you expect? You've posted a bunch of
code, but haven't explained what you think is wrong with the results.
Can you post a couple of SMALL examples and explain how the results are
differe
On Mon, May 12, 2008 at 05:30:48PM -0400, Bruce Momjian wrote:
> David Fetter wrote:
> > On Sun, May 11, 2008 at 11:48:29PM -0400, Tom Lane wrote:
> > > "Scott Marlowe" <[EMAIL PROTECTED]> writes:
> > > > Is it reasonable behavior to have \timing along toggle and \timing on
> > > > / \timing off be
On May 12, 2008, at 4:02 PM, Chris Saldanha wrote:
Hi,
We'd like to ship PostgreSQL as part of a product that runs on both
PPC and
Intel Macs, but the database files are tied to the build settings and
endianness of the computer that the database was initialized on.
Is there any way to caus
>
> What's the locktype?
>
Yep, locktype is transaction.
> If (as I suspect) it's a transaction or
> virtualtransaction lock, then which process holds that lock and what's
> it doing?
As for which process owns that lock, I'm not sure how to find that out
(sorry newbie). I can find the PID th
I guess i have not been very clear.
lets take this
select (9/10), (9/10)::numeric, (9::numeric/10::numeric), (9./10),
(9*.1)
With the given select statement i expected the results all to be same,
especially sense it cast 4 of the 5 to numeric either with explicit cast
or by containing a deci
Yet another option, of course, is to simply not do any calculations
in PostgreSQL, and accept the results from Excel as definitive...
which seems to be what is desired, anyway.
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://w
Craig Vosburgh <[EMAIL PROTECTED]> writes:
> As for which process owns that lock, I'm not sure how to find that out
> (sorry newbie). I can find the PID that is waiting for that lock and I can
> find the table/row that appears to be waiting for the lock to perform the
> action but I can't figure o
If this isn't the right place to post this, please advise.
I've spent a week trying to get PostgreSQL 8.3 to install correctly on
WIN2K. Server will load & I see the server processes loaded but none of
them have any open ports. I keep getting the message the server isn't
listening. Server
On May 12, 2008, at 6:37 PM, Justin wrote:
lets take this
select (9/10), (9/10)::numeric, (9::numeric/10::numeric), (9./10),
(9*.1)
With the given select statement i expected the results all to be
same,
especially sense it cast 4 of the 5 to numeric either with explicit
cast
or by conta
"Vic Simkus" <[EMAIL PROTECTED]> writes:
> [EMAIL PROTECTED]:/var/log/postgresql$ reindexdb EPC
> NOTICE: table "pg_class" was reindexed
> reindexdb: reindexing of database "EPC" failed: ERROR: catalog is
> missing 4 attribute(s) for relid 10762
If you're really lucky, doing the reindex with ign
A.M. wrote:
You know that you don't have to compile postgresql as "Universal",
right? If you have separate PPC and Intel versions (not lipo'd
together), then, presumably, you should be able to figure out which one
needs to run. The PPC postgresql would then run on the Macintel under
Rosetta a
If I'm understanding the errors correctly it seems that the corruption
is in the system catalogs (metadata). The database does not use any
fancy datatypes. Is there any way for me to rebuild the metadata
manually? If I can see the leftover metadata and the data minus the
missing metadata I can prob
"Vic Simkus" <[EMAIL PROTECTED]> writes:
> If I'm understanding the errors correctly it seems that the corruption
> is in the system catalogs (metadata). The database does not use any
> fancy datatypes. Is there any way for me to rebuild the metadata
> manually? If I can see the leftover metadata a
During the initial ill-educated messing around I had set the
zero_damaged_pages to yes, but I'm guessing that the end result is the
same... Ill try it with the fresh copy of [the corrupt] data
What kind of a database can't deal with a bit of random values
injected into its sytem files anyways? :)
On Mon, May 12, 2008 at 06:37:02PM -0400, Justin wrote:
> I guess i have not been very clear.
>
> lets take this
>select (9/10), (9/10)::numeric, (9::numeric/10::numeric), (9./10),
> (9*.1)
>
> With the given select statement i expected the results all to be same,
> especially sense it cast
The following is a function from PosgreSQL documentation to return
multiple cursors from a single function:
CREATE FUNCTION myfunc(refcursor, refcursor) RETURNS SETOF refcursor AS $$
BEGIN
OPEN $1 FOR SELECT * FROM table_1;
RETURN NEXT $1;
OPEN $2 FOR SELECT * FROM table_2;
RETURN NE
thats what i'm trying to get a grasp on, what postgres is doing with
calculation as it truncates or rounds the number when committing the
records to the physical table.
I just start digging into this as we are having problems where some
fields in the database are precision of 2 and other go
Justin wrote:
> WE have several columns in table defined with numeric (20,10) thats is
> just insanity.
Not necessarily. I have a few places where a monetary value is
mulitiplied by a ratio quantity. For some of the historical data
imported from another system the ratio can be irrational or at le
Craig Ringer wrote:
Justin wrote:
WE have several columns in table defined with numeric (20,10) thats is
just insanity.
Not necessarily. I have a few places where a monetary value is
mulitiplied by a ratio quantity. For some of the historical data
imported from another system the ra
On Mon, May 12, 2008 at 4:53 PM, D Galen <[EMAIL PROTECTED]> wrote:
> If this isn't the right place to post this, please advise.
>
> I've spent a week trying to get PostgreSQL 8.3 to install correctly on
> WIN2K. Server will load & I see the server processes loaded but none of
> them have any ope
On May 12, 2008, at 11:58 AM, Abdus Samad Ansari wrote:
PHP Warning: pg_connect(): Unable to connect to PostgreSQL server:
could not connect to server:
I have setup PHP/Postgres and is running fine upto document root
i.e. /var/www/html, but when i am calling it through a cgi-bin php
file
it
Chuck Bai wrote:
> I have the following function:
>
> CREATE OR REPLACE FUNCTION test_refcursor(INOUT tcount integer, OUT
> o_user refcursor, OUT o_name refcursor)
> RETURNS record AS
> $BODY$
> BEGIN
> tcount := tcount + 1;
> OPEN o_user FOR SELECT * FROM user_table;
> OPEN o_name
On 2008-05-12 20:49, Justin wrote:
> We take (List Price * discount Percent) * Number of Pieces = net
> price.
This is wrong. You should do in Excel:
( price * amount ) * discount
As otherwise any small error in representation of price*discount would
be multiplied by usually high amount.
I'd do
Hi,
When I try to grant execution permissions of a function to a role,
PostgreSQL warns that "no privileges were granted"
(backend/catalog/aclchk.c:221).
test_1_5_0_0=> \df+ emove.emove_outgoingmessages_delete_for_commsrv
List of functions
-[ RECORD 1 ]---+
66 matches
Mail list logo