It's a classic story. I'm volunteering about one day per month for
this project, learning SQL as I go. Priority was always given to
the
get it working tasks and never the make it safe tasks. I
had/have
grandiose plans to rewrite the whole system properly after I
graduate.
On Wed, Jun 10, 2009 at 12:49 PM, Gus
Gutoskishared.entanglem...@gmail.com wrote:
Of course, the double minus sign comments out the rest of the line and
the statement is left dangling, looking for a terminating semicolon.
SQL statements are not terminated with semi-colons. The semi-colon is
On Wed, Jun 10, 2009 at 12:49 PM, Gus
Gutoskishared.entanglem...@gmail.com wrote:
Hi,
I'm a noob who failed to properly sanitize incoming data from the
front end. As a result, a poor hapless user managed to smuggle in a
malicious UPDATE statement that corrupted every single record in a
Thanks for the replies.
Tom Lane wrote:
This being 8.1, if you haven't turned on autovacuum there is some chance
of that.
Unfortunately, autovacuum was on. I don't recall ever turning it on,
but this database is over two years old; it's possible that I blindly
followed advice from pgAdmin or
It's a classic story. I'm volunteering about one day per month for
this project, learning SQL as I go. Priority was always given to the
get it working tasks and never the make it safe tasks. I had/have
grandiose plans to rewrite the whole system properly after I graduate.
Unfortunately,
On Thu, Jun 11, 2009 at 1:32 PM, Chris Spottsrfu...@gmail.com wrote:
It's a classic story. I'm volunteering about one day per month for
this project, learning SQL as I go. Priority was always given to the
get it working tasks and never the make it safe tasks. I had/have
grandiose plans to
Gus Gutoski shared.entanglem...@gmail.com writes:
Naturally then, *every* record in the database has its foreign_id
field set to 2 and its coin field set to 50. I *really* need to
recover that foreign_id field. (As its name suggests, that field is
a foreign key into a different table.)
On May 20, 2009, at 7:17 PM, James B. Byrne wrote:
Looking at this I have to wonder what will be the effect of having
tens of thousands of rate-pairs on file. Would this query be
improved by first doing a sub-query on base/quote pairs that
returned DISTINCT pairs and then do the IN condition
On Thu, May 21, 2009 06:02, Alban Hertroys wrote:
But as people often say here, premature optimisation is a waste of
time, so don't go that route unless you have a reason to expect
problems in that area.
That was my very thought when I sent that message. On the other
hand, in case I was
James B. Byrne wrote:
On Wed, May 20, 2009 13:07, James B. Byrne wrote:
This seems to be working. I had to take a different approach as I
had misapprehended GROUP BY completely.
SELECT *
FROM currency_exchange_rates AS xchg1
WHERE id
IN (
SELECT id
FROM currency_exchange_rates as
James B. Byrne wrote:
On Tue, May 19, 2009 17:43, Andy Colson wrote:
.
What field is the source? currency_code_quote?
-Andy
Here is the layout of the table:
# Table name: currency_exchange_rates
#
# id :integer not null, primary key
# currency_code_base
This seems to be working. I had to take a different approach as I
had misapprehended GROUP BY completely.
SELECT *
FROM currency_exchange_rates AS xchg1
WHERE id
IN (
SELECT id
FROM currency_exchange_rates as xchg2
WHERE
xchg1.currency_code_base = xchg2.currency_code_base
On Wed, May 20, 2009 13:07, James B. Byrne wrote:
This seems to be working. I had to take a different approach as I
had misapprehended GROUP BY completely.
SELECT *
FROM currency_exchange_rates AS xchg1
WHERE id
IN (
SELECT id
FROM currency_exchange_rates as xchg2
WHERE
On Tue, May 19, 2009 17:43, Andy Colson wrote:
.
What field is the source? currency_code_quote?
-Andy
Here is the layout of the table:
# Table name: currency_exchange_rates
#
# id :integer not null, primary key
# currency_code_base :string(3) not
In article 43639.216.185.71.24.1242834374.squir...@webmail.harte-lyne.ca,
James B. Byrne byrn...@harte-lyne.ca writes:
What I want to be able to do is to return the most recent rate for
all unique rate-pairs, irrespective of type. I also have the
requirement to return the 5 most recent rates
James B. Byrne wrote:
I am perplexed why I cannot select a column from the table without
having to include it in the GROUP BY clause as well.
Any help is welcomed.
Group by is saying I want only one row returned for each distinct value
in this column
so a food table like this:
name |
James B. Byrne wrote:
I have a requirement to select the effective exchange rate for a
number of currencies as of a specific date and time. The rates may
come from several sources for the same currency. For some
currencies the rate may be set infrequently. I have come close to
getting this to
On Tue, May 19, 2009 16:41, Andy Colson wrote:
If your query above is getting you mostly what you want, just use it
as a derived table.
I lack the experience to understand what this means.
If, as you suggest, I use a subquery as the expression to the main
SELECT and for it I use the syntax
On Tue, May 19, 2009 17:02, Andy Colson wrote:
so: select max(name), type from food group by type
works cuz we only get one name (the max name) back for each type.
or: select name, type from food group by type, name
which in our example is kinda pointless, but still, give us the
distinct
James B. Byrne wrote:
On Tue, May 19, 2009 16:41, Andy Colson wrote:
If your query above is getting you mostly what you want, just use it
as a derived table.
I lack the experience to understand what this means.
If, as you suggest, I use a subquery as the expression to the main
SELECT and
James B. Byrne wrote:
On Tue, May 19, 2009 17:02, Andy Colson wrote:
so: select max(name), type from food group by type
works cuz we only get one name (the max name) back for each type.
or: select name, type from food group by type, name
which in our example is kinda pointless, but still,
James B. Byrne wrote:
I have a requirement to select the effective exchange rate for a
number of currencies as of a specific date and time. The rates may
come from several sources for the same currency. For some
currencies the rate may be set infrequently. I have come close to
getting this to
Andy Colson wrote:
James B. Byrne wrote:
I have a requirement to select the effective exchange rate for a
number of currencies as of a specific date and time. The rates may
come from several sources for the same currency. For some
currencies the rate may be set infrequently. I have come
On May 19, 2009, at 11:29 PM, Andy Colson wrote:
I'm not sure what this will do:
HAVING
COUNT(fxr.currency_code_quote) = 1
The only time I have ever used HAVING is like:
select name from something group by name having count(*) 1
to find duplicate name's.
That will leave out all
Hi Filip,
Thanks a lot for your kind help. Selecting only once did the trick. Dropping
to 2 seconds for select instead of 50 IS an improvement indeed :)
Indexes on columns already existed, and just out of curiosity I've tested
char columns instead of varchars, with no significant positive changes.
Hi Scott,
I agree, and I am doing the entity attribute model because I simply have to.
This table is used to persist data that is hold in user defined information
models. Kind of a domain specific language. The users continously create
these hierarchical structures, so neither the amount of them,
W dniu 22 kwietnia 2009 23:47 użytkownik Seref Arikan
serefari...@kurumsalteknoloji.com napisał:
Hi Filip,
First of all: thanks a lot for your kind response. Here is the create
script for my schema:
CREATE TABLE app.archetype_data (
id BIGINT NOT NULL,
context_id VARCHAR(1000),
On Wed, Apr 22, 2009 at 06:21:41PM -0600, Scott Marlowe wrote:
CREATE TABLE app.archetype_data (
id BIGINT NOT NULL,
context_id VARCHAR(1000),
archetype_name VARCHAR(1000),
archetype_path VARCHAR(1000),
name VARCHAR(1000),
value_string VARCHAR(1000),
value_int
On Thu, Apr 23, 2009 at 09:44:53AM +0100, Seref Arikan wrote:
I have worked with very capable DBAs before, and even though it has been
quite some time since I've done real DB work, I would like to invest in
postgresql as much as I can
Seref, if you can muster the man power to build archetypes
On Thu, Apr 23, 2009 at 12:02:13AM +0100, Seref Arikan wrote:
I have a set of dynamically composed objects represented in Java, with
string values for various attributes, which have variable length. In case
you have suggestions for a better type for this case, it would be my
pleasure to hear
2009/4/22 sarikan serefari...@kurumsalteknoloji.com
Dear members of the list,
I have a function which returns a custom type, that has only two fields,
each of them being varchar arrays.
The reason that I have written this function is that I have a table
basically with the following
Hi Filip,
First of all: thanks a lot for your kind response. Here is the create script
for my schema:
CREATE TABLE app.archetype_data (
id BIGINT NOT NULL,
context_id VARCHAR(1000),
archetype_name VARCHAR(1000),
archetype_path VARCHAR(1000),
name VARCHAR(1000),
value_string
you keep everything in varchars, and yet you request improvements in
performance.
you are a funny guy, ...
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Hi there,
I have a set of dynamically composed objects represented in Java, with
string values for various attributes, which have variable length. In case
you have suggestions for a better type for this case, it would be my
pleasure to hear about them.
2009/4/22 Grzegorz Jaśkiewicz
2009/4/22 Seref Arikan serefari...@kurumsalteknoloji.com:
Hi Filip,
First of all: thanks a lot for your kind response. Here is the create script
for my schema:
CREATE TABLE app.archetype_data (
id BIGINT NOT NULL,
context_id VARCHAR(1000),
archetype_name VARCHAR(1000),
Seref Arikan wrote:
I have a set of dynamically composed objects represented in Java, with
string values for various attributes, which have variable length. In
case you have suggestions for a better type for this case, it would be
my pleasure to hear about them.
cut out about 3 layers of
On Thu, Apr 02, 2009 at 12:52:40PM +0200, Angelo Nicolosi wrote:
I wanted to write some C-Function
Where is this code going to live? if it's going to be inside PG as a
function you can call from SQL you want something called SPI:
http://www.postgresql.org/docs/current/static/spi.html
If it's
brent1a$
From: Grzegorz Jaśkiewicz [EMAIL PROTECTED]
To: Brent Austin [EMAIL PROTECTED]
Cc: pgsql-general@postgresql.org
Sent: Tuesday, October 28, 2008 8:23:31 AM
Subject: Re: [GENERAL] [Help] Config Failure on Mac OSX: psqlodbc-08.03.0300
just type
Brent Austin wrote:
Configure still failsI've tried everything I can figure
[...]
configure: error: pg_config not found (set PG_CONFIG environment variable)
It's quite simple:
- Find out where pg_config is.
- If you don't have it, install the appropriate package.
- Make sure it's in
Brent Austin [EMAIL PROTECTED] writes:
Configure still failsI've tried everything I can figure
Last login: Wed Oct 29 02:58:10 on ttys000
client-6X-1XX-17-XX4:~ brent1a$ cd /psqlodbc-08.03.0300
client-6X-1XX-17-XX4:psqlodbc-08.03.0300 brent1a$ sudo ./configure
Password:
checking for
)
From: Albe Laurenz [EMAIL PROTECTED]
To: Brent Austin *EXTERN* [EMAIL PROTECTED]; Grzegorz Jaśkiewicz [EMAIL
PROTECTED]
Cc: pgsql-general@postgresql.org
Sent: Wednesday, October 29, 2008 7:14:37 AM
Subject: Re: [GENERAL] [Help] Config Failure on Mac OSX: psqlodbc-08.03.0300
Brent
Brent Austin [EMAIL PROTECTED] writes:
I could swear that is what I did..or is it not? That is why I sent a
copy/paste of that mess from my terminal:
it showed that I do have PG_CONFIG installed and it showed I did set my path.
That is why I am asking help because configure is saying I
On Tue, Oct 28, 2008 at 12:22 PM, Brent Austin [EMAIL PROTECTED] wrote:
Trying to install psqlodbc-08.03.0300 on Mac gets me this while I
configure:
client-6X-XXX-17-X14:~ brent1a$ cd /psqlodbc-08.03.0300
client-6X-XXX-17-X14:psqlodbc-08.03.0300 brent1a$ sudo ./configure
checking for a
: Tuesday, October 28, 2008 7:50:48 AM
Subject: Re: [GENERAL] [Help] Config Failure on Mac OSX: psqlodbc-08.03.0300
On Tue, Oct 28, 2008 at 12:22 PM, Brent Austin [EMAIL PROTECTED] wrote:
Trying to install psqlodbc-08.03.0300 on Mac gets me this while I configure:
client-6X-XXX-17-X14:~ brent1a$ cd
just type in 'pg_config' ,without quotes in terminal and see if it runs. if
not, you gotta find it. For instance by using:
find /usr -name pg_config
than if it does come up with whereabouts of it - stick it into PG_CONFIG env
variable:
export PG_CONFIG=/path/path/pg_config
and rerun configure in
On Oct 28, 2008, at 8:22 AM, Brent Austin wrote:
configure: error: pg_config not found (set PG_CONFIG environment
variable)
How did you do your PostgreSQL install? In the normal install from
source, pg_config is in the bin folder with the rest of the usual
PostgreSQL executables.
Brent Austin wrote:
Trying to install psqlodbc-08.03.0300 on Mac gets me this
while I configure:
client-6X-XXX-17-X14:~ brent1a$ cd /psqlodbc-08.03.0300
client-6X-XXX-17-X14:psqlodbc-08.03.0300 brent1a$ sudo ./configure
checking for a BSD-compatible install... /usr/bin/install -c
Philip Hallstrom [EMAIL PROTECTED] writes:
I'm trying to add functional index support to Rails' Active Record and
am getting stuck when it comes to a method Rails has to print out the
indexes associated with a given table.
The SQL being run is below:
SELECT distinct i.relname,
On Tue, 16 Sep 2008, Brent Wood wrote:
I need a foreign key (or equivalent) where the referenced table cannot
have a unique constraint.
Well, do you need a full foreign key or just the insert-time check on the
referencing table? Does the referenced table get updates or deletes that
you want to
[EMAIL PROTECTED] wrote:
Hello boys,
I have a problem are not practical for sql.
I helped to find the 'error of this query?
SELECT
fresh.articoli.barcode,
fresh.articoli.descrizione,
fresh.articoli.grammatura,
fresh.articoli.id_marchio,
fresh.articoli.imballo,
2008/7/24 [EMAIL PROTECTED]:
Hello boys,
I have a problem are not practical for sql.
I helped to find the 'error of this query?
SELECT
fresh.articoli.barcode,
fresh.articoli.descrizione,
fresh.articoli.grammatura,
fresh.articoli.id_marchio,
fresh.articoli.imballo,
On Tue, 27 May 2008, J. Manuel Velasco wrote:
Hello,
This is the current query I have:
SELECT dominis.nom, dominis.extensio, dominis.creat, dominis.expira,
titulars.first_name, titulars.last_name, contactes_admin_tec.first_name,
contactes_admin_tec.last_name, dns1.nom, dns2.nom,
On Wed, May 28, 2008 at 10:17 PM, hobbes [EMAIL PROTECTED] wrote:
Hi Guys,
I have been trying to get my local (windows) machine's PgAdmin II to
connect directly to a remote Linux (Debian) Server where Postgresql
8.3 is installed.
Is that a typo? pgAdmin II hasn't been supported in years and
On May 29, 4:45 pm, [EMAIL PROTECTED] (Dave Page) wrote:
On Wed, May 28, 2008 at 10:17 PM, hobbes [EMAIL PROTECTED] wrote:
Hi Guys,
I have been trying to get my local (windows) machine's PgAdmin II to
connect directly to a remote Linux (Debian) Server where Postgresql
8.3 is installed.
hobbes [EMAIL PROTECTED] writes:
I have been trying to get my local (windows) machine's PgAdmin II to
connect directly to a remote Linux (Debian) Server where Postgresql
8.3 is installed.
What exactly happens when you try?
A reasonable guess is that you need to poke a hole in your firewall,
On May 29, 5:17 am, hobbes [EMAIL PROTECTED] wrote:
Hi Guys,
I have been trying to get my local (windows) machine's PgAdmin II to
connect directly to a remote Linux (Debian) Server where Postgresql
8.3 is installed.
I have set in my postgresql.conf (remote):
listen_addresses = '*'
On Tue, May 13, 2008 at 03:30:09PM +0530, Elizabeth George wrote:
SET CLIENT_ENCODING TO 'UNICODE';
copy (select 1 as F1) to E'c:\\test.out' csv QUOTE AS E'\xFE' FORCE
QUOTE F1;
I got error like
ERROR: invalid byte sequence for encoding UTF8: 0xfe
HINT: This error can also happen if
Mircea Moisei wrote:
I get this strange error
Caused by: org.postgresql.util.PSQLException: ERROR: could not open
relation 1663/53544/58374: No such file or directory
How do I recover from it ? Postgresql version 8.2 on windows.
Which update? 8.2.? - newer updates may have fixed the
am Mon, dem 21.04.2008, um 17:46:49 +0200 mailte Pau Marc Munoz Torres
folgendes:
Hi everybody
I trying to upload some plpsql functions to postgresql database using a perl
script and i get the following error
psql:/usr/local/Make2D-DB_II/pgsql/make2db_functions.pgsql:85: ERROR:
Hi everybody
I trying to upload some plpsql functions to postgresql database using a perl
script and i get the following error
psql:/usr/local/Make2D-DB_II
/pgsql/make2db_functions.pgsql:85: ERROR: language plpgsql does not exist
HINT: Use CREATE LANGUAGE to load the language into the
Pau Marc Munoz Torres wrote:
ERROR: language plpgsql already exists
anybody knows what's wrong?
Is there any chance you might be connecting to a different database with
the perl script and with psql? Procedural languages must be installed
into a particular database.
--
Craig Ringer
--
On Apr 21, 2008, at 8:51 AM, Pau Marc Munoz Torres wrote:
psql:/usr/local/Make2D-DB_II
/pgsql/make2db_functions.pgsql:85: ERROR: language plpgsql does
not exist
HINT: Use CREATE LANGUAGE to load the language into the database.
and then when I try to create the language, i get
geldb=#
Pau Marc Munoz Torres wrote:
Hi everybody
I trying to upload some plpsql functions to postgresql database using a perl
script and i get the following error
psql:/usr/local/Make2D-DB_II
/pgsql/make2db_functions.pgsql:85: ERROR: language plpgsql does not exist
HINT: Use CREATE LANGUAGE to
akshay bhat wrote:
hello i am new to psql or any database stuff.
i have downloaded an .psql file from internet and wish to open it and see
the data inside.
i am working on windows xp and have installed the software successfully.
please help i am my wits end.
So what have you tried so far?
What
akshay bhat wrote:
hello i am new to psql or any database stuff.
i have downloaded an .psql file from internet and wish to open it and
see the data inside.
i am working on windows xp and have installed the software successfully.
please help i am my wits end.
it is huge file 800mb
and is
akshay bhat wrote:
hello i am new to psql or any database stuff.
i have downloaded an .psql file from internet and wish to open it and
see the data inside.
Drag it into your text editor.
--
Postgresql php tutorials
http://www.designmagick.com/
---(end of
On the postgres command prompt you can use /i filename ... try if it
works
Cheers
On Thu, Feb 28, 2008 at 9:07 AM, akshay bhat [EMAIL PROTECTED] wrote:
hello i am new to psql or any database stuff.
i have downloaded an .psql file from internet and wish to open it and see
the data
It seems to do the job, but how good is it in the long run? Any way I
could tweak it?
I think this form will work the best:
SELECT u.login, MAX(s.stop_time) AS last_use_time
FROM users u, stats s
WHERE u.id=s.user_id
AND u.status='3' AND u.next_plan_id IS NULL
GROUP BY u.login
HAVING
On Feb 9, 2008 8:04 PM, Adam Rich [EMAIL PROTECTED] wrote:
It seems to do the job, but how good is it in the long run? Any way I
could tweak it?
I think this form will work the best:
SELECT u.login, MAX(s.stop_time) AS last_use_time
FROM users u, stats s
WHERE u.id=s.user_id
AND
On Thu, January 17, 2008 10:15, Scott Marlowe wrote:
If race conditions are a possible issue, you use a sequence and
increment that until you get a number that isn't used. That way two
clients connecting at the same time can get different, available
numbers.
That is close to the idea that
On Jan 17, 2008 9:05 AM, James B. Byrne [EMAIL PROTECTED] wrote:
If the entries involved numbered in the millions then Scott's approach has
considerable merit. In my case, as the rate of additions is very low and
the size of the existing blocks is in the hundreds rather than hundreds of
On Wed, January 16, 2008 18:40, Scott Marlowe wrote:
You're essentially wanting to fill in the blanks here. If you need
good performance, then what you'll need to do is to preallocate all
the numbers that haven't been assigned somewhere. So, we make a table
something like:
create table
On Jan 17, 2008 9:19 AM, James B. Byrne [EMAIL PROTECTED] wrote:
On Thu, January 17, 2008 10:15, Scott Marlowe wrote:
If race conditions are a possible issue, you use a sequence and
increment that until you get a number that isn't used. That way two
clients connecting at the same time
On Jan 17, 2008 9:19 AM, James B. Byrne [EMAIL PROTECTED] wrote:
On Thu, January 17, 2008 10:15, Scott Marlowe wrote:
If race conditions are a possible issue, you use a sequence and
increment that until you get a number that isn't used. That way two
clients connecting at the same time
On Thu, January 17, 2008 11:48, Scott Marlowe wrote:
Got bored, hacked this aggregious pl/pgsql routine up. It looks
horrible, but I wanted it to be able to use indexes. Seems to work.
Test has ~750k rows and returns in it and returns a new id in 1ms
on my little server.
File attached.
On Fri, Jan 11, 2008 at 11:43:54AM -0500, James B. Byrne wrote:
My question is this: Can one assign an id number to a sequenced key column
on create and override the sequencer? If one does this then can and, if
so, how does the sequencer in Postgresql handle the eventuality of running
into a
On Jan 11, 2008 10:43 AM, James B. Byrne [EMAIL PROTECTED] wrote:
I am prototyping a system migration that is to employ Ruby, Rails and
PostgreSQL. Rails has the convention that the primary key of a row is an
arbitrary integer value assigned by the database manager through a
sequence. As it
On Thu, Nov 29, 2007 at 01:26:00PM +, Pedro Doria Meunier wrote:
Hi People.
I need some help optimizing this query:
snip
I still get Seq Scans although all used fields are indexed, hence the
time used... :-(
A seq scan on a table with 10 rows is *good*. An index would take
longer. What
In response to James Williams [EMAIL PROTECTED]:
I'm stuck trying to tune a big-ish postgres db and wondering if anyone
has any pointers.
I cannot get Postgres to make good use of plenty of available RAM and
stop thrashing the disks.
One main table. ~30 million rows, 20 columns all
James Williams wrote:
The box has 4 x Opterons, 4Gb RAM five 15k rpm disks, RAID 5. We
wanted fast query/lookup. We know we can get fast disk IO.
RAID 5 is usually adviced against here. It's not particularly fast or
safe, IIRC. Try searching the ML archives for RAID 5 ;)
--
Alban Hertroys
:24 AM
To: James Williams
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Help tuning a large table off disk and into RAM
In response to James Williams [EMAIL PROTECTED]:
I'm stuck trying to tune a big-ish postgres db and wondering if anyone
has any pointers.
I cannot get Postgres
Bill Moran [EMAIL PROTECTED] writes:
Give it enough shared_buffers and it will do that. You're estimating
the size of your table @ 3G (try a pg_relation_size() on it to get an
actual size) If you really want to get _all_ of it in all the time,
you're probably going to need to add RAM to the
On 9/26/07, James Williams [EMAIL PROTECTED] wrote:
The last is based mostly on the observation that another tiddly
unrelated mysql db which normally runs fast, grinds to a halt when
we're querying the postgres db (and cpu, memory appear to have spare
capacity).
Just a quick observation
On Tue, 2007-09-18 at 02:24 -0700, Trevor Talbot wrote:
On 9/17/07, Ow Mun Heng [EMAIL PROTECTED] wrote:
CREATE OR REPLACE FUNCTION foo_func(fromdate timestamp, todate
timestamp, code text)
LANGUAGE 'sql' IMMUTABLE STRICT;
But If I were to use ALIASINg, I get an error
am Mon, dem 17.09.2007, um 9:21:22 +0800 mailte Ow Mun Heng folgendes:
CREATE OR REPLACE FUNCTION foo_func(fromdate timestamp, todate
timestamp, code text)
RETURNS SETOF foo AS
$BODY$
SELECT
TRH.ID,
TRH.data1,
TRH.data2,
FROM D
INNER JOIN TS
On Wed, 2007-09-19 at 07:57 +0200, A. Kretschmer wrote:
am Mon, dem 17.09.2007, um 9:21:22 +0800 mailte Ow Mun Heng folgendes:
CREATE OR REPLACE FUNCTION foo_func(fromdate timestamp, todate
timestamp, code text)
RETURNS SETOF foo AS
$BODY$
SELECT
TRH.ID,
TRH.data1,
On Mon, 2007-09-17 at 09:42 +0800, Ow Mun Heng wrote:
On Mon, 2007-09-17 at 09:21 +0800, Ow Mun Heng wrote:
Hi,
I want to use a SRF to return multi rows.
current SRF is pretty static.
create type foo_type as (
id smallint
data1 int
data2 int
)
CREATE OR REPLACE
On 9/17/07, Ow Mun Heng [EMAIL PROTECTED] wrote:
CREATE OR REPLACE FUNCTION foo_func(fromdate timestamp, todate
timestamp, code text)
LANGUAGE 'sql' IMMUTABLE STRICT;
But If I were to use ALIASINg, I get an error
eg: DECLARE
DECLARE
fromdate ALIAS for $1;
todate
On Mon, 2007-09-17 at 09:21 +0800, Ow Mun Heng wrote:
Hi,
I want to use a SRF to return multi rows.
current SRF is pretty static.
create type foo_type as (
id smallint
data1 int
data2 int
)
CREATE OR REPLACE FUNCTION foo_func()
RETURNS SETOF foo AS
$BODY$
SELECT
Pat Maddox wrote:
I've got a bunch of companies that are associated with several videos.
The videos have different statuses. I want to select all the
companies in the database, and order them by videos that have a
complete status.
Here's what I have so far
SELECT
companies.id,
am Wed, dem 15.08.2007, um 17:29:17 -0400 mailte Madison Kelly folgendes:
What I would like to do is create a function that would do the same
thing so I could read out the IP addresses as standard dotted-decimal
format. Could anyone help me with this? I am quite the n00b when it
comes to
?
Try some thing like ths:
SELECT
companies.id,
companies.name,
companies.nickname,
(Select count(*) from videos where companies.id=videos.company_id and
videos.status= 'complete') num_videos
FROM companies
ORDER BY num_videos DESC
Hope this help
Carlos E. Ortiz
On Aug 16, 2007, at 9:35 AM, Madison Kelly wrote:
Note: This is being sent again (in case it shows up later). It
never seemed to have made it to the list.
Hi all,
I'm using ulogd with PostgreSQL which stores IP addresses as 32bit
unsigned integers. So when I select some data I get
Rajaram J [EMAIL PROTECTED] writes:
I have a HP-UX server and have downloaded the code for postgresql to
compile and use the libraries.
Do you have the real C compiler, or the toy one that HP gives people
who don't fork over extra money for the real one? Testing with the
bundled compiler here,
Chris Hoover wrote:
I need some help. I am trying to replicate a function from Sybase
ASA, and am having difficulty.
I need to be able to subtract 2 date (or timestamps) and return the
results expressed in days, weeks, month, quarters, or years. How do I
do this?
I believe Postgres is
Chris Hoover wrote:
I need some help. I am trying to replicate a function from Sybase
ASA, and am having difficulty.
I need to be able to subtract 2 date (or timestamps) and return the
results expressed in days, weeks, month, quarters, or years. How do I
do this?
I believe Postgres is
try patch from http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/
which updates snowball api
Oleg
On Tue, 17 Jul 2007, marcelo Cortez wrote:
hi all
i'm using postgresql 8.2.4 and install tsearch2 , but
i need spanish idiom.
following
On fös, 2007-07-20 at 11:08 -0400, Chris Hoover wrote:
I need some help. I am trying to replicate a function from Sybase
ASA, and am having difficulty.
I need to be able to subtract 2 date (or timestamps) and return the
results expressed in days, weeks, month, quarters, or years. How do I
Where is your actual copy statement?
What is your field delimiter?
Why not post the actual C code for your program, if it is not too long?
I guess from what you have posted that the delimiter you supplied does not
match the delimiter from your copy statement.
-Original Message-
From:
DAnn
My c code is one layer for wrap libpq.dll functions
i'm using function like
start with
PGresult *PQexec(PGconn *conn, const char *command);
command like 'copy foo from stdin ';
int PQputCopyData(PGconn *conn,
const char *buffer,
int nbytes);
401 - 500 of 807 matches
Mail list logo