Justin wrote:
Cursor manipulation with select statements
This is something i did in foxpro and wonder if it is at all
possible in pl/pgSQL.
Yes, it is. See
http://www.postgresql.org/docs/current/static/plpgsql-cursors.html
Yours,
Laurenz Albe
--
Sent via pgsql-general mailing list
Ivan Sergio Borgonovo wrote:
I've a lot of code that should call different functions according to
values in tables.
something like:
create table FuncName(Name varchar(10), arg int);
insert into FuncName values('ciro',5);
insert into FuncName values('pino',7);
insert into FuncName
Dann Corbit wrote:
I need a method of extracting information about indexes of any table
from information_schema.
Have you any suggestions?
I am afraid that indexes are not covered by information_schema.
You'd have to dig into pg_catalog.pg_index for this.
Doesn't the
On Fri, 21 Mar 2008 12:15:19 +0100
Albe Laurenz [EMAIL PROTECTED] wrote:
The execution plan of dynamic queries from PL/pgSQL will not be
cached; the query will be prepared at execution time every time you
execute it.
Pardon my ignorance but I really have a very vague idea of what the
planner
On Thu, Mar 20, 2008 at 2:16 PM, Colin Wetherbee [EMAIL PROTECTED] wrote:
John Smith wrote:
guys,
Please don't cross-post, especially since nobody on the PostGIS mailing
list answered your previous question.
On Thu, Mar 20, 2008 at 6:45 PM, Colin Wetherbee [EMAIL PROTECTED] wrote:
Dunno
John Smith wrote:
On Thu, Mar 20, 2008 at 2:16 PM, Colin Wetherbee
[EMAIL PROTECTED] wrote:
Please don't cross-post, especially since nobody on the PostGIS
mailing list answered your previous question.
please don't cross-post my cross-post. if i wanted to post it to the
postgresql list, i
Charles Simard wrote:
snip
|
| postgres error log:
| ERROR: operator does not exist: text = integer
| HINT: No operator matches the given name and argument type(s). You
| might need to add explicit type casts.
| STATEMENT: update T_MON_DEVICE_STATUS set device_ip = $1 :: inet
| ,
On Mar 17, 4:01 pm, wstrzalka [EMAIL PROTECTED] wrote:
Hi
Features like CREATE DATABASE WITH TEMPLATE or CREATE TABLE LIKE
are very usefull but it would be great to have such a feature on the
mid-level too. I mean something CREATE SCHEMA LIKE that would copy all
the template schema
Hi,
I am currently brainstorming ideas for a new RIA that I am planing to
make. In the RIA there would be many different sections which do
different things. Some of these sections would require data from
other sections and some sections can sit on there own. Knowing that
this RIA is meant to
When there's a deadlock detected, the error message recorded in the
log prints out the query being aborted, and the process id of the
other transaction involved in the deadlock. It would be great if more
context was printed for the other query (e.g. the query itself), as
opposed to just
I have two questions.
How can I enter comments into a table? Where the comments are stored?
In psql How can I know the size of a single table?
If know pls replay.
Thanks i advance
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
I'm currently refactoring a database that somebody else designed.
When the database was designed he used character columns with a length
of 1 char to represent some values that really should have been
represented as booleans. He used 'y' for true and 'n' for false.
I want to cast these columns
On Mar 18, 9:18 am, Gordon [EMAIL PROTECTED] wrote:
I'm currently refactoring a database that somebody else designed.
When the database was designed he used character columns with a length
of 1 char to represent some values that really should have been
represented as booleans. He used 'y' for
On Mar 19, 5:52 pm, [EMAIL PROTECTED] wrote:
On Mar 18, 9:18 am, Gordon [EMAIL PROTECTED] wrote:
I'm currently refactoring a database that somebody else designed.
When the database was designed he used character columns with a length
of 1 char to represent some values that really should
Hello List
I have a program that worked fine in 7.4.19. I am in process of upgrading
to 8.3.1 and my program runs for a while and then hangs. I used gdb
to attach to the process and it shows the following backtrace which
shows it
going into the libpq library and getting stuck. Anybody have any
Hi all.
I'd like to get a function to run automatically on the server when a
postgresql client disconnects (either all disconnections, or just
unclean ones). This is to do some cleanup that can't be done with
transactions easily from what I can tell. Is it possible?
To give you an idea of why I
A case statement will work just fine:
select case when sub.col1 = 'y' then true else false end as
col1_boolean, sub.col1 from (select cast('y' as varchar) as col1) sub
Jon
-Original Message-
From: [EMAIL PROTECTED] [mailto:pgsql-general-
[EMAIL PROTECTED] On Behalf Of Gordon
Sent:
On Fri, Mar 21, 2008 at 3:03 PM, lak [EMAIL PROTECTED] wrote:
I have two questions.
How can I enter comments into a table? Where the comments are stored?
What do you mean by comments in a table ?
In psql How can I know the size of a single table?
Select pg_relation_size('mytable');
- Is there a way to turn it back to the old behaviour with a
warning going to the logs?
No.
- Is there a way to get v8.2.x to warn on the dubious casts
so we can tighten the application side while on v8.2?
Seems to me the easiest way would be to try it out on an 8.3
Steve Clark [EMAIL PROTECTED] writes:
I have a program that worked fine in 7.4.19. I am in process of upgrading
to 8.3.1 and my program runs for a while and then hangs. I used gdb
to attach to the process and it shows the following backtrace which
shows it
going into the libpq library and
The table I have in MySQL is similar to below:
0 SET FOREIGN_KEY_CHECKS=0;
1 CREATE TABLE products (
2 product_id integer(11) not null auto_increment,
3 product_name varchar(255) not null,
4 product_descrition varchar(255) not null,
5 class_id integer(11) not null,
6
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Fri, 21 Mar 2008 12:15:05 -0400
Edward Blake [EMAIL PROTECTED] wrote:
When I try and rewrite it as a Postgres statement (below), it fails
at line 9.
0 SET CONSTRAINTS ALL DEFERRED;
1 CREATE TABLE products (
2 product_id serial[11] not
Edward Blake escribió:
The table I have in MySQL is similar to below:
0 SET FOREIGN_KEY_CHECKS=0;
1 CREATE TABLE products (
2 product_id integer(11) not null auto_increment,
3 product_name varchar(255) not null,
4 product_descrition varchar(255) not null,
5 class_id
On Mar 21, 2008, at 4:33 AM, lak wrote:
I have two questions.
How can I enter comments into a table? Where the comments are stored?
Comments are created with the COMMENT sql command and, in pg, are
stored in pg_description.
In psql How can I know the size of a single table?
lak wrote:
I have two questions.
How can I enter comments into a table? Where the comments are stored?
Assuming you want comments on the table schema definitions, use COMMENT ON.
CREATE TABLE sometable (
-- definition
);
COMMENT ON TABLE sometable IS This is a table;
If that's not what
Hello,
On Fri, 21 Mar 2008 12:15:05 -0400 Edward Blake wrote:
9 KEY class_id (class_id),
10 KEY subclass_id (subclass_id),
11 KEY department_id (department_id)
this should create an index, or?
You want to do this later, after table creation.
Kind regards
--
Pavan Deolasee wrote:
On Fri, Mar 21, 2008 at 3:03 PM, lak [EMAIL PROTECTED] wrote:
I have two questions.
How can I enter comments into a table? Where the comments are stored?
What do you mean by comments in a table ?
I think what you are referring to is detailed in
dan chak wrote:
What would be really great would be to know what the other query is,
as opposed to just the pid (not sure from this output if it's 4483 or
29245). Also not sure if this is the right list for this. But
potentially someone on here may have a good tip on debugging deadlocking?
Edward Blake [EMAIL PROTECTED] writes:
When I try and rewrite it as a Postgres statement (below), it fails at line
9.
0 SET CONSTRAINTS ALL DEFERRED;
I don't think that does the same thing as mysql's foreign_key_checks = 0.
2 product_id serial[11] not null,
This is trying to create
Tom Lane wrote:
Steve Clark [EMAIL PROTECTED] writes:
I have a program that worked fine in 7.4.19. I am in process of upgrading
to 8.3.1 and my program runs for a while and then hangs. I used gdb
to attach to the process and it shows the following backtrace which
shows it
going into the
Edward Blake wrote:
The table I have in MySQL is similar to below:
0 SET FOREIGN_KEY_CHECKS=0;
1 CREATE TABLE products (
2 product_id integer(11) not null auto_increment,
3 product_name varchar(255) not null,
4 product_descrition varchar(255) not null,
5 class_id
Pavan Deolasee [EMAIL PROTECTED] schrieb:
On Fri, Mar 21, 2008 at 3:03 PM, lak [EMAIL PROTECTED] wrote:
I have two questions.
How can I enter comments into a table? Where the comments are stored?
What do you mean by comments in a table ?
Comments on a table or a column or on other
Anton Melser [EMAIL PROTECTED] writes:
... But it is COMPLETELY out of the
question to redo the db abstraction layer, and without these implicit
casts that is what will be needed. Is there REALLY no way to reenable
it?
Joshua D. Drake wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Fri, 21 Mar 2008 12:38:49 -0500
Justin [EMAIL PROTECTED] wrote:
Any ideas?
Another way to do auto increment fields is create your own sequences.
I would not suggest that.
Why
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Fri, 21 Mar 2008 12:38:49 -0500
Justin [EMAIL PROTECTED] wrote:
Any ideas?
Another way to do auto increment fields is create your own sequences.
I would not suggest that.
Sincerely,
Joshua D. Drake
- --
The PostgreSQL Company since 1997:
On Fri, Mar 21, 2008 at 10:12 PM, Andreas Kretschmer
[EMAIL PROTECTED] wrote:
Comments on objects can set by:
comment on ... is 'comment';
Oh cool.. I did not such facility exists.
Thanks,
Pavan
--
Pavan Deolasee
EnterpriseDB http://www.enterprisedb.com
--
Sent via pgsql-general
On Fri, Mar 21, 2008 at 10:25 PM, Pavan Deolasee
[EMAIL PROTECTED] wrote:
Oh cool.. I did not such facility exists.
I meant, I did not know such facility exists
Thanks,
Pavan
--
Pavan Deolasee
EnterpriseDB http://www.enterprisedb.com
--
Sent via pgsql-general mailing list
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Fri, 21 Mar 2008 12:47:38 -0500
Justin [EMAIL PROTECTED] wrote:
Why
I am not sure about 8.3 but certainly earlier releases of PostgreSQL
would have specific dependency issues when a sequence was applied to a
a column after the fact,
On 21/03/2008, Tom Lane [EMAIL PROTECTED] wrote:
Anton Melser [EMAIL PROTECTED] writes:
... But it is COMPLETELY out of the
question to redo the db abstraction layer, and without these implicit
casts that is what will be needed. Is there REALLY no way to reenable
it?
Joshua D. Drake wrote:
I am not sure about 8.3 but certainly earlier releases of PostgreSQL
would have specific dependency issues when a sequence was applied to a
a column after the fact, versus using the serial or bigserial
psuedo-types.
Sincerely,
Joshua D. Drake
- --
The PostgreSQL
On Mar 21, 2008, at 5:58 PM, Anton Melser wrote:
Tom the Champion strikes again!
Cheers
Anton
I have the suspicion that his mother is named Lois, his father is
unknown and he has a sensitivity to Kryptonite. But that's just
speculation of course...
Alban Hertroys
--
If you can't see
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Fri, 21 Mar 2008 18:13:27 +0100
Alban Hertroys [EMAIL PROTECTED] wrote:
On Mar 21, 2008, at 5:58 PM, Anton Melser wrote:
Tom the Champion strikes again!
Cheers
Anton
I have the suspicion that his mother is named Lois, his father is
Dan99 wrote:
Hi,
I am currently brainstorming ideas for a new RIA that I am planing to
make. In the RIA there would be many different sections which do
different things. Some of these sections would require data from
other sections and some sections can sit on there own. Knowing that
this
On Fri, Mar 21, 2008 at 10:17 AM, Colin Wetherbee [EMAIL PROTECTED] wrote:
John Smith wrote:
On Thu, Mar 20, 2008 at 2:16 PM, Colin Wetherbee
[EMAIL PROTECTED] wrote:
Please don't cross-post, especially since nobody on the PostGIS
mailing list answered your previous question.
please
Joshua D. Drake [EMAIL PROTECTED] writes:
Why
I am not sure about 8.3 but certainly earlier releases of PostgreSQL
would have specific dependency issues when a sequence was applied to a
a column after the fact, versus using the serial or bigserial
psuedo-types.
As of (I think) 8.2, you
I have the suspicion that his mother is named Lois, his father is
unknown and he has a sensitivity to Kryptonite. But that's just
speculation of course...
Alban Hertroys
Superman married Lois, I hope that isn't his Mom's name.
I got that he was the *son* of Superman... and
I meant, I did not know such facility exists
When you use pgautodoc, it automatically grabs those comments and puts
them in the web page it crreates... more coolness!
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
Roberts, Jon wrote:
A case statement will work just fine:
select case when sub.col1 = 'y' then true else false end as
col1_boolean, sub.col1 from (select cast('y' as varchar) as col1) sub
Be aware of the danger here. What happens if col1 is NULL?
--
Sent via pgsql-general mailing list
I am not sure about 8.3 but certainly earlier releases of PostgreSQL
would have specific dependency issues when a sequence was applied to
a
a column after the fact, versus using the serial or bigserial
psuedo-types.
I'd like to point out that using pg_dump does in fact apply sequences
to
How do you do a simple begin-end statement block inside of a psql
session?
For Example, I want to...
- begin
- declare a variable x to be an integer. Set it = 5
- declare s to be a varchar(8). Set it to foo
- insert into mytable
Pick your OS/Arch from this list, and click to it:
http://yum.pgsqlrpms.org/rpmchart.php
Then click to C at the top, and download the compat package.
Devrim,
I clicked on my OS (RHEL/CentOS 4 - x86) Then on C as you said,
But the RPM list still only contains the compat-postgresql-libs-3-2
Anton Melser [EMAIL PROTECTED] writes:
Anyway, maybe I spoke too soon :-(.
ERROR: operator is not unique: integer || unknown
I did, of course, not follow the instructions and just blinding
applied them all, but from reading them it doesn't look like the issue
here. Does this error mean
Hi,
On Fri, 2008-03-21 at 14:13 -0500, Adam Rich wrote:
I clicked on my OS (RHEL/CentOS 4 - x86) Then on C as you said,
But the RPM list still only contains the compat-postgresql-libs-3-2
package, when I'm looking for compat-postgresql-libs-4-2
No, you need compat-3, not compat-4. For
No, you need compat-3, not compat-4. For example:
[EMAIL PROTECTED] ~]# yum install php-pgsql snip
-- Processing Dependency: libpq.so.3 for package: php-pgsql
I have applications that depend on libpq.so.4
Where do I get that, if not compat-postgresql-libs-4-2 ??
--
Sent via pgsql-general
On 3/21/08, Gauthier, Dave [EMAIL PROTECTED] wrote:
I can do it in a formal declaration of a procedure, and then execute the
procedure. But is there a less formal way?
No. There are no anonymous blocks in PostgreSQL.
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To
Hi,
On Fri, 2008-03-21 at 14:37 -0500, Adam Rich wrote:
I have applications that depend on libpq.so.4
Where do I get that, if not compat-postgresql-libs-4-2 ??
I'll send you instructions for how to build custom compat package.
Regards,
--
Devrim GÜNDÜZ , RHCE
PostgreSQL Replication,
Hello List,
I am running 8.3.1 on FreeBSD 6.2 patch-7.
The ports for Freebsd turn on --enable-thread-safety during configure
of pg.
When running my app after some time I have been getting a core dump -
sig 11.
#0 0x28333b96 in memcpy () from /lib/libc.so.6
(gdb) bt
#0 0x28333b96 in
On 22/03/2008, John Smith [EMAIL PROTECTED] wrote:
please don't cross-post my cross-post. if i wanted to post it to the
postgresql list, i would have ;)
That seems to be quite a silly request, considering you were asking for
assistance on public lists.
no seriously! if i wanted to
On 21 Mar, 17:15, [EMAIL PROTECTED] (Edward Blake) wrote:
When I try and rewrite it as a Postgres statement (below), it fails at line
9.
0 SET CONSTRAINTS ALL DEFERRED;
1 CREATE TABLE products (
2 product_id serial[11] not null,
3 product_name varchar[255] not null,
4
The table I have in MySQL is similar to below:
0 SET FOREIGN_KEY_CHECKS=0;
1 CREATE TABLE products (
2 product_id integer(11) not null auto_increment,
3 product_name varchar(255) not null,
4 product_descrition varchar(255) not null,
5 class_id integer(11) not null,
6
Hi!
Just some more info, hoping that it helps with a diagnosis:
1: datname (typeid = 19, len = 64, typmod = -1, byval = f)
2: age (typeid = 23, len = 4, typmod = -1, byval = t)
3: datfrozenxid(typeid = 28, len = 4, typmod = -1, byval = t)
1:
Hi!
My database cluster has just stopped working. I get the following message:
psql: FATAL: Datenbank nimmt keine Befehle an, um Datenverlust in Datenbank
»postgres« wegen Transaktionsnummernüberlauf zu vermeiden
TIP: Halten Sie den Postmaster an und verwenden Sie ein Standalone-Backend, um
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Fri, 21 Mar 2008 21:50:57 +0100
Markus Wollny [EMAIL PROTECTED] wrote:
That's what I just did, but the problem persists. Whenever I issue a
'vacuum', the number of transactions simply decreases.
This is PostgreSQL 8.2.4 on
On Fri, Mar 21, 2008 at 4:24 PM, Andrej Ricnik-Bay
[EMAIL PROTECTED] wrote:
On 22/03/2008, John Smith [EMAIL PROTECTED] wrote:
please don't cross-post my cross-post. if i wanted to post it to the
postgresql list, i would have ;)
That seems to be quite a silly request, considering
Steve Clark [EMAIL PROTECTED] writes:
The return from malloc should be checked to make sure it succeeds -
right???
Probably, but what do you expect the code to do if it doesn't succeed?
This function seems not to have any defined error-return convention.
regards, tom
Hello,
On Fri, 21 Mar 2008 21:50:57 +0100 Markus Wollny wrote:
My database cluster has just stopped working. I get the following message:
psql: FATAL: Datenbank nimmt keine Befehle an, um Datenverlust in Datenbank
»postgres« wegen Transaktionsnummernüberlauf zu vermeiden
TIP: Halten Sie
Markus Wollny [EMAIL PROTECTED] writes:
Just some more info, hoping that it helps with a diagnosis:
1: datname (typeid = 19, len = 64, typmod = -1, byval = f)
2: age (typeid = 23, len = 4, typmod = -1, byval = t)
3: datfrozenxid(typeid = 28, len = 4, typmod =
Hi!
Sorry for the quick updates to my own messages, but I didn't want to lean back
and wait - so I took to more aggressive measures. All my other databases in
this cluster are fine - and the 'postgres' database doesn't seem to do anything
really useful except being the default database. I
Hi!
Thanks for all the quick replies :)
Tom Lane wrote:
Markus Wollny [EMAIL PROTECTED] writes:
Just some more info, hoping that it helps with a diagnosis:
1: datname (typeid = 19, len = 64, typmod = -1, byval = f)
2: age (typeid = 23, len = 4, typmod = -1, byval = t)
Markus Wollny [EMAIL PROTECTED] writes:
Sorry for the quick updates to my own messages, but I didn't want to
lean back and wait - so I took to more aggressive measures. All my
other databases in this cluster are fine - and the 'postgres' database
doesn't seem to do anything really useful
I use a C function in my database from 2002, all goes well also with
postgresql 8.3 but with 8.3.1 it no longer works, the problem is with
this line:
text *hibrid = (PG_ARGISNULL( 0) ||
VARSIZE(PG_GETARG_TEXT_P( 0))==VARHDRSZ ?NULL:PG_GETARG_TEXT_P(0));
the argument number 0 is an enum
Andreas 'ads' Scherbaum wrote:
Hello,
First of all, it would help you and most of the readers on this list,
if you have the error messages in english. There is a german
mailinglist too, if you want to ask in german.
Sorry, I tried to describe the issue as best as I could and included the
Tom Lane wrote:
Markus Wollny [EMAIL PROTECTED] writes:
I'd still like to find out what exactly happened here so I can
prevent the same from happening again in the future.
Me too. It would seem that something did a vacuum of postgres with a
strange choice of xid cutoff, but I can't think
Hey,
Suppose I have a table with the following fields:
CREATE TABLE distributors (
id DECIMAL(3) PRIMARY KEY,
nameVARCHAR(40),
status INTEGER
);
I would ike to partition this table based on status which can be [0,1,2,3,4].
I was wondering if the records can change their
On Mar 21, 2008, at 7:15 PM, Ram Ravichandran wrote:
Hey,
Suppose I have a table with the following fields:
CREATE TABLE distributors (
id DECIMAL(3) PRIMARY KEY,
nameVARCHAR(40),
status INTEGER
);
I would ike to partition this table based on status which can be
if a function includes this SQL:
Update Table1 Set field_1 = 'ab';
Insert Table2(field_2) VALUES('cd');
and I create an update trigger on Table1:
Create Trigger Table1_Update AFTER Update
On Table1 FOR EACH ROW:
Select * From Table2
will the Select statement in the trigger see
Question answered- needed to move Insert statement before Update in
main function.
On Fri, Mar 21, 2008 at 6:42 PM, Postgres User
[EMAIL PROTECTED] wrote:
if a function includes this SQL:
Update Table1 Set field_1 = 'ab';
Insert Table2(field_2) VALUES('cd');
and I create an update
Thanks for the quick response. And I assume that primary key
uniqueness is not tested across tables. Right?
Thanks,
Ram
On Fri, Mar 21, 2008 at 8:59 PM, Erik Jones [EMAIL PROTECTED] wrote:
On Mar 21, 2008, at 7:15 PM, Ram Ravichandran wrote:
Hey,
Suppose I have a table with the
I would like to install PostgreSQL manually as part of my applications
install using InnoSetup.
Is there anywhere the steps required to do this and if so where would I find
them?
Many thanks
Jeff
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your
79 matches
Mail list logo