On 9 November 2014 23:50, David G Johnston <[email protected]>
wrote:
> Guillaume Lelarge-3 wrote
> > 2014-11-09 8:52 GMT+01:00 Robins Tharakan <
>
> > tharakan@
>
> > >:
> >
> >> Hi,
> >>
> >> This is a ping to check if adding this minor feature is okay.
> >>
> >> When the SQL is generated in the ObjectBrowser->SQLPane (for a table),
> it
> >> adds OIDS = FALSE, by default. I think that for a while, this has been
> >> irrelevant (unless of course the table actually has OIDs enabled).
> >>
> >> Hope its okay to add a Check box in Options->Browser->UI Miscellaneous
> >> (Show if OIDS = FALSE) that allows a user to disable this part of the
> >> SQL.
> >>
> >> To confirm,
> >> - OIDS = TRUE would also show up, irrespective of the value of this
> >> check-box
> >> - For now, the Check-Box would be enabled by default
> >>
> >> Let me know if this isn't a great idea.
> >>
> >>
> > It'd be better to not have the checkbox, and rely on the value of the
> > default_with_oids GUC.
>
> IIRC this logic was recently addressed and introduced to psql and should
> probably be mirrored in pgAdmin.
>
> David J.
>
Thanks David / Guillaume,
I'll begin work mimicking psql.
However, looks like psql doesn't refer to the Configuration
(default_with_oids) at all. It just prints 'WITH OIDS' if the table has
enabled OIDS, or none if otherwise. (see psql output attached)
On the other hand, I was assuming the following should be how its done (but
psql differs on 4th line).
- Default_with_oids (off) + table WITH OIDS => Show WITH OIDS
- Default_with_oids (off) + table WITHOUT OIDS => {Show nothing}
- Default_with_oids (on) + table WITH OIDS => Show WITH OIDS
*- Default_with_oids (on) + table WITHOUT OIDS => Show WITHOUT OIDS*
--
Robins Tharakan
* *
t1=# show default_with_oids;
default_with_oids
-------------------
off
(1 row)
t1=# create table defoffwithoids(a int) with(oids=on);
CREATE TABLE
t1=# create table defoffwithoutoids(a int) with(oids=off);
CREATE TABLE
t1=# \d+ defoffwithoutoids
Table "public.defoffwithoutoids"
Column | Type | Modifiers | Storage | Stats target | Description
--------+---------+-----------+---------+--------------+-------------
a | integer | | plain | |
t1=# \d+ defoffwithoids
Table "public.defoffwithoids"
Column | Type | Modifiers | Storage | Stats target | Description
--------+---------+-----------+---------+--------------+-------------
a | integer | | plain | |
Has OIDs: yes
.
.
.
.
postgres=# show default_with_oids;
default_with_oids
-------------------
on
(1 row)
postgres=# create table defonwithoutoids(a int) with(oids=off);
CREATE TABLE
postgres=# create table defonwithoids(a int) with(oids=on);
CREATE TABLE
postgres=# \d+ defonwithoutoids
Table "public.defonwithoutoids"
Column | Type | Modifiers | Storage | Stats target | Description
--------+---------+-----------+---------+--------------+-------------
a | integer | | plain | |
postgres=# \d+ defonwithoids
Table "public.defonwithoids"
Column | Type | Modifiers | Storage | Stats target | Description
--------+---------+-----------+---------+--------------+-------------
a | integer | | plain | |
Has OIDs: yes
.
.
.
.
postgres=# select version();
version
---------------------------------------------------------------------------------------------------------
PostgreSQL 9.5devel on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu
4.8.2-19ubuntu1) 4.8.2, 64-bit
(1 row)
.
.
.
~$ /opt/postgres/bin/psql -V
psql (PostgreSQL) 9.5devel
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers