On Thu, Jun 2, 2016 at 5:44 PM, Kevin Grittner wrote:
> On Thu, Jun 2, 2016 at 3:23 PM, David G. Johnston
> wrote:
> > On Thu, Jun 2, 2016 at 4:11 PM, John R Pierce
> wrote:
> >> Thanks all the below seem to do the trick.
>
> I doubt it -- using NOT IN requires (per the SQL specification)
> han
On Thu, Jun 2, 2016 at 3:23 PM, David G. Johnston
wrote:
> On Thu, Jun 2, 2016 at 4:11 PM, John R Pierce wrote:
>> Thanks all the below seem to do the trick.
I doubt it -- using NOT IN requires (per the SQL specification)
handling NULLs in a way that probably does not give you the answer
you wan
On Thu, Jun 2, 2016 at 4:11 PM, John R Pierce wrote:
> On 6/2/2016 11:10 AM, Steve Clark wrote:
>
> Thanks all the below seem to do the trick.
>
> On 06/02/2016 01:58 PM, David G. Johnston wrote:
>
> select max(id) from yourtable where sts=0 and id not in (select ref_id
> from yourtable);
>
>
> s
> -Original Message-
> From: pgsql-general-ow...@postgresql.org [mailto:
> pgsql-general-ow...@postgresql.org] On Behalf Of Steve Clark
> Sent: Thursday, June 2, 2016 9:56 AM
> To: pgsql
> Subject: [GENERAL] dumb question
>
> Hi List,
>
> I am a noob try
) from sometable where sts=0
-Original Message-
From: pgsql-general-ow...@postgresql.org
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Steve Clark
Sent: Thursday, June 2, 2016 9:56 AM
To: pgsql
Subject: [GENERAL] dumb question
Hi List,
I am a noob trying to do something that
7; ; pgsql
Subject: Re: [GENERAL] dumb question
This is your request, translated directly into SQL
select max(id) from sometable where sts=0 and ref_id IS NULL
Looking at your sample, it seems that sts is always 1 when ref_id exists, so it
may possibly simplify to:
select ma
On 6/2/2016 11:10 AM, Steve Clark wrote:
Thanks all the below seem to do the trick.
On 06/02/2016 01:58 PM, David G. Johnston wrote:
select max(id) from yourtable where sts=0 and id not in (select
ref_id from yourtable);
select max(id) from yourtable where sts=0 and id not in (select ref_id
Message-
From: pgsql-general-ow...@postgresql.org
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Steve Clark
Sent: Thursday, June 2, 2016 9:56 AM
To: pgsql
Subject: [GENERAL] dumb question
Hi List,
I am a noob trying to do something that seems like it should be easy but I
can
Hi List,
I am a noob trying to do something that seems like it should be easy but I
can't figure it out.
I have a table like so:
id | ref_id | sts
--
1 || 0
2 | 1 | 1
3 || 0
4 || 0
5 | 4 | 1
6 || 0
7 | 6 | 1
I want t
Thanks all the below seem to do the trick.
On 06/02/2016 01:58 PM, David G. Johnston wrote:
select max(id) from yourtable where sts=0 and id not in (select ref_id from
yourtable);
select max(id) from yourtable where sts=0 and id not in (select ref_id from
yourtable);
--
Stephen Clark
On Thu, Jun 2, 2016 at 10:40 AM, Felipe Santos wrote:
>
>
> 2016-06-02 14:23 GMT-03:00 Steve Crawford
> :
>
>> Something like:
>>
>> select max(id) from yourtable where sts=0 and ref_id is null;
>>
>> That assumes that ref_id is null. It would help to see your table
>> structure and the query yo
On Thu, Jun 2, 2016 at 1:48 PM, Steve Crawford <
scrawf...@pinpointresearch.com> wrote:
> On Thu, Jun 2, 2016 at 10:40 AM, Felipe Santos
> wrote:
>
>> I think sts=0 means ref_id is null
>>
>> So, what I think he wants to achieve is:
>>
>> select max(id) from yourtable where sts=0 and id not in (s
2016-06-02 14:23 GMT-03:00 Steve Crawford :
> Something like:
>
> select max(id) from yourtable where sts=0 and ref_id is null;
>
> That assumes that ref_id is null. It would help to see your table
> structure and the query you tried that doesn't work. If ref_id is actually
> a character string th
Something like:
select max(id) from yourtable where sts=0 and ref_id is null;
That assumes that ref_id is null. It would help to see your table structure
and the query you tried that doesn't work. If ref_id is actually a
character string then you might need ref_id='' or coalesce(ref_id,'')='' if
On Thursday, June 2, 2016, Steve Clark wrote:
> Hi List,
>
> I am a noob trying to do something that seems like it should be easy but I
> can't figure it out.
>
> I have a table like so:
>
> id | ref_id | sts
> --
> 1 || 0
> 2 | 1 | 1
> 3 || 0
> 4 |
Hi List,
I am a noob trying to do something that seems like it should be easy but I
can't figure it out.
I have a table like so:
id | ref_id | sts
--
1 || 0
2 | 1 | 1
3 || 0
4 || 0
5 | 4 | 1
6 || 0
7 | 6 | 1
I want t
Jasen Betts wrote:
>On 2013-02-23, Raymond C. Rodgers wrote:
>> On 02/23/2013 05:26 AM, Tom Lane wrote:
>>> A "virtual" tsvector like that is probably going to be useless for
>>> searching as soon as you get a meaningful amount of data, because the
>>> only way the DB can implement a search is t
On 2013-02-23, Raymond C. Rodgers wrote:
> On 02/23/2013 05:26 AM, Tom Lane wrote:
>> A "virtual" tsvector like that is probably going to be useless for
>> searching as soon as you get a meaningful amount of data, because the
>> only way the DB can implement a search is to compute the tsvector
On 02/23/2013 05:26 AM, Tom Lane wrote:
A "virtual" tsvector like that is probably going to be useless for
searching as soon as you get a meaningful amount of data, because the
only way the DB can implement a search is to compute the tsvector
value for each table row and then examine it for the
Kevin Grittner writes:
> Raymond C. Rodgers wrote:
>> As I went to add a tsvector column, it occurred to me that it
>> might be possible to add a dynamic tsvector column through the
>> use of a view, so I created a temporary view with a command along
>> the lines of:
>>
>> CREATE TEMPORARY
Raymond C. Rodgers wrote:
> As I went to add a tsvector column, it occurred to me that it
> might be possible to add a dynamic tsvector column through the
> use of a view, so I created a temporary view with a command along
> the lines of:
>
> CREATE TEMPORARY VIEW ftstest AS SELECT id, field1
Hi folks,
I'm building a PHP script for a web site I'm developing. At the
moment, there is absolutely no real data in the database, so obviously
performance is pretty good right now. I'm in the midst of developing an
administration page for the site, which will do a full text search on
sev
> -Original Message-
> From: Alvaro Herrera [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 11, 2007 1:11 PM
> To: Dann Corbit
> Cc: [EMAIL PROTECTED]; pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Dumb question about binary cursors and
> #ifdefHAVE_INT6
> -Original Message-
> From: Alvaro Herrera [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 11, 2007 1:11 PM
> To: Dann Corbit
> Cc: [EMAIL PROTECTED]; pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Dumb question about binary cursors and
> #ifdefHAVE_INT6
Dann Corbit wrote:
> If I create a binary cursor on a recent version of PostgreSQL, how can I
> tell if the timestamp data internally is an 8 byte double or an 8 byte
> integer?
>
> I see an #ifdef that changes the code path to compute timestamps as one
> type or the other, but I do not know how t
"Dann Corbit" <[EMAIL PROTECTED]> writes:
> If I create a binary cursor on a recent version of PostgreSQL, how can I
> tell if the timestamp data internally is an 8 byte double or an 8 byte
> integer?
PQparameterStatus(conn, "integer_datetimes")
regards, tom lane
If I create a binary cursor on a recent version of PostgreSQL, how can I
tell if the timestamp data internally is an 8 byte double or an 8 byte
integer?
I see an #ifdef that changes the code path to compute timestamps as one
type or the other, but I do not know how to recognize the internal
format
Make sure you have stats collector enabled, if auto vacuum is doing the
analyze and vacuum it should be recording that info in this view. For
details on this you can have a look at -->
http://www.postgresql.org/docs/8.2/interactive/monitoring-stats.html
Just for a test try doing a VACUUM or ANALY
On 2/13/07, Walter Vaughan <[EMAIL PROTECTED]> wrote:
select last_autovacuum, last_autoanalyze from pg_stat_all_tables;
last_autovacuum | last_autoanalyze
-+--
|
...snip lots of identically blank lines...
|
Shoaib Mir wrote:
pg_stat_all_table view should help you:
select last_autovacuum, last_autoanalyze from pg_stat_all_tables;
select last_autovacuum, last_autoanalyze from pg_stat_all_tables;
last_autovacuum | last_autoanalyze
-+--
|
...snip lot
pg_stat_all_table view should help you:
select last_autovacuum, last_autoanalyze from pg_stat_all_tables;
--
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)
On 2/9/07, Sic Transit Gloria Mundi <[EMAIL PROTECTED]> wrote:
Hi,
I couldnt find this on google, the archives, or the manual. But wit
Sic Transit Gloria Mundi <[EMAIL PROTECTED]> writes:
> I couldnt find this on google, the archives, or the manual. But with the
> changes to what the autovacuum daemon logs, how can we verify it's doing its
> thing? Is there a way to query the last time a table was vacuumed? But I
> don't see
Hi,
I couldnt find this on google, the archives, or the manual. But with the
changes to what the autovacuum daemon logs, how can we verify it's doing its
thing? Is there a way to query the last time a table was vacuumed? But I
don't see that in the system catalog.
Thanks!
-
On Feb 13, 2006, at 11:47 , Craig White wrote:
seems to be a lot of work just for this...the problem is trying to use
rubyonrails and their 'migrations' which cause this...
psql:db/development_structure.sql:211: ERROR: must be owner of schema
public
So how can I just 'munge' the system t
On Mon, 2006-02-13 at 11:39 +0900, Michael Glaesemann wrote:
> On Feb 13, 2006, at 11:27 , Craig White wrote:
>
> > th-db_test=> ALTER SCHEMA public OWNER TO tobyhouse;
> > ERROR: syntax error at or near "OWNER" at character 21
> >
> > # rpm -q postgresql-server
> > postgresql-server-7.4.8-1.RHEL
On Feb 13, 2006, at 11:27 , Craig White wrote:
th-db_test=> ALTER SCHEMA public OWNER TO tobyhouse;
ERROR: syntax error at or near "OWNER" at character 21
# rpm -q postgresql-server
postgresql-server-7.4.8-1.RHEL4.1
The docs I referred you to are for the current release. For earlier
relea
On Mon, 2006-02-13 at 11:07 +0900, Michael Glaesemann wrote:
> On Feb 13, 2006, at 10:29 , Craig White wrote:
>
> > How do I change the owner of a schema?
> >
> > ALTER SCHEMA "public" OWNER to "some_user"; #?
>
> http://www.postgresql.org/docs/current/interactive/sql-alterschema.html
>
> The
On Feb 13, 2006, at 10:29 , Craig White wrote:
How do I change the owner of a schema?
ALTER SCHEMA "public" OWNER to "some_user"; #?
http://www.postgresql.org/docs/current/interactive/sql-alterschema.html
The docs explain this very situation. HTML documentation ships with
the PostgreSQL
How do I change the owner of a schema?
ALTER SCHEMA "public" OWNER to "some_user"; #?
Craig
---(end of broadcast)---
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
On Tue, Oct 11, 2005 at 02:22:23AM -0400, Tom Lane wrote:
> "Jim C. Nasby" <[EMAIL PROTECTED]> writes:
> > Out of curiosity... why don't we have unsigned ints?
>
> Quick, is 42 an int or an unsigned int?
>
> I think it'd create a slew of new ambiguous cases in the
> numeric-datatype hierarchy, fo
On Mon, Oct 10, 2005 at 11:52:40PM -0700, Dann Corbit wrote:
> How about something like:
>
> CREATE DOMAIN unsigned_small AS smallint check (VALUE >= 0)
>
> CREATE DOMAIN unsigned_int AS integer check (VALUE >= 0)
>
> CREATE DOMAIN unsigned_big AS bigint check (VALUE >= 0)
>
> The objection mig
ostgresql.org
> Subject: Re: [GENERAL] Dumb question about serial's upper limit
>
> On Mon, Oct 10, 2005 at 10:59:03PM -0400, Tom Lane wrote:
> > CSN <[EMAIL PROTECTED]> writes:
> > > If integer's range is -2147483648 to +2147483647, why
> > > i
On Oct 11, 2005, at 15:12 , Jim C. Nasby wrote:
Out of curiosity... why don't we have unsigned ints? I for one would
certainly use them for id fields, as well as some other places where I
knew negative numbers weren't valid.
Check the archives. I know this has come up a number of times in the
"Jim C. Nasby" <[EMAIL PROTECTED]> writes:
> Out of curiosity... why don't we have unsigned ints?
Quick, is 42 an int or an unsigned int?
I think it'd create a slew of new ambiguous cases in the
numeric-datatype hierarchy, for what is really pretty darn small gain.
We're already just barely getti
On Mon, Oct 10, 2005 at 10:59:03PM -0400, Tom Lane wrote:
> CSN <[EMAIL PROTECTED]> writes:
> > If integer's range is -2147483648 to +2147483647, why
> > is serial's range only 1 to 2147483647 instead of 1 to
> > about 4294967294?
>
> How are you going to stuff 4294967294 into an integer field, wh
On Oct 11, 2005, at 14:04 , CSN wrote:
I was thinking about the types in the C code behind
PostgreSQL, rather than types in PG itself. Been a
long time since I coded in C but I thought it had
unsigned ints and maybe data types could be mapped as
so (pardon my ignorance about C/PG's inner workin
--- Tom Lane <[EMAIL PROTECTED]> wrote:
> CSN <[EMAIL PROTECTED]> writes:
> > If integer's range is -2147483648 to +2147483647,
> why
> > is serial's range only 1 to 2147483647 instead of
> 1 to
> > about 4294967294?
>
> How are you going to stuff 4294967294 into an
> integer field, which as
> y
CSN <[EMAIL PROTECTED]> writes:
> If integer's range is -2147483648 to +2147483647, why
> is serial's range only 1 to 2147483647 instead of 1 to
> about 4294967294?
How are you going to stuff 4294967294 into an integer field, which as
you just stated has an upper limit of 2147483647?
If we had an
If integer's range is -2147483648 to +2147483647, why
is serial's range only 1 to 2147483647 instead of 1 to
about 4294967294?
CSN
__
Yahoo! Music Unlimited
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/
---
Mike Nolan <[EMAIL PROTECTED]> writes:
> The notes on participating in the 8.1 beta suggest creating a dump using
> both an old and new copy of pg_dump.
> Does this mean we can't use pg_dumpall or that we have to restore both
> dumps? (Or is that just a way of testing what works and what doesn'
The notes on participating in the 8.1 beta suggest creating a dump using
both an old and new copy of pg_dump.
Does this mean we can't use pg_dumpall or that we have to restore both
dumps? (Or is that just a way of testing what works and what doesn't
between older dump files and the beta release
Benjamin Smith wrote:
Now, I want to get a result like:
classroom | students | seats
101A 0 25
101B22 30
102A11 0
... etc.
Something somewhat akin to
select classroom.title,
count(students.id) AS students,
count(seats.id) AS seats
from classrooms, students, seats
wh
On Thu, Jul 21, 2005 at 10:09:07PM -0700, Benjamin Smith wrote:
> select classroom.title,
> count(students.id) AS students,
> count(seats.id) AS seats
> from classrooms, students, seats
> where classrooms.id=students.classrooms_id
> and classrooms.id=seats.id
>
> Except that it coun
I'm sure I've done this before, but for some reason, my main noodle is drawing
a blank. Assume we have three tables defined thusly:
create table classrooms (
id serial unique not null,
name varchar
);
create table seats (
classrooms_id integer not null references classrooms(id),
position var
Hi,
I believe this is a dumb question, and I have a sneaky feeling that I've
seen something about this on the list before, but I can't find it in the
archives.
I am used to using PostgreSQL on Linux, but we have moved some of our
work onto Solaris multiprocessor boxes. Now, I see multiple insta
55 matches
Mail list logo